Skip to content
PluginStats

@hasna/hooks weekly downloads statistics

By hasna (9 listings) · npm · Claude Code

Open source hooks library for AI coding agents - Install safety, quality, and automation hooks with a single command

View on npm Fresh · Dec 6, 2026

@hasna/hooks has 318 recorded weekly downloads on npm, a decrease of 95.9% over the past 30 days, ranking #2373 of 3,247 tracked listings.

Weekly downloads
318
Official API · Dec 5, 2026
7-day growth
-96.0%
-7.6K weekly downloads
30-day growth
-95.9%
-7.4K weekly downloads
90-day growth
+212%
+216 weekly downloads
Rank
#2373
▼ 1045 in 7 days

About @hasna/hooks

@hasna/hooks

Open source hooks library for AI coding agents - Install safety, quality, and automation hooks with a single command

npm License

What it does

@hasna/hooks installs hooks into AI coding agents. A hook is a small program the agent runs at a fixed point: before a shell command, after a file edit, or when a turn ends. Hooks block a mistake, check the work, or automate a step. One CLI installs, lists, updates and removes them.

  • Agents. Claude Code (the default target) and Codex. Compatible OpenCode and Sumi builds are supported for the stop-review hook. Gemini CLI is an install target (--target gemini), but the bundled shell guards do not yet recognise Gemini's tool names (run_shell_command rather than Bash), so do not rely on them there yet. Codewith targets remain for existing setups, but Codewith is deprecated.

  • Install targets. --target also accepts qwen, muse, kimi, pi and cursor, each writing that harness's own config with an entry that calls hooks run <hook> --target <name>. They are not interchangeable: Muse hands over the final message as a quoted JSON string, which hooks run --target muse parses once; Kimi's stop payload carries no assistant text and Kimi blocks with exit 2 and stderr; Pi runs hooks through the hasna-pi-hooks bridge and receives no assistant text; Cursor's stop hook can neither block the turn nor carry the assistant text. A hook whose manifest sets requires_final_message or requires_block is refused at install on a target that cannot honour it, with the measured reason, instead of being installed to do nothing. opencode and sumi have no generic install path and are refused by name; their stop review is registered through hooks install stop-review --target <opencode|sumi>.

  • Catalog. 58 bundled hooks in 10 categories, listed below. You can also install your own hooks from a local directory, a git URL or a manifest URL.

  • Safety core. Guards that:

    • block destructive git commands (gitguard);
    • send rm to a recoverable trash store instead of deleting (trash-guard). It needs the trash CLI from @hasna/trash on PATH; without it, trash-guard refuses the rm;
    • protect repository checkouts (workspace-repos-guard);
    • refuse a delete of /, the home directory, ~/.hasna, ~/.ssh, ~/.aws and of coding-agent session and history stores, without Trash (protected-delete-guard);
    • keep signed links out of agent transcripts (signed-link-guard).

    scanoutput is detection only: it warns about a secret in tool output after the output is already in the transcript, and cannot prevent or redact it.

    Each is installed as a hook. For Claude Code, Codex and Sumi, hooks safety install trash-guard --target <codex|claude|sumi> can also register trash-guard, workspace-repos-guard and signed-link-guard as one native safety entry; the other guards are not part of it. --target defaults to codex, so name the agent.

  • Interfaces. The hooks CLI, an MCP server (hooks-mcp) and a self-hostable hook registry (hooks-serve).

Quick start

The CLI runs on Bun 1.0 or later, so bun must be on PATH. Without a Hasna hooks registry credential, use local mode: the bundled catalog and a local store in ~/.hasna/hooks. Set it in your shell profile, not only in the current shell. The agent runs each installed hook as hooks run <name>, and that command needs the same setting. Without it the hook exits with REMOTE_API_CONFIG_MISSING and does not guard anything.

