Back to feed

Claude Code Mods: Agent Behavior Configuration

Anthropic has released mods for Claude Code, allowing customization of the agent's behavior and interface through small TypeScript functions.

The mechanism is event-driven: every agent action generates an event that a mod can hook into. Scripts can run before, after, instead of, or around the main call.

Key capabilities of custom mods include:

  • rewriting prompts before sending them to the model
  • blocking, rewriting, or restarting tool calls
  • managing permission requests (approving or denying)
  • cleaning tool output of sensitive data
  • modifying the terminal and desktop app interfaces

Some built-in features, such as /diff, have already been converted to mods. Users can disable them or replace them with their own solutions. Anthropic plans to migrate other native features to this architecture.

Extensibility is provided via the Claude catalog or the /plugin command. Mods can be created dynamically, and changes are applied on the fly.

In Team and Enterprise plans, a security mod named sec-default loads by default. It prevents users from bypassing restrictions and blocks dangerous permissions.

It is important to note that mods are not sandboxed. Developers recommend installing extensions only from trusted sources to avoid developer-targeted attacks.

3.8K views

More from this channel Black Triangle

Similar in this category Technology