Borrowing it
Nothing to install: this file belongs to PDgit12/knitbrain. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/PDgit12/knitbrain/main/CLAUDE.mdgit clone --depth 1 https://github.com/PDgit12/knitbrainWrote 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.
[](https://agentmods.dev/instructions/pdgit12/knitbrain/claude-md)<a href="https://agentmods.dev/instructions/pdgit12/knitbrain/claude-md"><img src="https://agentmods.dev/badge/instructions/pdgit12/knitbrain/claude-md/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.
<a href="https://agentmods.dev/instructions/pdgit12/knitbrain/claude-md"><img src="https://agentmods.dev/badge/instructions/pdgit12/knitbrain/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00892 | $0.00892 |
| Opus 5.5 | $0.00357 | $0.00357 |
| Sonnet 5.5 | $0.00178 | $0.00178 |
| Haiku 4.5 | $0.00089 | $0.00089 |
Grade C, and why
knitbrain CLAUDE.md scanned grade C with 1 finding 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 2mo ago.
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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
Always `rm -rf dist && npm run verify` before claiming green — stale dist masks build-order bugs. Local rebuild note: `build` re-chmods the three dist entrypoints (a globally symlinked install breaks otherwise). How it starts
The opening of the file, as written. The whole thing — 66 lines — stays where its author put it; the contents beside it link to each section on GitHub.
knitbrain
TypeScript project (Node ≥18, ESM, vitest). This repo IS the knitbrain product — if a knitbrain MCP server is connected while developing here, note it runs the globally installed build, not your working tree; rebuild + reinstall (npm run build && npm install -g .) and reconnect to test local changes.
Session start
First action: call knitbrain_load_session — returns last handoff, top learnings, false positives. If it reports unfinished work, resume that first.
Adherence gate: close-the-loop writes (knitbrain_record_learning, knitbrain_skill_save, knitbrain_save_handoff) are blocked until knitbrain_classify_task/knitbrain_run ran this session (KNITBRAIN_STRICTNESS, default block).
Tool surface highlights (37 tools)
knitbrain_verify_claim— settle a codebase claim before LEARN. Caveat: the session MCP roots at the launch cwd — settle knit-brain facts by source + tests + built dist when the root is elsewhere.knitbrain_self_check— keystone: audits all four invariants (anti-sycophancy, anti-stale, anti-drift, adherence) in one PASS/FAIL pass.knitbrain_run_loop— one judge→iterate cycle per call; yourverify_cmdis the hard gate.knitbrain_search_code— retrieval layer: query → ranked function-level chunks + graph-related files, score-gated. Search BEFORE reading; knitbrain_read only the hits.knitbrain_read/knitbrain_optimize/knitbrain_retrieve— compression loop; exact original always one retrieve away. Data-tool JSON responses are never skeletonized (machine contract).- Note: big tool responses may come back skeletonized with a trailing
⟨recall:hash⟩— strip it before JSON-parsing a tool result.
Project Map
Entry points: dist/lib.js, dist/index.js, dist/proxy/index.js, dist/hooks/index.js, src/index.ts
High-fanout (change carefully): src/ccr/store.ts, src/tokenizer.ts, src/engine/feedback.ts, src/engine/memory.ts, src/engine/knowledge.ts — check knitbrain_query_dependents before touching.
Largest: src/mcp/tools.ts, scripts/production-audit.mjs, src/learn.ts
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.
- 2mo ago First seen · 66 lines · 892 tokens per session scan C 4d9447244c54
knitbrain CLAUDE.md is an instructions file published in the GitHub repository PDgit12/knitbrain (6 stars, last pushed 6d ago), licensed MIT. It adds 892 tokens to every session, about $0.0036 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
knitbrain CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| knitbrain CLAUDE.mdPDgit12/knitbrain | Instructions file | 6 | 6d ago | MIT | C | 892 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |