Claude Code gives you memory,
hooks and skills.
Clankbrain wires them up.
Claude Code already has CLAUDE.md, auto memory, hooks and skills, but it ships the mechanism, not the finished setup. Clankbrain adds hooks that are already wired, organized memory files for lessons, decisions and rejected approaches, a Start/End Session routine, and 19 core workflows installed by default (36 in the repo). Built from 335 sessions on one production project.
Two commands: Start Session → work → End Session. That’s the daily routine.
yf@clankbrain ~ $
Two commands. Everything compounds.
Click through an illustrative session. GitHub sync is optional; memory stays local unless you configure it.
Five minutes to a living environment
You need Claude Code, Python 3.7 or newer, and Node.js for the npx installer. Run from your project root. Codex can use the shared memory through AGENTS.md; Clankbrain’s automatic hooks remain specific to Claude Code.
Scan your conventions. Map your endpoints. Seed your regret log.
Then ship faster than you thought possible.
scan-conventions reads your real code, writes coding-conventions.mdmap-codebase maps all endpoints + methods + tablesNo Node.js? Other install options ▸
Don't build the wrong thing.
Validate first.
/product-risk runs the Four Big Risks — Value, Usability, Feasibility, Viability — before you write a line of code.
Not a config file.
A living environment.
Most setups drop a CLAUDE.md and call it done. clankbrain ships an environment that learns your codebase, improves its own workflows, and remembers what went wrong — permanently.
The compound
learning loop
Hooks handle session bookkeeping. End Session runs /learn to extract lessons and score skills. Run /evolve every few sessions to revise weak steps using that feedback.
→ skill_scores.md
→ memory/
proposes new ones
smarter
## Auto-Chain to any skill.Claude continues without waiting.
On fail: debug-resin → retry
On pass: smoke-test → done
PostToolUse hook: drift check after every edit
PreCompact hook: saves in-flight work
PostCompact hook: re-injects memory after compact
StopFailure hook: captures state on API crash
19 core skills installed by default.
Generate Skills builds the rest.
Skills live in .claude/skills/ as markdown files.
Chain them with ## Auto-Chain.
Run Generate Skills — Claude scans your stack and creates skills tailored to your project.
| skill file | trigger phrase | what it does |
|---|---|---|
| /learn | /learn, extract patterns | Extract lessons from this session, score skills Y/N, update decisions.md and lessons.md |
| plan | plan [feature], I want to build X, design X | Structured planning — options with build cost/friction/payoff ratings, decision logged live, full plan auto-displayed after every update |
| /evolve | /evolve, evolve lessons into skills | Read skill_scores.md, patch weak steps, propose new skills from detected patterns |
| verification-loop | verify, run verification loop, did that work | After a code change — confirm it compiled, smoke test, self-check quality |
| search-first | search first, check if this exists | Enforce research-before-coding: search codebase before implementing anything new |
| strategic-compact | should I compact, context getting long | Evaluate whether to compact and guide through safe compaction that preserves all memory |
| fix-bug | fix the bug, it's broken, not working | Structured root-cause flow: locate → read → diagnose → show fix → wait for confirmation → update memory. Auto-chains to guard after the fix. |
| mode | mode develop, mode review, mode safe, mode deploy | Restrict Claude's tool access to what a task actually needs — develop (full), review (read-only), safe (no writes), deploy (shell only) |
| debug-session | debug session, structured debug, debug this error | 7-step structured debugging: reproduce → isolate → hypothesize → fix → verify — then logs cause + fix to error-lookup.md so future sessions can consult the known fix. Auto-chains to verification-loop after the fix. |
| guard | guard check, scan for issues, did I miss anything | Scans recently changed files against a library of known error patterns, flags violations before they ship. After any bug fix, extracts the root cause as a new permanent rule. |
| product-risk | /product-risk, validate this idea, is this worth building | Four Big Risks (Value, Usability, Feasibility, Viability). Evaluate mode scores existing products Red/Yellow/Green. Create mode validates an idea, then generates working HTML/CSS/JS prototypes + full project scaffolding. Kill gate: refuses to build if 2+ risks are red. |
| scan-conventions | scan conventions, generate conventions, bootstrap conventions | Reads 3–5 real methods from your codebase, extracts actual conventions (variable style, SQL patterns, error handling, naming, INSERT strategy), writes coding-conventions.md in ~10 min. Works on any stack. Run once on project start. |
| map-codebase | map codebase, generate code map, map my project | Scans all endpoints, public methods, DB tables, HTML pages and JS functions. Writes code-map.md + java_function_index.md + js_function_index.md. Run once — never grep blindly for a method again. |
335 sessions.
One living environment.
Built and validated on a production project — Java backend, vanilla JS, SQL Server. These are author-reported figures from the environment this kit grew out of, rather than a controlled comparison. The 37 skills include project-specific workflows; the public kit contains 36.
────────────────────────────────────────
sessions logged 335
skills in active use 37
sessions, zero data lost335
memory files tracked 40+
decisions preserved 75
rejected approaches logged38
dependencies zero
context recovery saved notes persist
setup time ~5 minutes
────────────────────────────────────────
// author’s production-project experience,
// not a controlled benchmark or a recovery guarantee
// persistent memory + a skill feedback loop, in plain text files
Works on any machine — when you want it to
Memory files are stored locally by default. Optional sync sends them to a repository you choose. The kit also sends anonymous usage telemetry; set CLANKBRAIN_NO_TELEMETRY=1 to disable it. Your coding agent’s own data handling still applies. When you're ready to work across machines, three commands get you there.
.claude/memory/ and pushes to your private repo. That's it.Start Session — fully up to speed.
Fewer manual merges for append-only notes. Add *.md merge=union to .gitattributes once. The union driver keeps additions from both sides, but may leave duplicate or contradictory entries. Review merged memory, especially decisions and current status.
One person debugs it. The team keeps the fix.
One private git repo. Six shared files. When a teammate logs a bug fix in error-lookup.md, every developer on the project gets it at their next Team Pull.
This system is only as good as you are
Clankbrain is a system, not a plugin. It compounds with use — but only if you use it.
Session journal captures what happened
Stop hook reminds you when memory is unsaved
PreCompact hook protects memory through resets
End Session — skipping it means lessons don't get extractedRunning
/learn — skill scores only exist if you log themRunning
/evolve every few sessions — skills don't self-patch without itKeeping memory honest — garbage in, garbage out
Start Session / End Session consistently and /evolve every few weeks can build a useful record of project-specific decisions, fixes, and workflow improvements. The benefit depends on the quality of those notes and how consistently they are used.The habit is the product. The kit is what makes the habit stick.
FAQ
Can I use Clankbrain with Codex?
AGENTS.md, so Codex can read the shared project memory. Ask it to read and update those files at session boundaries. Clankbrain’s Claude Code hooks and skill installation do not automatically run in Codex; shared memory support does not mean full automation parity.Does this use official Claude Code features or unofficial workarounds?
Official mechanisms used:
·
CLAUDE.md with @rules/ imports — Anthropic's documented persistent context system·
.claude/rules/ directory — now a first-class Anthropic feature with path-scoping support·
.claude/skills/<name>/SKILL.md — exact official skills path·
~/.claude/CLAUDE.md for global lessons — Anthropic's documented cross-project use case·
settings.json hooks — hook events include SessionStart, UserPromptSubmit, PostToolUse, PreCompact and Stop; availability of additional events depends on your Claude Code versionThe learning loop (lessons.md, decisions.md, /learn, /evolve) is built on top of those official mechanisms — that layer is what the kit adds.
Does a big CLAUDE.md actually help?
clankbrain is built the opposite way:
CLAUDE.md stays lean — commands and project-specific gotchas only. Project knowledge lives in separate .claude/memory/ files that load selectively based on what's relevant to the current task. Keep the always-loaded instructions focused and retrieve details when needed.The template that ships with the kit enforces this. The project-specific section is designed to stay under 50 lines. When you do want universal behavioral guardrails, ship them as a dedicated rule file — like the included
karpathy-principles.md, which encodes Andrej Karpathy's 4 LLM coding principles (think before coding, simplicity first, surgical changes, goal-driven execution) as an always-load rule.
What Claude plan do I need?
What happens if Claude Code crashes mid-session?
STATUS.md confirms what was last saved. Run Check Drift to find anything that happened between the last memory update and the crash.
Do I need to use git for memory sync?
What's the difference between Full and Lite mode?
Lite: 3 typed memory files (notes, lessons, decisions), no drift detection, no hooks — memory updates only when you run End Session manually. Best for any project. Upgrade to Full any time with a single prompt.
Can I add skills for my own tech stack?
Create a skill called [name] that [description].
Skills are markdown files in .claude/skills/name/SKILL.md — easy to read, edit, and version-control.
What does /evolve actually do?
skill_scores.md (which /learn populates after every session with Y/N corrections),
finds steps that repeatedly needed fixing, and patches those steps. It also scans
lessons.md for recurring patterns and proposes new skills you don't have yet.
Run it every 3-5 sessions.
How do I move this to a new machine?
What is the Auto-Chain feature?
## Auto-Chain section to any skill file with On pass and On fail steps.
Claude reads it and continues to the next skill automatically — no human prompt needed.
Example: fix-bug → verification-loop → smoke-test runs as one chain.
Does updating the kit overwrite my memory or project notes?
CLAUDE.md.
Your memory files, STATUS.md, and everything below
## What This Project Is in CLAUDE.md are never touched.
The updater always shows a diff and asks "Apply update? [y/N]" before changing anything.
Is there a global lessons file that works across projects?
~/.claude/global-lessons.md (or C:\Users\you\.claude\global-lessons.md on Windows).
Any discovery you add here gets loaded at every session start across all your projects.
Use it for things like "always check for stale .class files before debugging Java".
What Python version do I need?
/recall) optionally uses sentence-transformers for meaning-based matching; without it, recall falls back to keyword grep.
Free at python.org/downloads.
Why markdown files instead of a database?
Does this work with Anthropic's native Auto Memory?
How is this different from other Claude memory repos?
Skills are scored after use,
/evolve rewrites the steps that keep failing when you run it, and
regret.md keeps approaches you have already rejected where Claude can check them before planning.In the first few sessions the difference is small. Over many sessions, each skill gets adjusted by your own feedback, if you keep running End Session and /evolve.