Claude Code 2.1.323 stops "don't ask again" from saving secrets. We read the check: what it catches, and what stays on disk
Claude Code no longer writes a password into .claude/settings.local.json when you pick "Yes, and don't ask again". Version 2.1.323, released on November 12, changed the button: if the command you approve "looks like it holds a secret", or if git tracks the file it would be saved to, the approval now lasts for the current session only and nothing is written. It shipped less than a week after Apiiro researchers Shmulik Cohen and Matan Giladi counted 1,122 public copies of that file holding real credentials, which we covered on November 8.
The fix arrived as one line in the Claude Code changelog, with no announcement, and the posts on X still repeating Apiiro's numbers this weekend don't mention it.
Changed "don't ask again" so an allow rule that looks like it holds a secret, or would be saved to a
settings.local.jsonthat git tracks, lasts for the session only and isn't saved
"Looks like it holds a secret" is doing a lot of work in that sentence, so we pulled the Linux x64 builds of 2.1.322 and 2.1.323 from npm and read the check out of the bundled JavaScript. None of it is in 2.1.322.
What the check looks for
When a new allow rule is about to be written to any settings file, Claude Code joins the tool name and the rule text and runs two tests on it.
The first reuses the secret scanner Claude Code already had for redaction. Our November 8 piece noted that the code to recognize a credential existed and "just isn't applied to the rule it saves"; now it is. This test looks for known key and token formats and for a user:password pair inside a URL.
The second is a new list of eleven regular expressions aimed at the way people actually type passwords into commands. They cover:
NAME=valueassignments whose name containspassword,passwd,passphrase,_pass,secret,token,api_key,access_keyorprivate_key(soPGPASSWORD=matches;MAX_TOKENS=andNEXT_TOKEN=are deliberately excluded);- the same names as PowerShell
$env:assignments, as JSON keys, and as--flagsfollowed by a value; Authorization:headers,api-key:andtoken:headers;sshpass -p,mysql/mysqldump/mysqladmin/mariadb -p...,redis-cli -a,docker login -p, andcurl -u user:password.
A value written as a variable ($PGPASS, ${DB_PASS}, %VAR%) doesn't count, which is the right call: a rule that stores the name of a secret is exactly what you want saved. If the scan itself throws an error, the rule is treated the same way and kept for the session only.
That list lines up closely with Apiiro's findings. The largest group in its data was 379 database passwords, and most of the 215 secrets that both gitleaks and TruffleHog missed were passwords typed inline after PGPASSWORD=, sshpass -p or mysql -p. Those are the cases a key-format scanner can't see and this list was written for.
We ran the regex list (not the token scanner) against a few sample rules:
| Approved command | Kept for session only? |
|---|---|
PGPASSWORD=hunter2 psql -h db.example.com |
yes |
PGPASSWORD=$PGPASS psql -h db.example.com |
no, it's a variable |
mysql -u root -pS3cretPw shop |
yes |
sshpass -p 'Winter2026!' ssh deploy@203.0.113.7 |
yes |
curl -u admin:hunter2 https://api.example.com |
yes |
docker login -u me -p dckr_pat_xyz registry.example.com |
yes |
API_KEY=sk-live-123 npm run deploy |
yes |
MAX_TOKENS=4096 python run.py |
no |
./deploy.sh --pw hunter2 |
no |
psql postgres://app:hunter2@db.example.com/prod |
not by the list; the URL check in the token scanner targets this case, but we didn't run it in isolation |
The gaps are the expected ones for a pattern list. A password passed as a bare argument, or behind a flag the list doesn't name, still gets saved unless it happens to look like a known key format.
When the check fires, the prompt says so: "Allowed for this session only. The rule looks like it contains a secret, so it isn't saved to settings." The other two messages read "The rule couldn't be checked for secrets" and "Git tracks .claude/settings.local.json, so the rule isn't saved there."
The git half
The second condition answers a different complaint. Boris Cherny of the Claude Code team said on Hacker News that the file "is meant to stay local" and that Claude Code gitignores it when it creates it. Apiiro's data suggested many copies got committed anyway. In 2.1.323, before writing to the local settings file, Claude Code asks git directly (git ls-files --error-unmatch on .claude/settings.local.json) and won't add a standing rule to a file git already tracks.
The same release fixed two related gaps. The global git-exclude entry that keeps the file out of commits is now added "when the folder became a git repository later, or on a new machine", which covers the case we flagged where the protection existed only on the computer where Claude Code first wrote the file. And a committed settings.local.json is no longer "treated as the user's own" when Claude Code starts in certain subfolders of a repository.
What it doesn't do
The change only stops new secrets from being saved. Rules already in your file are untouched: the check skips a rule that is already present in the destination file, and nothing in 2.1.323 scans or cleans existing settings. Anyone affected by Apiiro's findings still has to rotate the credentials and edit the file by hand. Our earlier checklist still applies.
The permissions documentation still says that "Yes, and don't ask again" saves Bash approvals permanently, with no mention of the new exception, as of November 15.
The bigger store remains open. Issue #95680, filed on September 20, asks Anthropic to redact secrets before session transcripts are written to disk and to add a way to find and scrub them. The reporter found one leaked GitHub token in five kinds of files, four of them Claude Code's own: session .jsonl transcripts, subagent transcripts, prompt history in ~/.claude/history.jsonl and an auto-mode classifier error log. The issue has six comments, several from authors of third-party scrubbing tools, and none from Anthropic. A settings file holds the commands you chose to approve. A transcript holds every command and every output, including the .env file Claude read.
So the cheapest fix, the one at the button, has shipped, and it's better than a generic scanner would have been for this file. The rest is still the user's job.
- Claude Code changelog (2.1.323, November 12, 2026)
- npm: @anthropic-ai/claude-code-linux-x64 2.1.323 (binary inspected, compared with 2.1.322)
- anthropics/claude-code #95680: Secrets that enter through the model's own tool calls fan out to every on-disk store, unredacted
- Claude Code docs: Configure permissions
Comments
No comments yet. Be the first.