Docs / How it works

Dead-end memory (mistakes)

Updated

TL;DR — Record a dead end with `tokenade mistake add "…"` or `git show <sha> | tokenade mistake from-revert`. The 3 newest are shown to your agent at session start. Records live in `~/.tokenade/mistakes.jsonl` for 30 days.

tokenade mistake keeps a short list of directions that did not work: an approach you abandoned, a change you reverted. At the start of each session, your agent is reminded of the most recent ones, so it does not spend another afternoon on an idea already ruled out.

Usage

tokenade mistake [list]
tokenade mistake add <summary…> [--ref <commit>]
git show … | tokenade mistake from-revert

Alias: mistakes.

SubcommandEffect
list (default)Print what has been recorded. --json prints the records as JSON
add <summary…>Record a dead end in your own words
--ref <commit>With add: tie the record to the commit it came from
from-revertRead git output on stdin and record a mistake only if it describes a revert

Record a dead end by hand

tokenade mistake add "tried a global mutable cache, caused races" --ref deadbee

Keep the summary short and specific. The agent sees at most 120 characters of it.

Record a revert

git show HEAD | tokenade mistake from-revert

from-revert looks for the first line containing Revert. With the standard Revert "<subject>" message it records reverted: <subject>. If the input is not a revert, nothing is recorded and it prints no revert detected, so it is safe to pipe any commit into it, for example from a git hook of your own.

Tokenade does not watch your repository: a revert is recorded only when you pipe it in.

List

$ tokenade mistake
tokenade mistake — 2 recorded
[manual] tried global mutable cache, caused races (deadbee)
[revert] reverted: add broken cache layer

[manual] comes from add, [revert] from from-revert.

What your agent sees

At session start, when at least one record exists, the SessionStart hook adds one line to the agent's context:

[tokenade:mistakes] N dead ends recorded on this machine (3 shown; …) — do not re-propose: "…"
  • Only the 3 newest records are shown, each summary cut at 120 characters.
  • Nothing is added when the list is empty, so an unused feature costs no tokens.
  • Agents with a session-start hook get it: Claude Code (CLI and desktop Code tab), Codex, Copilot CLI, Droid and Gemini-family agents. Grok ignores session-start output, so it does not see the reminder.

Storage

ItemValue
File~/.tokenade/mistakes.jsonl
Fieldsts, kind (revert or manual), summary, optional reference
Retention30 days, then rotated out
ScopePer machine, shared by all projects

The file is local and never uploaded. To remove a record, edit or delete the file; it is plain JSON Lines.