Adding memory to aider
it appends every message to one log and reads none of it back
aider appends every message to a markdown log — ~/.aider.chat.history.md, or whatever $AIDER_CHAT_HISTORY_FILE points at — and that is the whole of what it keeps. A new chat starts from nothing, and nothing in it knows about the Claude Code session in the same repo yesterday. This page is about adding that.
What aider already has
The log, and read-only files. There is no session to resume: --chat-history-file names a transcript aider appends to rather than a conversation it reopens, so there is no id to hand back. There is no MCP client either — there are open requests and an open PR adding one, which is the day this page gains a paragraph — and no catalogue a model picks a skill out of. What aider does have is the useful part: a file passed with --read is re-read from disk on every message, so a file deja keeps current is live context for the whole session.
Adding recall
deja install aider
Three things, all reversible with deja uninstall aider:
- An entry under
read:in~/.aider.conf.yml, pointing at~/.config/deja/aider-context.md. Whatever was already in that list stays, including the scalar and flow spellings of it, which install writes out as a block list and uninstall puts back as they were. - The context file itself, written during the install rather than on first use: aider refuses to start when a configured read file is missing, and the first session should not be the one that finds that out.
- The shared skill at
~/.agents/skills/deja-search/SKILL.md, which the other agents on this machine read.
Then start aider through deja, with the arguments you would have given it:
deja aider --model sonnet src/api.py
It refreshes the context file, says what it put there — deja: recalled 7 past sessions into aider's read-only context — and hands over to aider. The wrapper exists because nothing inside aider can do the refresh: /run stops on Add 0.0k tokens of command output to the chat? even when the output is empty, so wiring it to startup would cost a keystroke every session. Every aider on the machine reads that one file, so the digest is there only while the aider deja aider started runs, and its lead names the directory it was built for. Plain aider reads the placeholder, not another project's sessions.
On macOS and Linux the wrapper also hands aider a second read-only file of its own, a named pipe deja answers each time aider reads it. aider appends a message to its chat history a few milliseconds before it reads its files to build the request, so the answer carries a recall for that message, the way a per-prompt hook does in other agents. The wrapper also passes the read list on the command line: aider takes one read: list, the first it finds from the command line, AIDER_READ, the project's .aider.conf.yml or the home one, so a project with its own list used to hide deja's file.
What arrives
A digest of what this machine already knows about the project — the decisions, the commands that worked, the errors that came back — as one read-only file in every message of the session. When there is no history yet the file says so, rather than being absent and stopping aider from starting. What memory costs has the measured comparison.
The part that is not about aider
The index covers every agent's transcripts on the machine — forty-three of them, each in its own format — so a fix found in Claude Code answers a question asked in aider, including sessions from before any of this was installed. A transcript a client later deletes stays searchable; only deja forget drops one on purpose. Nothing here writes memories, so there is nothing to hallucinate into your history; indexing and search are local, and credentials are stripped as the index is built (privacy).
Getting started · Switching between agents · The aider session format
Found this useful? Star deja-vu on GitHub.