DEV Community

Cover image for Installs Claude Code Mods with one command
Daniel (San) Ávila
Daniel (San) Ávila

Posted on Originally published at Medium

Installs Claude Code Mods with one command

Mods let you hook into Claude Code while it works: block a command, rewrite a tool call, redact a secret from a result, or draw a live pane above the prompt. Until recently that meant writing the module yourself, packaging it as a plugin and publishing a marketplace. The Mods catalog on aitmpl.com removes those steps: 38 mods, one command each.

What a Mod is

A Mod is a Claude Code plugin whose behavior lives in a function-hooks module. A shell hook reacts to an event after the fact. A function hook wraps the event: your function receives the engine object $, the event e, and a next continuation, and decides what happens.

That gives three positions instead of one:

  • Observe. Await next(e) and inspect what came back.
  • Rewrite. Call next({ ...e, input }) with changed data, or change the result on the way out.
  • Answer. Return { deny: "reason" } and never call next. The tool does not run.

The module runs in a sandbox of its own, with no DOM and no Node. Everything outside it goes through $: $.ui, $.http, $.fs, $.process, $.state, $.store, $.session, $.command, $.tool, $.model and $.clock. That is what makes a mod more than a filter.

image

It is a plugin, so there are two ways to get one

Mods are distributed as plugins. The standard route is a plugin marketplace (a repo with .claude-plugin/marketplace.json):

/plugin marketplace add <repo>
/plugin install <mod>@<marketplace>
/reload-plugins
Enter fullscreen mode Exit fullscreen mode

With aitmpl.com you skip that. Pick a mod on the site, copy the command, run it in your project:

npx claude-code-templates@latest --mod security/secret-redactor
Enter fullscreen mode Exit fullscreen mode

The CLI downloads the whole plugin directory (.claude-plugin/plugin.json, hooks/, commands, types, tests) and writes it to .claude/skills/secret-redactor/. Claude Code loads it on the next session as secret-redactor@skills-dir.

image

Two details that trip people up:

  1. Trust. A project’s .claude/skills/ is only read once you have accepted the workspace trust prompt. In a folder you never opened interactively (for example a headless claude -p run) the mod does not load. Install it in ~/.claude/skills/ if you want it everywhere.
  2. Options. Mod options are declared as userConfig in plugin.json and read from your user settings, keyed by the full plugin id:
{ "pluginConfigs": { "npm-to-pnpm-rewriter@skills-dir": { "options": { "manager": "yarn" } } } }
Enter fullscreen mode Exit fullscreen mode

Use the wrong key ("npm-to-pnpm-rewriter") and every option silently stays at its default.

What is in the catalog

Seven categories, 38 mods:

  • security: secret-redactor, block-destructive-commands, protected-paths-guard, large-edit-confirmation, jev-auto-mode, jev-guardrails, jev-vercel-sandbox
  • productivity: aitmpl (a component browser inside Claude Code), npm-to-pnpm-rewriter, webfetch-cache, jev-model-router, jev-skill-suggestion
  • ui: agent-flow, git-sidebar, tool-timing-badge
  • observability: prompt-cache-control, universal-audit-log
  • integrations: linear-tickets, vercel-deploys, neon-branch-per-session, websearch-to-exa, pi-agent-for-claude
  • enterprise: admin-capability-lockdown
  • games: 15 of them above the prompt, from snake and tetris to doom, pacman and tool-defense, where every enemy is one of Claude's real tool calls

Terminal and Desktop

Mods are not terminal-only. The official guide demos each one in both Claude Code in the terminal and Claude Code Desktop, and surfaces like panes and status lines are drawn through $.ui.resolve(e), which returns the constructors for whichever surface you are on. Same plugin, same install command, both places.

Requirements

  • Claude Code 2.1.287 or later. Per the official guide, mods are on by default; there is nothing to enable. (Earlier early-access builds needed CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1.)
  • The $ API is still young and can change between releases. The catalog's type definitions follow Claude Code 2.1.283 and every mod is typechecked against them in CI.

Debugging a mod that seems silent

Before touching the code, check in this order:

  1. Is the project trusted? (See above.)
  2. Are you looking in the right place? $.ui.log goes to the transcript and to ~/.claude/debug/<session-id>.txt; in claude -p it only reaches the debug file.
  3. Is pluginConfigs keyed by name@skills-dir?
  4. Does claude --debug show hooks module <name>@skills-dir loaded?

A note on model routers: a mod that rewrites model or effort at turn.step changes that request only. The header, the status line and the effort box show your session's setting and will not move.

Try it

npx claude-code-templates@latest --mod games/pacman
Enter fullscreen mode Exit fullscreen mode

Browse the catalog at aitmpl.com, validate any installed mod with claude plugin validate <dir>, and run its tests with claude plugin test <dir>.

Where the Mods live

Every mod has its own page with the install command, the options it accepts and what it hooks.

image

You can follow me on my social media:

Top comments (0)