AI NewsProductivityReported
Two git ignore files can hold your private scratch files without ever reaching a shared repository
A blog post by Mihai Dinculescu, which reached 93 points on Hacker News on 2026-09-23, points at two git ignore locations that never travel with the repository, and shows a Claude Code setting that keeps ignored files findable.

Why it mattersA developer carrying agent plans and scratch notes in every repo can stop worrying that a personal filename ends up in a public .gitignore, and can hide those files from teammates without adding a rule everyone has to see.
Anyone who works with a coding agent has, over the past year, quietly accumulated stacks of plan files, scratch notes and half-drafted markdown inside every repository they touch. The default place to hide those from git status is .gitignore, which then commits the private filename into a shared repository. Mihai Dinculescu, who published the post on 2026-09-23 and reached 93 points on Hacker News the same week, points at two other git ignore locations that solve the problem without any coordination with teammates.
Where git actually reads ignore patterns
Dinculescu names three files, all using the same pattern syntax. .gitignore in any directory is the shared one that gets committed, and is the right place for build output and local environments like target/, __pycache__/ or .venv/.
.git/info/exclude is per-repository and per-clone. It sits inside .git, so it cannot be committed even by accident, and nobody else who clones the repository ever sees it. Dinculescu names it as the file for "your own scratch files that the project doesn't need to know about", which for many people now means agent plans.
The third file is a global excludes file, set by core.excludesFile and defaulting to ~/.config/git/ignore. It applies to every repository on the machine and never gets committed either. Dinculescu suggests editor and operating-system clutter belongs here: .idea/, .vscode/, Thumbs.db, .DS_Store. Every one of those, he notes, still shows up in the average project's .gitignore despite having nothing to do with the project.
The worktree catch
A linked git worktree has a .git file rather than a .git directory, so writing to .git/info/exclude from a linked worktree does not do what a reader expects. The exclude file lives with the main repository and covers every worktree, and the post shows the git rev-parse --git-common-dir command that resolves to the right file from any worktree.
The global file is on by default: git reads ~/.config/git/ignore automatically if it exists, with no configuration step. git status stops listing a newly-ignored file immediately, as long as the file was not already tracked. Ignore rules never apply to tracked files.
The Claude Code footnote
The running example in the post is agent plans, so Dinculescu closes with a note for Claude Code users: by default, Claude Code hides ignored files from the @ file picker, which means the moment plans move into .git/info/exclude they disappear from autocomplete. The setting to flip in settings.json is respectGitignore: false, or the equivalent switch under /config. Claude Code can still read the files either way; the setting only controls whether it offers them as the user types.
A tip that keeps a private habit private
The story here is small and easy to act on. A developer working with a coding agent every day probably has a running collection of plans, notes and scratch drafts that they never intended to commit and never intended for their team to see either. Two lines appended to .git/info/exclude and ~/.config/git/ignore clean up git status without asking anyone else's permission and without leaving a personal filename in a file that ships with the repository.
Source
- Two git ignore files nobody told me about, Mihai Dinculescu, 2026-09-23
- Discussion on Hacker News, 93 points as of 2026-09-24
This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.
Get AI News in your inbox
New developer tools, model and agent releases, and how teams are actually using them to release software. Short, and only when there is something worth reading.
