Skip to content
Crystal CodeDocs
ENEnglish

Plugins

Add in-process extensions under plugins/. A project directory of the same name replaces the home plugin.

Setting Effect
"enabled": false in plugin.json Leaves the directory in place and does not load it
"plugins": false in config.json Skips discovery. true is omitted from the written file

A plugin can add tools, a protocol client, approval classifiers, slash commands, hooks, raw hooks, and prompt placeholders. It can read the current session model and whether review uses its own model.

Capability What it may do
IPluginDataDirectory Receives its global and project runtime-data directories
Model clients Calls the session model, and the review model while that switch is on. Separate clients. Not written to the transcript
Hooks Append prompt and compaction text. Rewrite a user message before it is stored. Revise one outbound request without changing the stored transcript. Read one completed response. Rewrite a tool call (approval runs again). Replace a tool result. Raise approval risk
Hooks may not Lower risk, or replace Work, Plan, or Review
Raw hooks Rebuild one outbound request. Replace composed prompt and compaction text with any string. Replace an approval classification with any risk, authority, summary, and prompt requirement. Named in a note at load

More hook methods will be added later. Plugin dependencies on one another are not decided. A module system below plugins is not in this build.

/plugins lists them. /plugins on|off|reload controls discovery. /plugins enable|disable|show <directory> changes one plugin. crystal plugins list|show|enable|disable does the same outside a session and prints a Spectre.Console table unless --format text is set.

Details are in Plugins.