canon-revision

canon-revision is a skill for Claude Code from tonydzi/second-brain-starter-kit. It costs 90 tokens per session (1,731 once invoked), scanned A, original, MIT.

A procedure for reorganising a large, always-loaded rules file such as CLAUDE.md or MEMORY.md while preserving every original rule. CLAUDE.md and MEMORY.md are files that give a coding agent persistent project or personal instructions.

In plain words
What is it for?
It helps group rules, create a short priority section, and replace bulky mechanics with concise triggers and references. A script performs the byte-preserving moves.
Why use it?
It keeps important rules easy to find as the file grows and proves that no rule was accidentally lost during restructuring.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; mentions CLAUDE.md.

Part of the second-brain-skills plugin — 100 skills shipped together

Good fit It helps group rules, create a short priority section, and replace bulky mechanics with concise triggers and references. A script performs the byte-preserving moves.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tonydzi/second-brain-starter-kit/canon-revision
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add tonydzi/second-brain-starter-kit --skill canon-revision
Clone the repo
git clone --depth 1 https://github.com/tonydzi/second-brain-starter-kit

Made for: Claude Code.

Or install second-brain-skills, the plugin that ships this one along with the rest of its 100 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for canon-revision

README.md
[![agentmods](https://agentmods.dev/badge/skills/tonydzi/second-brain-starter-kit/canon-revision/github.svg)](https://agentmods.dev/skills/tonydzi/second-brain-starter-kit/canon-revision)
Your own site
<a href="https://agentmods.dev/skills/tonydzi/second-brain-starter-kit/canon-revision"><img src="https://agentmods.dev/badge/skills/tonydzi/second-brain-starter-kit/canon-revision/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for canon-revision

Your own site · 80×15
<a href="https://agentmods.dev/skills/tonydzi/second-brain-starter-kit/canon-revision"><img src="https://agentmods.dev/badge/skills/tonydzi/second-brain-starter-kit/canon-revision.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,731 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00090 $0.01731
Opus 5 $0.00045 $0.00865
Sonnet 5 $0.00018 $0.00346
Haiku 4.5 $0.00009 $0.00173

Measured yesterday against content hash 658a0cede1fd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

canon-revision scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

The scan reads SKILL.md. This mod also ships 2 executable files (references/fold_four.py, references/restructure_claude_md.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/canon-revision/SKILL.md · 76 lines

How it starts

The opening of the file, as written. The whole thing — 76 lines — stays where its author put it; the contents beside it link to each section on GitHub.

canon-revision — revising an always-loaded rules file

The pain: the rules file grows through intake, the structure drifts, and the important parts drown in the middle. The owner's decision (2026-07-22): live in cycles — free growth up to the yellow zone, then a FULL structural revision. This procedure is that revision, battle-tested on CLAUDE.md v2.

Roles: the LLM decides ONLY (a) the mapping of sections into categories, (b) the contents of the TOP block, (c) which sections to fold, plus pinpoint edits from the owner's explicit decisions. The bytes are moved by the SCRIPT, which proves by itself that nothing was lost. Never retype the file by hand.

Step 0 — RECALL + the frame

  • Memory: [[claude-md-compression-contract]] (the contract: trigger · directive · clauses · pointer; the two-ends pitfall), [[write-service-files-tight-no-recompress]], [[memory-index-hygiene]] (for MEMORY.md), [[declined-decisions]] (word-level re-compression = declined).
  • Thresholds = the defaults in ~/.claude/scripts/claude_md_guard.py (owner, 07-22: yellow 100KB · red 120KB). The truth is the guard's code, not the notes.
  • A revision = a canon edit → the owner's machine only, in a live session.

Step 1 — Measure BEFORE

python ~/.claude/scripts/claude_md_guard.py + byte size + section counter (^## / ^### ). Record: bytes, sections, md5.

Step 2 — Coordination and safety net

  1. onair.py check --zone canon-skills (for MEMORY.md: memory-index) → clear → onair.py declare --mode exclusive.
  2. canon_write_gate.py <file> → GO + an automatic backup; plus your own *.bak-<date>-revision.
  3. ⚠️ The two-ends pitfall (memory compression-contract): before publishing, verify (a) the md5 of the canon base, (b) the diff of the assembled file against YOUR live file — parallel sessions keep appending through intake.

Step 3 — Assembly (deterministic)

Take references/restructure_claude_md.py (the working sample from 07-22) and adapt the mapping:

  • Split by ^## headings; every heading must land in the mapping, an extra/missing one = a loud refusal.
  • Categories ## §N. <name> + rules ### §N.M <old heading>; bodies verbatim.
  • The TOP block ## §0. ⭐ TOP-N — the most important rules by the owner's priorities, one line = a rule + → §X.Y; show the TOP composition to the owner before applying it (or take his previous priorities).
  • Pinpoint edits — only from the owner's explicit decisions, each through an anchored replace with assert count==1.
  • Built-in check: every body is present in the output (BODY LOST = refusal).

Read the full file on GitHub · 76 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · +2 lines · -14 tokens per session 658a0cede1fd
  2. 9d ago First seen · 74 lines · 104 tokens per session scan A 0fb1012d51f8

Subscribe to this mod's changes

canon-revision is a skill published in the GitHub repository tonydzi/second-brain-starter-kit (6 stars, last pushed yesterday), licensed MIT. It adds 90 tokens to every session and 1,731 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

wiki-retrieve

Build and query a vault-local contextual BM25 retrieval index with optional multilingual Nomic cosine reranking; use for retrieve, hybrid retrieval, BM25, rerank, contextual retrieval, chunk search, vault search, semantic search, find relevant passages, or retrieval diagnostics. Derived caches stay under .vault-meta…

AgriciDaniel/claude-obsidian · 81 tokens

obsidian-bases

Explain, draft, and validate Obsidian Bases .base files with filters, formulas, properties, summaries, and table, card, or list views. Use for Obsidian Bases, database-like vault views, dynamic tables, reading lists, task trackers, filters, formulas, summaries, and .base file edits.

AgriciDaniel/claude-obsidian · 69 tokens

save

Save a user-selected answer, decision, insight, or session summary into an Obsidian vault as one reviewed transaction. Use only when the user explicitly asks to preserve specific conversation content, not when they supply a file or URL to ingest. Triggers: /save, save this, save that answer, file this conversation…

AgriciDaniel/claude-obsidian · 80 tokens

wiki-fold

Create a bounded, extractive, structurally idempotent rollup of recent Obsidian wiki log entries, with dry-run preview by default and one optional transaction apply. Use for manual log compression without modifying child pages. Triggers: fold the log, run a fold, run wiki-fold, log rollup, roll up log entries, commit…

AgriciDaniel/claude-obsidian · 76 tokens

wiki-mode

Read or configure the vault filing methodology and suggest destinations for planned knowledge creation under Generic, LYT, PARA, or Zettelkasten. Use for wiki mode, methodology mode, what is my vault mode, set vault mode, switch to PARA, use LYT, Zettelkasten setup, change mode, configure mode, or methodology routing.…

AgriciDaniel/claude-obsidian · 83 tokens

wiki-cli

Detect and use the official Obsidian command-line interface for read-only vault access; use for wiki-cli, Obsidian CLI, Obsidian read, Obsidian search, vault transport, which transport, transport detection, backlinks, tags, or Obsidian command line. Mutations always go through the claude-obsidian transaction core.

AgriciDaniel/claude-obsidian · 74 tokens