The system, launched on October 1 with Claude Code model 2.1.287, extends the instrument’s current plugin framework. Mods can rewrite prompts earlier than they attain the mannequin, block or modify instrument calls, approve or reject permission requests, redact info from instrument output and exchange or increase elements of Claude Code’s interface. Claude
Anthropic stated Mods are packaged inside plugins and work in each the Claude Code command-line interface and desktop utility. Builders can write their very own Mods or ask Claude Code to generate one, set up it and reload it throughout an energetic session.
The method provides builders considerably deeper management than Claude Code’s earlier hooks. Conventional hooks can set off exterior actions at outlined factors, however Mods execute capabilities towards occasions emitted by Claude Code itself. A Mod can run earlier than or after an occasion, exchange it fully, or wrap an occasion with code that executes on each side.
Occasions out there to Mods embody instrument calls, permission requests and interface rendering. The mechanism can due to this fact be used for capabilities starting from improvement safeguards to specialised shows. Anthropic’s examples embody displaying steady integration and deployment standing beside a dialog, requiring affirmation earlier than instructions alter manufacturing configuration, and recording instrument exercise for audit functions. Claude
The corporate has additionally moved some current Claude Code performance onto the brand new structure. The built-in /diff characteristic, which shows uncommitted modifications beside a session transcript, now operates as a Mod. Customers can disable it by the plugin interface or exchange it with their very own implementation. Anthropic stated it plans to shift extra built-in capabilities to Mods over time, permitting customers to retain a smaller core and add options selectively. Claude
Anthropic’s printed examples exhibit how the identical framework can assist light-weight interface additions and stronger controls. A pattern referred to as Token Climate shows context-window utilization above the immediate, whereas Blast Radius can cease a doubtlessly dangerous shell command and present what it will have an effect on earlier than the person chooses whether or not to proceed. Replay Theater data edits made throughout a flip and permits builders to assessment them sequentially. claude. dev Weblog
The flexibleness additionally introduces a big safety consideration. Anthropic says Mods are usually not sandboxed and run with the identical entry to a pc as Claude Code. The corporate advises customers to put in Mods solely from sources they belief, treating them in the identical method as different code executed on their machines. Claude
That warning is especially related as a result of a Mod can work together with prompts, instrument calls, recordsdata, processes and community assets out there by Claude Code. Code able to altering or intercepting these operations could possibly be helpful for imposing organisational insurance policies, however an untrusted extension might additionally acquire broad entry inside a developer’s working surroundings.
For organisations, Anthropic has added controls supposed to protect centrally managed restrictions. Group and Enterprise deployments, in addition to machines utilizing managed settings, load a built-in safety Mod referred to as sec-default first. It’s designed to stop user-installed Mods from overriding managed permission-denial guidelines and different protected organisational settings. Directors may management which plugin marketplaces customers could entry and might load their very own Mods forward of person extensions. Claude
A number of Mods can subscribe to the identical occasion. Anthropic says they execute based on their loading order, with the primary loaded Mod seeing an occasion first and receiving the ensuing occasion final. That association permits extensions from totally different builders to be stacked whereas giving directors a mechanism to position protecting controls on the outermost layer.
Mods require Claude Code 2.1.287 or later and are enabled by default in supported variations. The system writes version-specific TypeScript declarations for builders, an vital element as a result of Anthropic cautions that the Mod programming interface can change between releases. claude. dev Weblog