How to delete aider chat history, and what you lose
one Markdown file per project holds every session
aider does not keep a file per conversation. Every time it starts in a repository it appends to the same .aider.chat.history.md, so one file holds every session you have had in that project, each one opening with a heading like # aider chat started at 2026-07-17 09:00:00. Deleting one session means cutting its block out of that file; deleting the file deletes all of them.
Where the history is
<git root>/.aider.chat.history.md every session, as Markdown <git root>/.aider.input.history the prompts you typed
aider writes both at the root of the git repository it runs in, and in the launch directory when it runs outside one, so ~/.aider.chat.history.md exists only if you started aider from your home directory. --chat-history-file (or AIDER_CHAT_HISTORY_FILE) and --input-history-file (AIDER_INPUT_HISTORY_FILE) move them. A third log, of the raw messages sent to the model, is written only when you set --llm-history-file (AIDER_LLM_HISTORY_FILE).
When aider starts in a repository it offers to add .aider* to .gitignore, so the files are usually untracked. If one was committed before that, deleting it does not remove it from the repository's git history.
How to delete one session
Quit aider first: a running aider appends to the file. Then delete the session's block, from its # aider chat started at line down to the line before the next one, in an editor or with awk, using the heading of the session you want gone:
awk -v start='# aider chat started at 2026-07-17 09:00:00' '
$0 == start { skip = 1; next }
skip && /^# aider chat started at / { skip = 0 }
!skip
' .aider.chat.history.md > .aider.chat.history.md.tmp &&
mv .aider.chat.history.md.tmp .aider.chat.history.md
The sessions before and after it stay as they are. The prompts you typed in that session are still in .aider.input.history, each under a # <date> <time> line with its text on + lines; delete those entries too, or the file as a whole, if the prompts have to go.
deja delete refuses aider sessions: one file holds every session in the project, and deja does not edit it. After trimming the file, deja forget --session <id> drops deja's copy as well; deja last lists the ids.
How to delete all of it
In the project's root, with aider closed:
rm .aider.chat.history.md .aider.input.history
Add your .aider.llm.history, or whatever --llm-history-file names, if you set one. Do not run rm .aider*: .aider.conf.yml, .aider.model.settings.yml and .aider.model.metadata.json are your configuration, and .aider.tags.cache.v* is only the repository map's cache. Repeat in each project you have used aider in.
What you lose
The conversation as aider logged it: your prompts (the #### lines), the replies with the edit blocks the model wrote, and the > lines that record which files were added or edited and which commands ran. aider --restore-chat-history loads the file back into a new chat, so a trimmed session is gone from it, and a deleted file leaves nothing to restore. The commits aider made stay in git log; deleting the history does not touch them.
Keeping it searchable instead
deja indexes aider's history with every other agent's on the machine. Run deja index before you trim or delete: a session that leaves the file stays in deja's local index, so deja <query> still finds it and deja show <id> prints it.
curl -fsSL https://raw.githubusercontent.com/vshulcz/deja-vu/main/install.sh | sh deja index deja "aider session about the tenant query"
deja reads ~/.aider.chat.history.md, AIDER_CHAT_HISTORY_FILE, every project deja aider has started aider in (listed in ~/.config/deja/aider-projects), and each directory in DEJA_AIDER_ROOTS to two levels down; deja sources shows which histories it found. deja resume cannot reopen one aider session, since --restore-chat-history loads the whole file, and says so. Indexing and search stay local, credentials are stripped as the index is built, and deja forget --session <id> removes a session from the index for good.
Where every agent keeps its history · Memory for aider · The aider format
Found this useful? Star deja-vu on GitHub.