bun --version                            # Bun 1.0 or later is required
npm install -g @hasna/hooks
echo 'export HASNA_HOOKS_LOCAL=1' >> ~/.zshrc   # or ~/.bashrc; then open a new shell.
# Only without a registry credential: the opt-in takes precedence over Keychain and file credentials.
hooks list --all --verbose               # browse the full catalog
hooks install gitguard --dry-run         # preview what would be installed
hooks install gitguard                   # Claude Code picks it up live; restart if /hooks does not list it
hooks install gitguard --target codex    # or Codex; then review and trust it in Codex's /hooks
hooks list --installed --target codex    # what is installed for one agent
hooks doctor                             # check the Claude Code installation
hooks verify                             # read-only: every hook, what its trust rests on, and any mismatch
echo '{"hook_event_name":"PreToolUse","tool_name":"Bash","tool_input":{"command":"git reset --hard"}}' \
  | hooks run gitguard                   # a simulated command: prints a "block" decision, runs nothing

Starting the commands. The hooks, hooks-mcp and hooks-serve commands start through #!/usr/bin/env -S bun --config=/dev/null --no-env-file --no-macros --no-install. Started this way, they do not read the working directory's bunfig.toml or .env, so a project an agent works in cannot run code inside them. Starting them as commands needs GNU coreutils 8.30 or later, or the macOS/BSD env. That covers PATH, an npm or Bun bin link, bun x and bunx. The flags are verified with Bun 1.3.14, which silently ignores flags it does not know, so an older Bun may start the commands without one of these protections.

With BusyBox env (for example on Alpine) or older coreutils, start them through Bun with the same flags:

  • bun --config=/dev/null --no-env-file --no-macros --no-install <package>/bin/index.js for hooks;
  • the same with bin/hooks-mcp.js or bin/serve.js for the others;
  • <package> is $(npm root -g)/@hasna/hooks for an npm global install.…

Description from the npm listing.

  • claude-code
  • codex
  • opencode
  • sumi
  • ai-agents
  • agent-safety
  • mcp
  • hooks
  • cli
  • typescript
  • bun
  • git-safety
  • code-quality
  • security

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

@hasna/hooks weekly downloads on npm, last 90 days: 318 weekly downloads as of Dec 5, 2026, +212% over 90 days.@hasna/hooksWeekly downloads on npm · Last 90 days318downloads / week+212% over 90 days05K10K15K20K25KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@hasna/hooks weekly downloads on npm, last 90 days: 318 weekly downloads as of Dec 5, 2026, +212% over 90 days.

7/30/90-day growth

@hasna/hooks weekly downloads growth on npm: -96.0% over 7 days, -95.9% over 30 days, +212% over 90 days.@hasna/hooksWeekly downloads growth on npm318downloads / week now7-day growth-7,632 weekly downloads-96.0%30-day growth-7,362 weekly downloads-95.9%90-day growth+216 weekly downloads+212%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@hasna/hooks weekly downloads growth on npm: -96.0% over 7 days, -95.9% over 30 days, +212% over 90 days.

Ranking history

@hasna/hooks npm ranking history: currently #2373 (by weekly downloads).@hasna/hooksnpm ranking · by weekly downloads · Last 90 days#2373current rank#1000#1200#1400#1600#1800#2000#2200#2400Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
@hasna/hooks npm ranking history: currently #2373 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 119, #13 (overall #2,373)
All npm: every listing in weekly downloads order

Listing placement

Claude Code614 listings · 31 pages · page 27, #18 (overall #538)
Claude Code: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (170)
Recent weekly downloads observations for @hasna/hooks
Date (UTC)Weekly downloadsChange vs. previous
318-172
490-430
920-7
927-611
1,538-1.2K
2,739-3K
5,708-2.2K
7,950-3.4K
11,312-95
11,407-1.1K
12,468-295
12,763-295
13,058-438
13,496—

Similar npm Claude Code plugins

All 20 @hasna/hooks alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/@hasna/hooks. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.