Claude Code's "Don't Ask Again" Left 1,379 Secrets on GitHub. Fix Your Agent Config Before Your Next Push
Apiiro scanned over 100,000 public repositories and found 1,122 .claude/settings.local.json files leaking live credentials. When you click "Yes, and don't ask again," the exact shell command—passwords included—gets saved in plain text and often committed by the agent itself.
OPC Community
OPC Community

Clicking "Yes, and don't ask again" doesn't just approve a tool—it writes the entire command string, inline passwords and all, straight into a plain-text JSON file inside your repo.
If you build solo with terminal agents, muscle memory is your biggest vulnerability. Between November 1 and November 3, researchers at Apiiro scanned public GitHub repositories and found 104,185 copies of .claude/settings.local.json. Roughly 1.1% of them—1,122 files—contained live credentials, totaling 1,379 distinct secrets in current branches and 2,539 when counting git history and agent chat logs.
Nobody hacked Anthropic to get those keys. Developers handed them over with a single keystroke, and in nearly half the cases, the agent wrote the commit that published them.
How an Approval Turns Into a Plain-Text Leak
By default, Claude Code pauses before executing shell commands. When it proposes a command and you select "Yes, and don't ask again", it records a standing allow rule inside .claude/settings.local.json in your project directory.
The catch is how that rule is formatted: the allow rule is the literal command string. If you asked the agent to test a database migration, curl an internal webhook, or deploy a worker, and the proposed command included a connection URI or bearer token, that exact credential gets written to disk:
``json { "permissions": { "allow": [ "Bash(psql postgresql://admin:SuperSecretProdPass99@db.example.com:5432/main -c 'SELECT * FROM users;')" ] } } ``
In theory, .claude/settings.local.json is meant to stay local. In practice, if a developer creates the file manually or initializes git after running the agent, the ignore rule isn't always present in the project's .gitignore. Worse, Apiiro traced 1,105 of the affected repositories and found that in 539 of them, a commit listing Claude as a co-author modified the file. When you tell an agent to git add . && git commit, it dutifully stages its own configuration directory.
And because traditional secret scanners focus on .env files or known API token prefixes inside source code, custom database passwords sitting inside a JSON permission array often slip right past pre-commit hooks.
Three Rules to Lock Down Your Terminal Agent
Fixing this in a one-person company doesn't require enterprise DLP software; it requires changing how your local environment handles state and credentials.
1. Enforce a Global Gitignore Immediately: Stop relying on per-repo .gitignore files to catch agent artifacts. Run this once on your machine so no repository can ever stage local agent configs or chat logs: ``bash git config --global core.excludesFile ~/.gitignore_global echo ".claude/settings.local.json" >> ~/.gitignore_global echo ".claude/logs/" >> ~/.gitignore_global ` 2. Never Pass Inline Secrets in Shell Prompts: If an agent needs to hit an authenticated endpoint or database, make it read from environment variables at runtime (psql "$DATABASE_URL"), not literal strings. If the command string only contains "$DATABASE_URL", the allow rule in settings.local.json records the variable name, not the secret. 3. Upgrade to Claude Code v2.1.325+ and Audit Your History: Anthropic's November 13 update tightened default permission flows for sandboxed Bash commands and scheduled /loop tasks. If you've ever committed .claude/ files in the past, deleting the file in a new commit isn't enough—211 forks in Apiiro's dataset carried secrets from parent repos. Rotate any key that ever touched that file, and scrub your history with git filter-repo`.
Bonus: Cutting Latency on 500k+ Token Sessions with Message Threads
While locking down your config, make sure you are taking advantage of Anthropic's November 2 beta release: Message Threads.
Previously, every turn in a long coding session re-uploaded and re-tokenized the entire conversation history, including massive tool outputs. With Message Threads enabled (now default on current Claude Code releases), the client sends the full context once and passes only the delta and previous response ID on subsequent turns. Each thread sits encrypted in memory and expires after five minutes of inactivity.
On heavy refactors carrying 500,000 to 1 million tokens of context, median time-to-first-token drops by 35%. Note the financial catch for indie hackers: Claude still attends to the full context on every turn, so your token bill does not drop—only the wall-clock wait time does. Keep compacting your context regularly, keep secrets out of your command approvals, and let the global ignore file guard your pushes.
Frequently Asked Questions
Why did Claude Code leak passwords into public GitHub repositories?
When a user selects "Yes, and don't ask again" on a command prompt, Claude Code writes the exact command string as an allow rule in .claude/settings.local.json. If the command contained an inline password or API key, it was saved in plain text and frequently committed to GitHub when the agent ran broad git add commands.
How can I check if my repositories are affected by the .claude/settings.local.json leak?
Search both your current working trees and your full git commit history across all repositories for .claude/settings.local.json and .claude/settings.json. If any credential ever appeared in those files, rotate the key immediately—simply deleting the file does not remove it from git history or public forks.
Does Anthropic's new Message Threads feature reduce API token costs for Claude Code?
No. While Message Threads reduce median time-to-first-token by about 35% on 500k–1M token requests by avoiding re-uploading and re-tokenizing the entire history on every turn, the model still processes the full conversation context, so token billing remains the same.
Explore OPC City Chapters
Join the OPC Community
Connect with solo founders worldwide. Get daily insights, curated opportunities, and peer support.
Join free