.gitignore for Claude Code
3 ignore rules for Claude Code, ready to copy into your repository.
Anthropic's agentic coding tool for the terminal
The complete .gitignore for Claude Code
# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-09-17 18:11:13 UTC
# Technologies: Claude Code
### Claude Code ###
# Claude Code personal project settings
**/.claude/settings.local.json
# Claude Code personal project instructions
CLAUDE.local.md
# Git worktrees created by claude --worktree
.claude/worktrees/
What these Claude Code rules actually ignore
Every pattern below, and why it belongs in your .gitignore.
Personal project settings
| Pattern | What it ignores |
|---|---|
**/.claude/settings.local.json |
Claude Code personal project settings |
Personal project instructions
| Pattern | What it ignores |
|---|---|
CLAUDE.local.md |
Claude Code personal project instructions |
Worktrees created by claude --worktree
| Pattern | What it ignores |
|---|---|
.claude/worktrees/ |
Git worktrees created by claude --worktree |
How to use this .gitignore for Claude Code
- Copy the Claude Code rules above, or download the file directly.
- Create a file named .gitignore at the root of your Git repository and paste the rules into it.
- If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
- Commit the .gitignore so everyone on the team shares the same rules.