claude-mem
Captures what your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions so work carries over. Works with Claude Code and several other coding agents.
Stop fixing the same AI mistake twice. A Lean quality system for AI-assisted work, operators turn recurring defects into countermeasures. Built by a manufacturing operator, for people who actually ship.
Claude Code
> /plugin marketplace add PrimeFoldTools/andon> /plugin install andon@primefold-tools
Codex
$ npx skills add PrimeFoldTools/andon -a codex
Cursor
$ npx skills add PrimeFoldTools/andon -a cursor
Gemini CLI
$ npx skills add PrimeFoldTools/andon -a gemini-cli
GitHub Copilot
$ copilot plugin marketplace add PrimeFoldTools/andon$ copilot plugin install andon@primefold-tools
OpenCode
$ npx skills add PrimeFoldTools/andon -a opencode
Windsurf
$ npx skills add PrimeFoldTools/andon -a windsurf

Stop fixing the same AI mistake twice.
A Lean quality system for AI-assisted work — operators turn recurring defects into countermeasures. Built by a manufacturing operator, for people who actually ship.
Andon is the cord on a Toyota line you pull to stop production when something's wrong. This is that cord for AI work: catch the defect, investigate it, and add a countermeasure.
Not affiliated with Andon Labs (the AI-agent evaluation company). Same Lean word, different project — this is a solo, open-source operating kit.
If you work inside an AI agent every day, you know the failure modes:
Most "AI tips" make the output a little better. Recurring defects also need explicit checks and follow-through.
The fix isn't a better prompt. It's an operating discipline — borrowed from a factory floor. Use the same discipline in AI work: record a defect, investigate its cause, and add a countermeasure. Where practical, add a mechanical check and test both the failure and a legitimate passing case. Checks have limits; keep those visible.
The aim: retain what you learned and check whether the countermeasure works.
This is not a memory tool. Memory remembers the lesson. A countermeasure makes the mistake harder to repeat. (Why that matters →)
The smallest useful piece is a structured memory file — so you can come back to a project after three months and your agent knows exactly where you left off, instead of rebuilding context from scratch.
Clone this repo first (you'll copy a couple of files out of it):
git clone https://github.com/PrimeFoldTools/andon.git
In your project, make a memory folder and an index:
mkdir -p memory
cp /path/to/andon/templates/MEMORY.md.template memory/MEMORY.md # path to where you cloned andon
Add 2–3 lines to memory/MEMORY.md — the durable facts your agent keeps forgetting (the stack, the rule, the decision).
Point your agent at it (e.g. in your CLAUDE.md: "Read memory/MEMORY.md at the start of every session.").
That's Layer 1. The payoff shows up the next time your agent starts — it reads the file instead of re-asking, so there's nothing flashy to watch right now. Want an instant, visible win instead? Run the 30-second hook demo below. Full path in QUICKSTART.md.
Shortened output of the 30-second demo below. Run it to see the full message.
The claim-check hook detects some completion phrases and checks their verification entries. In block mode, a failed check returns a block decision.
The example below runs the hook in warn mode with no verification entry. Its response asks for evidence; it does not establish whether the agent performed the work. Promote to block only after checking its behavior on your work. See HOOK_INSTALL.md.
The agent writes its own verification entry. Token overlap can accept unrelated work or a fabricated entry; the known limits below describe these cases.
From inside the cloned repo — no install, no config:
rm -f /tmp/andon_claim_checks_none.jsonl
printf '{"type":"assistant","timestamp":"%s","message":{"content":"the migration is complete and the tests are fixed"}}\n' \
"$(python3 -c 'import datetime; print(datetime.datetime.now(datetime.timezone.utc).isoformat())')" > /tmp/t.jsonl
echo '{"transcript_path":"/tmp/t.jsonl"}' \
| CLAIM_CHECK_ENFORCE_MODE=warn CLAIM_CHECKS_LOG_PATH=/tmp/andon_claim_checks_none.jsonl python3 hooks/claim_check_hook.py
The response contains continue: true and a systemMessage asking for claim-specific verification. Run python3 -m pytest hooks/tests/ to check the hook suite.
Not ready to install a hook? Layer 1 above — a plain memory file, no code — is the on-ramp. Start there and climb when you feel the friction.
In Claude Code, run:
/plugin marketplace add PrimeFoldTools/andon
/plugin install andon@primefold-tools
What it installs:
memory/MEMORY.md in your project, if there is one), and the pipe-guard PreToolUse hook (off until you turn it on). The pipe guard stops a test command whose exit status would lie (pytest | tail without pipefail, npm test || true) before it runs, and tells the agent how to rerun it. It is off by default: replayed over the author's own sessions it would have refused about 1 in 24 Bash calls, each one a test run whose status would have been hidden. Turn it on with ANDON_PIPE_GUARD=on in the environment Claude Code starts from, or in the env block of settings.json./andon:wrap, /andon:orient, /andon:log-mistake.andon:researcher, andon:auditor, andon:memory-steward, andon:builder, andon:chief-of-staff.andon-log-claim: a command on the agent's Bash PATH that runs log_claim.py. Tell your agent in CLAUDE.md: after you verify a done-claim, run andon-log-claim "what I claim" "how I verified it".The plugin runs the same hook files as the manual install. To change the mode (block, off) or the evidence mode, use the manual install in HOOK_INSTALL.md and disable the plugin. Do not run both installs at once: the hook would fire twice. Templates, docs and scripts stay in the repo; copy them as QUICKSTART.md describes.
In a terminal, run:
codex plugin marketplace add PrimeFoldTools/andon
codex plugin add andon@primefold-tools
Then start codex, type /hooks, review the three Andon hooks and trust them. Codex does not run a plugin's hooks until you trust them, and it asks again if a hook changes.
What it installs:
hooks/hooks.json as the Claude Code plugin: the claim-check Stop hook in warn mode, the auto-orient UserPromptSubmit hook and the pipe-guard PreToolUse hook (untested on Codex; it does nothing unless the tool is named Bash).andon:orient and andon:wrap (Codex turns commands/orient.md and commands/wrap.md into skills by itself), and andon:log-mistake.agents/*.md briefs still work as text you paste.To log a verified claim, tell your agent in AGENTS.md to run python3 ~/.codex/plugins/cache/primefold-tools/andon/<version>/hooks/log_claim.py "what I claim" "how I verified it". Under Codex, log_claim.py stamps the session from CODEX_SESSION_ID, so the entry clears that session's claim. The log lives in ~/.claude/state/claim_checks/ by default; Codex's workspace-write sandbox may block writes outside your project. Set CLAIM_CHECKS_LOG_PATH to a file inside the project when you start codex, so the hook and the agent use the same file.
Limits under Codex (tested with codex-cli 0.153.4):
codex exec prints hook: Stop Completed, but it does not show the hook's warning text. The verdict is the same as in Claude Code: replaying the real Codex Stop input through the hook gives the warning without a log entry and a pass with one.CLAIM_CHECK_EVIDENCE=tool and both read Claude Code's transcript format only. Under Codex they always warn. Keep the default log evidence.andon-log-claim command is not known to be on the Codex agent's PATH. Use the full path above.| App | How | Hooks |
|---|---|---|
| Claude Code | plugin (above) | yes |
| Codex CLI | plugin (above) | yes, after you trust them in /hooks |
| Open models | run Claude Code or Codex against a local model | the same as that app |
| Cursor, Cline, Windsurf, Aider | copy the templates by hand | depends on the app; not tested |
The runnable proof is the 30-second demo above. The companion evidence is the record: DEFECT_LEDGER.md logs real defects one at a time — defect → root cause → countermeasure → result — where the countermeasure is a hook or test that makes the whole class hard to repeat, not a note that asks you to remember. Accumulated, not invented. Read a few entries; you'll recognize your own week.
Each entry also carries a verdict (is the defect proven?) and a control status with a review-by date. A control that nobody re-checks by its date fails the test suite. Retired controls stay on record. See the ledger's opening section.
Be honest: "give your agent memory + a mistakes log" is a crowded idea in 2026. Some tools even auto-capture your corrections into a rule file (e.g. claude-reflect). If you just want memory, use one of those — they're good.
andon is a different thing: a complete operating discipline, not a memory tool — informed by the Toyota Production System's practices for investigating defects and testing countermeasures.
If that frame resonates, the rest is the proof. If it doesn't, one of the lighter memory repos will serve you better — no hard feelings. (Full credit + a reading list of the tools and ideas andon stands on: stand-on-these-shoulders.md.)
Captures what your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions so work carries over. Works with Claude Code and several other coding agents.
Gives Claude Code long-term memory through Hindsight. It recalls relevant past context before answering, retains durable facts as the agent learns them, and reflects over stored memory.
Local-first memory for Claude Code. It stores conversations verbatim in a private palace you can search before answering about past work, people, projects, or decisions, with optional shared-brain hub setup.
Gives Claude Code a private memory that stays on your machine. It stores past conversations word for word, so you can ask what was decided, what happened before, or who was involved and get the original context back. It can also hand tasks to other agents.
Stop fixing the same AI mistake twice. A Lean quality system for AI-assisted work, operators turn recurring defects into countermeasures. Built by a manufacturing operator, for people who actually ship. Install it with the command on its page. It includes log-mistake. Its skills do not fire on their own yet. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it