Skip to content
PluginStats

@hasna/hooks weekly downloads statistics

By hasna (9 listings) · npm · MCP servers

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

View on npm Fresh · Oct 17, 2026

@hasna/hooks has 5,129 recorded weekly downloads on npm, a decrease of 40.3% over the past 30 days.

It ranks #1085 of 2,256 tracked npm listings by weekly downloads.

Over 90 days, weekly downloads changed by +1035%.

PluginStats has 121 daily observations since Jun 19, 2026; the latest is from Oct 17, 2026.

Weekly downloads
5,129
Official API · Oct 17, 2026
7-day growth
-51.1%
-5.4K weekly downloads
30-day growth
-40.3%
-3.5K weekly downloads
90-day growth
+1035%
+4.7K weekly downloads
Rank
#1085
Among tracked npm listings

About @hasna/hooks

@hasna/hooks

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

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. • Catalog. 57 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); • 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 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 , and that command needs the same setting. Without it the hook exits with REMOTE_API_CONFIG_MISSING and does not guard anything.

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 /bin/index.js for hooks; • the same with bin/hooks-mcp.js or bin/serve.js for the others; • is $(npm root -g)/@hasna/hooks for an npm global install.

Without the flags, Bun reads the working directory's bunfig.toml and .env. Agents run installed hooks as hooks run . On such systems, put a hooks wrapper on PATH: a #!/bin/sh script that runs exec bun --config=/dev/null --no-env-file --no-macros --no-install /bin/index.js "$@". Otherwise every hook installed as hooks run fails at each event and guards nothing. The native-safety guards are registered with a pinned runtime and do not go through this shebang. For MCP, use "command": "bun" with those flags and /bin/hooks-mcp.js as its arguments.

Prompt for your agent

Paste this to your coding agent and it sets the hooks up itself:

Hook catalog

Run hooks list --all --verbose for each hook's description, or hooks info for one hook.

| Category | Hooks |

| Git safety | gitguard, branchprotect, checkpoint, worktree-guard, workspace-repos-guard, trash-guard, conflict-detect | | Code quality | checktests, checklint, checkfiles, checkbugs, checkdocs, checktasks, stylescheck, typecheck-gate, affected-tests | | Security | checksecurity, packageage, pre-bash, scanoutput, signed-link-guard, signed-link-output | | Permissions | permissionguard, protectfiles, promptguard, prompt-guard | | Context management | contextrefresh, precompact, knowledge-context, mementos-context | | Workflow automation | autoformat, autostage, tddguard, failure-to-task | | Environment | envsetup | | Notifications | phonenotify, agentmessages, desktopnotify, slacknotify, soundnotify | | Observability | sessionlog, commandlog, costwatch, errornotify, spiral-detector, scratch-lifecycle | | Agent teams | taskgate, session-start, stop-review, stop-sync, filelock, announce-start, announce-stop, dm-inject, fleet-catchup, agent-rules-version-check, fleet-blockers-gate |

CLI Usage

Trash startup readiness

The bundled trash-readiness observer checks an installed Trash ready plan at session startup. It reports a short ready or attention message. It does not capture files, repair settings, retry failed requests, or authorize deletion. Keep the separate trash-guard installed and enabled.

Claude and Codex use their native SessionStart event for startup, resume, clear and fork. Compaction does not repeat this check. Configuration and native execution are separate: successful setup leaves nativeAdoptionVerified:false until the actual consumer has been exercised.…

Description from the npm listing.

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

Where @hasna/hooks sits in the listing

Each band is one page of 20. Weekly downloads on a log 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.

All npm2,256 listings · 113 pages · page 55, #5 (overall #1085)
All npm: every listing in weekly downloads order
PNG SVG
MCP servers255 listings · 13 pages · page 11, #8 (overall #208)
MCP servers: every listing in weekly downloads order
PNG SVG

Charts

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

Adoption over time

@hasna/hooks weekly downloads on npm, last 90 days: 5,129 weekly downloads as of Oct 17, 2026, +1035% over 90 days.@hasna/hooksWeekly downloads on npm · Last 90 days5,129downloads / week+1035% over 90 days05K10K15K20K25KJul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 21, 2026 – Oct 17, 2026 · 89 observations · Updated Oc…pluginstats.com
@hasna/hooks weekly downloads on npm, last 90 days: 5,129 weekly downloads as of Oct 17, 2026, +1035% over 90 days.
PNG SVG

7/30/90-day growth

@hasna/hooks weekly downloads growth on npm: -51.1% over 7 days, -40.3% over 30 days, +1035% over 90 days.@hasna/hooksWeekly downloads growth on npm5,129downloads / week now7-day growth-5,367 weekly downloads-51.1%30-day growth-3,467 weekly downloads-40.3%90-day growth+4,677 weekly downloads+1035%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
@hasna/hooks weekly downloads growth on npm: -51.1% over 7 days, -40.3% over 30 days, +1035% over 90 days.
PNG SVG

Ranking history

@hasna/hooks npm ranking history: currently #1085 (by weekly downloads).@hasna/hooksnpm ranking · by weekly downloads · Last 90 days#1085current rank#1081#1082#1083#1084#1085#1086#1087Jul 21Aug 5Aug 20Sep 4Sep 19Oct 4Oct 19rankOct 18, 2026 – Oct 19, 2026 · 2 observations · Updated Oct 17, 2026pluginstats.com
@hasna/hooks npm ranking history: currently #1085 (by weekly downloads).
PNG SVG

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.

Recent observations

Full history (121)
Recent weekly downloads observations for @hasna/hooks
Date (UTC)Weekly downloadsChange vs. previous
5,129-892
6,021+2.2K
3,796-2.2K
5,956-1.5K
7,4270
7,427-2.1K
9,535-961
10,496-1.6K
12,063-655
12,718-3
12,721-905
13,626-1.5K
15,084+1.1K
13,941—

Similar npm MCP servers plugins

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 Oct 19, 2026. See the methodology.