Claude Code Permissions: ‘Don’t Ask Again’ Writes to a File. Check Whether Yours Is Public.
TL;DR: Your claude code permissions live in a file. Say “yes, and don’t ask again” and the approval is written to disk. Security firm Apiiro reports finding secrets in 1,122 public copies of that file on GitHub. Anthropic’s answer is fair — the file is meant to stay local — but there is a gap worth knowing: the protection goes into your global git excludes, not the repository’s `.gitignore`, so it does not travel with the project. Here is the one-line check.
What “don’t ask again” does to your claude code permissions
Every time Claude Code wants to run a command it has not run before, it asks. The third option is to approve it permanently. Your claude code permissions have to live somewhere, and where they live is `.claude/settings.local.json` in your project folder.
Anthropic’s own documentation describes the file plainly: it is for “You, in this one project only”, and “Claude Code keeps it out of git when it creates the file; if you create it by hand, add it to `.gitignore` yourself.”
The trouble is what gets saved. The claude code permissions rule records the command — and if the command you approved had a password, a connection string or an API key typed into it, that string is now sitting in a file in your project.
Scale, with a caveat. The research is from application-security firm Apiiro, published 5 November. Its page returns an error to us, so we have not read it — these figures come from trade coverage and are not ours to vouch for. As reported: 1,122 of roughly 104,185 public copies of the file, about 1.1%, were classified as containing secrets, rising to 2,539 secrets across 1,994 repositories once git history and agent transcripts were counted.
What Anthropic says about claude code permissions
Boris from the Claude Code team answered in the Hacker News thread, which reached 348 points. His points, verbatim:
- “Historically Claude Code has not done secret scrubbing (there are many good tools for that), but we are looking into what we can do to prevent this.”
- “`.claude/settings.local.json` is meant to stay local. This is not a file you should check into source control.” And: “We automatically gitignore it when Claude creates the file, so in this case the files were manually created and checked in.”
- “Permission rules are old hat. Everyone should be using auto mode instead. It is safer and also does not require manually maintaining finicky allow/deny lists. Auto mode is enabled by default and is included for free in all plans.”
- “Regardless of what agent you use, you should have secret scanning enabled. GitHub and other source control hosts offer it.”
And the line that is more candid than most vendors manage: “Ultimately, the threat model here is: human has to approve a lot of commands, so gets tired and accidentally approves a command they shouldn’t have.”
That is approval fatigue, named by the team that built the prompt. We wrote about exactly that failure before anyone had counted it.
Not everyone accepted it. One commenter pushed back that “auto mode cannot be considered safer than anything because it does not even attempt to guarantee any sort of security”; another said committing a `.claude` folder is “at least as dumb as committing `.keys`” — fair, and also a description of 1,122 files.
The claude code permissions gap nobody is pointing at
Here is the detail that makes this make sense, and it comes straight from Anthropic’s documentation rather than anyone’s blog post:
*”The first time Claude Code writes the file in a git repository that doesn’t already ignore it, it adds `/.claude/settings.local.json` to your global git excludes file**, so the file stays out of your commits in every repository.”*
Read where the protection goes. Your global git excludes. That is a file on your machine, in your home directory. It is not the repository’s `.gitignore`, and it is not committed, so it does not travel with the project.
So the safeguard protects you on this laptop. Not your colleague who clones the repo and creates the file by hand, not your other machine, not CI, not anyone who forks it. Anthropic’s docs say as much in the next line: “If you created the file by hand and Claude Code hasn’t written to it yet, add it to `.gitignore` yourself.”
That is how a file “Claude Code automatically gitignores” ends up public a thousand times over. Both statements are true at once.
Why claude code permissions matter if you don’t code
You meet this prompt dozens of times a day, and its design invites the mistake: it interrupts, it is identical every time, and the third option makes it stop. Clicking it is not carelessness — it is the only way to get work done.
What you may not realise is that clicking it writes your claude code permissions to a file. There is no visible record, no “saved” confirmation, nothing in the interface that says a copy of that command now exists on disk. If the command had a database password in it because you were pasting a connection string, the password is in the file.
Deleting the file later does not help if it has already been committed: git keeps history, and forks keep copies. The only real remedy is to change the credential — the same lesson as when API keys were taken from a hosted service. Our vibe coding glossary covers `git` and `gitignore` if they are fuzzy.
Three claude code permissions checks, five minutes
- See whether the file is tracked by git. In your project folder, run `git ls-files | grep settings.local.json`. Output means it is in your repository — and if that repository is public, it is public. No output means you are fine.
- If it is tracked, read it before deleting it. `cat .claude/settings.local.json`, and look for passwords, connection strings or keys inside the `allow` rules. If any are there, rotate those credentials first. Then untrack the file with `git rm –cached .claude/settings.local.json` and add it to the repository’s own `.gitignore`.
- Stop typing secrets into commands you approve. Use an environment variable — `$DATABASE_URL` rather than the real string — so the claude code permissions rule never contains the secret in the first place.
Two things worth doing anyway: turn on secret scanning in your GitHub repository settings, which is free and catches this class of mistake whatever tool you use; and consider Anthropic’s own advice to use auto mode rather than maintaining claude code permissions lists by hand.
Who should care (and who shouldn’t)
- Using Claude Code on a public repository: care today. Run the first claude code permissions check now; it takes ten seconds.
- Using Claude Code on a private repository: care, less urgently. Private today is not private forever, and the file still travels to anyone with access.
- Working in a team: care most. The global-excludes gap is precisely a team problem — your claude code permissions protection does not reach your colleagues.
- Using Cursor, Replit or Lovable instead: the specific file is Claude Code’s, but every agent stores approvals somewhere. Go and find out where.
- No idea yet: the 60-second Tool Finder quiz will point you at tools that match how much of this you want to manage.
Our take
On claude code permissions, Anthropic’s response is reasonable and quick, and “do not commit your local settings” is correct. But the framing that this was users doing something unusual sits awkwardly next to a thousand real files. When a safeguard lives only in a per-machine config, a fraction of users will fall outside it, and at this scale a fraction is a lot of people.
The more interesting admission is the one about approval fatigue. A team that says out loud “human has to approve a lot of commands, so gets tired” understands its own product’s weak point. The fix for that cannot be another prompt. This is the second Claude Code privacy story in three days — the account email in web requests was Wednesday — and both share a shape: not a breach, not an attack, just information ending up somewhere nobody pictured. Go and look at your own files occasionally. Nothing in the interface will prompt you to.
Not sure how much tooling you want to manage yourself? Take the 60-second Tool Finder quiz →
Some links on this page are affiliate links. If you buy through them we may earn a commission at no extra cost to you.
FAQ
How do I check whether my claude code permissions file is exposed?
Run `git ls-files | grep settings.local.json` in your project folder. Any output means the file is tracked by git and will be in your repository, public or not. If it is, read it before deleting it — you need to know which credentials to rotate.
Doesn’t Claude Code gitignore that file automatically?
Claude Code adds the claude code permissions pattern to your global git excludes file the first time it writes the file, per Anthropic’s documentation. That protects your machine, not the repository — it is not committed, so colleagues, other machines and forks are not covered. Files created by hand are not covered either.
Is deleting the file enough?
No. If it was ever committed, git history, forks and clones still hold it. Rotate every credential the file contained, then untrack it with `git rm –cached` and add it to the repository’s `.gitignore`.
