CodeDebrief
CLAUDE.md42 starsChanged 5 months agoApache-2.0View on GitHub
This project uses CodeDebrief to keep decision flows synchronized with the source code. For codebase questions about behavior, decisions, workflow structure, or changed-code context: 1. Prefer the CodeDebrief MCP agent_context tool before broad file-by-file searches. 2. Use agent_context for substantial changes, passing changed files, selected code, current file, flow id, symbol, or dependency path when available; inspect its returned workflow_slice before answering. 3. When the user asks to show a workflow, flusso, visual flow, canvas, or workflow_slice, prefer the canonical…
In this repository2 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/codedebrief.mdcCursor rule
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
24 rules. About 0 are common, 5 are distinctive, and 19 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
19
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Prefer the CodeDebrief MCP agent_context tool before broad file-by-file searches.
- Very specific: line 9
Use agent_context for substantial changes, passing changed files, selected code, current file, flow id, symbol, or dependency path when …
- Very specific: line 12
When the user asks to show a workflow, flusso, visual flow, canvas, or workflow_slice, prefer the canonical Mermaid visual: render …
- Very specific: line 23
Keep CodeDebrief visuals vertical/top-to-bottom by default.
- Distinctive: line 28
After the visual, include a short high-level written flow in the user's language, derived only from returned ordered steps, …
- Very specific: line 32
If the CodeDebrief result is too large, saved externally, truncated, or missing the exact canonical visual, retry with a smaller …
- Very specific: line 36
Do not synthesize a new Mermaid diagram and do not add limits, error codes, branches, or service steps that are absent from the …
- Very specific: line 49
Use expand_slice, workflow_path, snapshot_slice, explain_flow, explain_node, or explain_edge only when the first slice needs more precise …
- Very specific: line 51
Use codedebrief view ... only when a human wants the manual UI flowchart.
- Very specific: line 53
When helping a user set up or learn CodeDebrief:
- Very specific: line 55
Start with codedebrief --help, then use codedebrief <command> --help for the specific command you plan to run or recommend.
- Very specific: line 57
Use codedebrief doctor when install, dependency, or parser capability issues are unclear.
- Distinctive: line 59
Do not ask for LLM provider keys for the primary workflow.
- Distinctive: line 66
After code or workflow-relevant changes:
- Very specific: line 68
Treat CodeDebrief artifacts as part of done.
- Very specific: line 72
Use codedebrief update --full after analyzer upgrades, parser/dependency changes, large refactors, or when cached file models should be …
- Very specific: line 74
Run codedebrief validate --check-sync.
- Distinctive: line 76
Commit synchronized changes to:
- Very specific: line 80
Use CodeDebrief MCP agent_context to inspect affected entry points and callers when explaining or reviewing the change.
- Very specific: line 87
Run npm run viewer:typecheck, npm run viewer:test, and npm run viewer:build.
- Distinctive: line 90
Check the generated viewer with a cache-buster URL.
- Very specific: line 95
Keep examples/Certifexp/ private and untracked.
- Very specific: line 96
If examples/Certifexp/ exists locally, run UV_CACHE_DIR=/tmp/codedebrief-uv-cache uv run pytest tests/test_certifexp_local.py as an opt-in …
- Very specific: line 99
Do not commit Certifexp source, generated artifacts, caches, nested repository data, or analysis output.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- codedebrief:instructions:start -->CodeDebrief
This project uses CodeDebrief to keep decision flows synchronized with the source code.
For codebase questions about behavior, decisions, workflow structure, or changed-code context:
- Prefer the CodeDebrief MCP
agent_contexttool before broad file-by-file searches. - Use
agent_contextfor substantial changes, passing changed files, selected code, current file, flow id, symbol, or dependency path when available; inspect its returnedworkflow_slicebefore answering. - When the user asks to show a workflow, flusso, visual flow, canvas, or
workflow_slice, prefer the canonical Mermaid visual: renderworkflow_slice.presentation.canonical_visual.diagramexactly as returned only when the client renders Mermaid inline. If the client cannot render Mermaid inline, or if Mermaid would appear as a raw code block, callsnapshot_slicewithinclude_svg=falseand provideartifact.mermaid_path,artifact.mermaid_markdown_path, orartifact.mermaid_open_commandas the visual result before prose. Do not paste a long Mermaid code block as the primary visual unless the user explicitly asks for raw or copyable Mermaid. Do not rendersnapshot.svginline by default; SVG artifacts are for explicit SVG requests or local inspection because their layout can differ from Mermaid. Keep CodeDebrief visuals vertical/top-to-bottom by default. Use a horizontal layout only when the user explicitly asks for a compact horizontal overview. Inspect the full returnedworkflow_slicebefore deciding what to show. Choose the first visible depth yourself: show the clearest useful subset, then say that the displayed diagram is a bounded summary and can be expanded. After the visual, include a short high-level written flow in the user's language, derived only from returned ordered steps, primary/supporting flows, decisions, domain logic, source ranges, and focused follow-up payloads. Keep it compact and explain the happy path first, adding only the branches needed by the request. If the CodeDebrief result is too large, saved externally, truncated, or missing the exact canonical visual, retry with a smallertoken_budgetand narrowerflow_id,symbol,current_file, orscope; do not recover by listing flows and hand-building a diagram. Do not synthesize a new Mermaid diagram and do not add limits, error codes, branches, or service steps that are absent from theworkflow_slicepayload. Do not read source files to rebuild, relabel, or extend the diagram; source reads are only follow-up explanation after the deterministic visual is shown and must not change displayed nodes, edges, labels, or branches. If neither exact canonical Mermaid nor a returned Mermaid artifact can be used, say so and provideviewer_targetsinstead of creating a replacement Mermaid diagram. If the user asks for a more language-friendly version, rewrite the technical block labels and the high-level written flow in simple wording using the language of the user's request. This is allowed only as a separate presentation layer derived from returned node, edge, decision, step, and source fields. End visual answers with concise options in the user's language: simplify labels and written flow, expand omitted nodes/branches/adjacent flows, or explore a related area. Show raw JSON or YAML only when explicitly requested. - Use
expand_slice,workflow_path,snapshot_slice,explain_flow,explain_node, orexplain_edgeonly when the first slice needs more precise context. - Use
codedebrief view ...only when a human wants the manual UI flowchart.
When helping a user set up or learn CodeDebrief:
- Start with
codedebrief --help, then usecodedebrief <command> --helpfor the specific command you plan to run or recommend. - Use
codedebrief doctorwhen install, dependency, or parser capability issues are unclear. - Do not ask for LLM provider keys for the primary workflow. Language-friendly labels and high-level written flows are presentation layers derived from deterministic workflow facts.
codedebrief setup <target>updates only that target's files. Run the command separately for each agent surface you want to configure, preserving any target-specific frontmatter and local notes.
After code or workflow-relevant changes:
- Treat CodeDebrief artifacts as part of done. After every meaningful source, route,
config, or agent-instruction change, run
codedebrief updatebefore finalizing or committing so MCP answers andcodedebrief viewuse current graphs. Skip only changes that cannot affect the modeled code logic, such as unrelated copy edits or images. - Use
codedebrief update --fullafter analyzer upgrades, parser/dependency changes, large refactors, or when cached file models should be ignored. - Run
codedebrief validate --check-sync; this checks both current-source JSON sync and whethercodedebrief-out/codedebrief.mdwas rendered from that JSON. - Commit synchronized changes to:
codedebrief-out/codedebrief.jsoncodedebrief-out/codedebrief.mdcodedebrief-out/codedebrief.hash.json
- Use CodeDebrief MCP
agent_contextto inspect affected entry points and callers when explaining or reviewing the change. - Ground the explanation in the returned
workflow_slice; expand it through MCP only when the initial slice omits relevant callers, callees, domain states, or paths.
For viewer/UI changes:
- Run
npm run viewer:typecheck,npm run viewer:test, andnpm run viewer:build. - Regenerate HTML artifacts with
codedebrief updateandcodedebrief view --render-only --no-open. - Check the generated viewer with a cache-buster URL.
<!-- codedebrief:local-notes:start -->For local real-world regression checks:
- Keep
examples/Certifexp/private and untracked. - If
examples/Certifexp/exists locally, runUV_CACHE_DIR=/tmp/codedebrief-uv-cache uv run pytest tests/test_certifexp_local.pyas an opt-in local check. - Do not commit Certifexp source, generated artifacts, caches, nested repository data, or analysis output.
<!-- codedebrief:local-notes:end -->CodeDebrief is a comprehension and navigation tool for source-grounded workflows. Use it to explain modeled logic, not to present possible defects.
<!-- codedebrief:instructions:end -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

