Why this block is short
Most "AI gitignore" lists you'll find are padded with directories that don't exist,
tools that keep their state in your home folder, and files their own vendors tell you to
commit. Ignoring a file that never appears costs nothing — but ignoring a file your team
needs (CLAUDE.md, shared settings, editor rules) quietly breaks the setup
for the next person who clones. So this list is deliberately conservative: it ignores
what is personal, local, or secret, and nothing else.
Line by line
Claude Code
Notice what's not ignored: the rest of .claude/. Shared settings,
slash commands, subagents, and skills are team assets — see
the keep-in-git table.
Aider
Secrets
Tools that need no entries
Padding a .gitignore with entries for these isn't harmful, just noise — and noise is
how real entries stop getting read.
Files you should not ignore
The most common mistake is the blanket .claude/ ignore. These files are
the point of the tooling — they configure the AI the same way for everyone who clones:
The cleaner alternative: your global ignore
Entries for your tools arguably don't belong in the team's
.gitignore at all. Git has a personal, machine-wide ignore file exactly for this:
git config --global core.excludesFile ~/.config/git/ignore
Put .aider* and CLAUDE.local.md there once, and every repo
you touch is covered — without a diff, a review, or a debate about whose editor droppings
get a line. Keep the repo's .gitignore for things that protect the whole team, like the
secrets block.
FAQ
Should CLAUDE.md be committed?
Yes, emphatically. It's documentation with a superpower — every teammate's Claude
session starts with the same context. Ignoring it is like ignoring the README. Personal
additions go in CLAUDE.local.md, which this block keeps out of git.
Doesn't Claude Code handle this itself?
Partially — current versions offer to keep .claude/settings.local.json
out of git for you. The explicit entry costs one line and doesn't depend on which
version created the file, or on every contributor's client behaving identically.
What about a monorepo with nested .claude/ folders?
Git applies root .gitignore patterns at every depth only when they're
written that way. Use **/.claude/settings.local.json and
**/CLAUDE.local.md to cover nested packages.
Where do Claude Code chat transcripts live? Do I need to ignore them?
No — session transcripts and history live under ~/.claude/ in your home
directory, never inside the repo. If you see conversation files in your project, some
other tool put them there.
Should I ignore AI-generated scratch files, plans, or TODO dumps?
That's a workflow choice, not a tool requirement — which is why they're not in the
block. If your agents write scratch files, give them a dedicated directory
(scratch/, .scratch/) and ignore that one path. Ignoring
broad patterns like *.md variants to catch AI litter always ends in tears.