Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By Orthogon-AI-Labsv0.7.0MITIn 1 marketplace
Protected sections for Claude Code: mark the Markdown blocks an agent must not rewrite. An edit guard blocks unapproved changes, approval comes only from your own message, and a Stop check catches anything that slips through.
You run one by typing its /name in Claude Code.
2 cautions to review before installing
A hook runs when Claude uses the Bash tool
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
canon, protected-sections, markdown, guardrails, hooks, agent-reliability, claude.md
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
canon stops Claude Code from rewriting the parts of your Markdown files you've marked as protected.
In Claude Code:
/plugin marketplace add Orthogon-AI-Labs/canon
/plugin install canon@canon
Or load a local checkout: claude --plugin-dir /path/to/canon.
canon needs git and python3.
Wrap the section in two markers and commit the file:
<!-- canon:protected:start name="voice-rules" -->
Write plainly. No marketing language.
<!-- canon:protected:end -->
You can also ask Claude to do it with /canon:protect <file> <section-name>. Pick a descriptive name, because it appears in every warning about that block.
A block is protected once it's committed: canon compares your files against the last commit.
The agent can't edit the block. canon blocks any Edit, Write or MultiEdit that would change, remove or rename a protected block, and the agent has to ask you first. Edits outside the block go through.
Only you can approve a change. Put this line in your own message, on a line or sentence of its own:
I approve editing protected section: voice-rules
That approves blocks with that name for the rest of the session. If the name has spaces, put it in quotes: I approve editing protected section: "voice rules". The agent can't approve for itself: canon doesn't count the phrase in a question, a code block, text Claude Code adds to the conversation, or a message that quotes canon's own report.
Shell changes are reported right away. If a shell command changes a protected block (sed -i, a heredoc, a script), canon tells the agent as soon as the command finishes, while it can still undo the change.
Other changes are caught at the end of the reply. If a protected block changed some other way, such as you editing the file, the agent has to report it when it finishes its reply.
Each change is reported once by each check. A change made by a shell command is reported right after it, and once more when the agent finishes its reply, so the agent is reminded before it tells you it's done. Neither check repeats it after that, and a later shell command doesn't repeat a change already reported at the end of a reply. A change is reported again if the block's text changes further, or if it's undone and then comes back.
To stop protecting a block, remove its markers.
Run /canon:check-protected in Claude Code, or this from a checkout of this repo:
python3 hooks/scripts/check-protected-sections.py
It exits 0 if every protected block matches the last commit, 1 if one changed (with the file and block name), and 2 outside a git repository. --allow=<name> lets one approved block differ (write it with =, so a name starting with - isn't read as an option).
Bash tool is checked as it runs. A block changed by another tool, such as an MCP server's, is caught at the end of the reply.Bash command adds about 0.2 s to it (median 203 ms over 20 runs on an Apple-silicon Mac, in a small repository)..md files are checked (any case, such as NOTES.MD), not .markdown or .mdx.Edit tool applies it. If a later version applies edits differently, the end-of-reply check still catches the result.Four hooks, which do nothing in a project without protected blocks:
npx claudepluginhub orthogon-ai-labs/canon --plugin canonPlugins from other owners that cover similar ground
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.