Someone pastes a few lines of .env into their AI coding tool to debug a 401. The fix works, they run git add ., and the whole conversation is now in the repository, key included. Nobody decided to publish the chat. The file was just sitting in the project folder.

Files AI tools write into your project

From each tool's own docs:

  • Aider: .aider.chat.history.md (full transcript) and .aider.input.history by default, plus .aider.conf.yml, which can hold API keys. Aider adds .aider* to .gitignore by default, if that change was committed.
  • SpecStory: saves every conversation to .specstory/history/ as Markdown.
  • Claude Code: .claude/settings.local.json is added to your global git excludes when Claude Code creates it, so it is ignored on your machine, not in the repo. CLAUDE.local.md is "personal project-specific preferences; add to .gitignore".
  • Continue: reads secrets from <workspace-root>/.continue/.env.
  • Jupyter AI: chats are .chat files in your workspace.

Three ways they leak

  1. Committed by git add ..
  2. Shipped: without a files field or .npmignore, npm uses .gitignore, and your global excludes are not part of it. Same trap with .dockerignore and MANIFEST.in.
  3. Remembered: deleting the file later leaves it in git history. Rotate the key.

Checked in VS Code

I built ChatLeak, a free VS Code extension that asks git what is tracked and ignored, reads your npm, Python and Docker packaging files, and searches transcripts for keys (always masked). Real output on a made-up repo:

CL001 error .aider.chat.history.md is committed (contains 1 secret-like string) CL003 error OpenAI project key sk-proj-**** (64 chars) on line 4 CL002 information .claude/settings.local.json is only ignored by your local git excludes CL005 warning .claude/settings.local.json ships in the npm package CL004 warning CLAUDE.local.md is committed (local-only personal instructions) CL006 information .aider.input.history is in past commits (added in 1 commit) 

Six rules, an activity bar panel, fixes that add the right .gitignore line or run git rm --cached, and an on-demand git history scan. No network, no telemetry; it never rewrites history for you.

code --install-extension jaytankdev.chatleak 

Source (MIT): github.com/jay-tank/chatleak

Full write-up (each tool's documented paths, the manual fix, all six rules, FAQ): Your AI chat history is in git