Skip to content
    ← All news

    You clicked 'don't ask again' with a password in the command. Is it on GitHub now?

    · Zero Agency

    Share

    You asked your coding agent to check a database. It proposed a command with the connection password in it. You were busy, so you picked "Yes, and don't ask again" and moved on.

    That one click may have written your password, in plain text, into a file inside your project. If that project is on GitHub, the file may be public.

    TL;DR

    • Security firm Apiiro found 104,185 public copies of Claude Code's .claude/settings.local.json. In 1,122 of them it found at least one secret, 1,379 secrets in total.
    • Apiiro did not test whether the secrets still work. One company it notified confirmed its key was live.
    • Deleting the file does not fix it. Old versions stay in git history and in forks. Rotate first, then clean up.
    • Other tools may behave differently. In the researchers' comparison of 16 coding agents, Claude Code was the only one confirmed to save the full approved command in a project file by default.

    How does a password end up in a settings file?

    Claude Code asks before it runs most shell commands. The official permissions docs say that when you choose "Yes, and don't ask again" and the approval is saved permanently, the rule goes to .claude/settings.local.json at the root of your git repository.

    That is a reasonable feature. The problem is what the rule contains. Sometimes the prompt offers a pattern, like npm test *. Sometimes it offers the exact command. When it is the exact command, anything typed into it is saved too, as The Hacker News reports from Apiiro's research.

    Think of PGPASSWORD=... psql, mysql -p... or sshpass -p .... Those are normal commands. They are also credentials.

    Why does a file that is supposed to be private end up public?

    Claude Code tries to keep the file out of git. The first time it writes the file in a repository, it adds it to your global git excludes, according to its settings documentation. Git on your computer then ignores it everywhere.

    That protection lives in one user's git config on one machine. It does not travel with the project. The researchers say Claude Code never adds the file to the project's own .gitignore. So a teammate on another machine, a container, a copied folder, or a file that was already committed all skip the protection.

    There is a second path. In 539 of the 1,105 repositories the researchers traced, a commit listing Claude as co-author had changed the file. They read that as a sign the agent often commits it itself. That is their inference, not a proven count of who pushed what.

    How big is the exposure, really?

    Be careful with the numbers, because the headlines mix two different counts.

    The narrow one: 1,122 of 104,185 files, about 1.1%, hold at least one secret. That is 1,379 secrets. A value only counted if it matched a known key format, or sat next to a public server address, and an AI reviewer agreed.

    The wide one: 2,539 secrets across 1,994 repositories. It adds git history, the shared .claude/settings.json and saved agent chat logs. Older versions of the local file alone hold 734 more secrets that no current copy shows.

    What the secrets are matters more than the total:

    • More than a third open a database directly, including 379 database passwords.
    • 43 are SSH logins for public servers.
    • 42 are tokens for GitHub, GitLab or npm.
    • 23 are AWS keys.
    • The files belong to 63 organizations, mostly software companies.

    Treat this as an exposure finding, not a confirmed breach. The researchers do not say whether anyone used these secrets. As of Monday, every file with a secret was still on its repository's default branch, and in half of those repositories it had been there for at least 217 days.

    Why didn't my secret scanner catch it?

    Because scanners look for key formats. A password after PGPASSWORD= looks like a normal word in a normal command.

    Apiiro ran gitleaks and TruffleHog over every copy without the verification step. Of the 1,122 files with a secret, gitleaks flagged 564 and TruffleHog 643. Neither flagged 215.

    That is about one file in five slipping past both tools. If your only defense is a default scanner config, you probably have a blind spot here.

    What should I do today?

    Do these in order. The order matters.

    1. Search your GitHub org for .claude/settings.local.json and .claude/settings.json. Check git history too, even where the files are gone.
    2. Rotate every password, token and key those files ever held. Do this before anything else. A deleted secret that was public for 217 days is a compromised secret. We wrote about the same rule in our npm worm cleanup post.
    3. Stop tracking the local file. Run git rm --cached .claude/settings.local.json and add it to the repository's own .gitignore.
    4. Open the file on your own computer, even if you never committed it, and delete every rule that contains a secret.
    5. Keep secrets out of commands. Use a variable such as $DB_URL from a secrets manager, so the saved rule holds the name and not the value.
    6. Approve patterns, not single commands. Bash(npm run:*) is safer to save than one long command with a token in it.

    For security teams, the researchers add one more: treat agent folders like .claude/, .cursor/, .gemini/ and .specstory/ as places where secrets live, the same way you treat .env files. Put them under pre-commit and CI secret scanning, and make sure the scanner can find passwords inside commands.

    Is this a Claude Code bug or a habit problem?

    Both, and I would not pick a side too fast.

    The habit is ours. A password should never be typed into a command line that an agent logs. But a tool that saves your exact command to a file in the repo has made the risky path the easy one.

    It also did not start this week. A bug report filed on August 11, 2025 described approved commands with API keys stored word for word. According to the same report, a bot closed it as "not planned" on January 3 after 60 days without activity. The researchers say the four related reports they cite were closed the same way and none got a reply from Anthropic. That is their account, and we have not seen a response from Anthropic.

    The wider lesson is the one we keep landing on: an agent's config folder is part of your attack surface. We covered a different version of it in how an AGENTS.md file can hijack a coding agent. Different file, same blind spot. Nobody reviews the folder the agent writes for you.

    FAQ

    Does this affect me if my repository is private? The public exposure does not. But the file is plain JSON on disk, and the researchers note it can also end up in an npm package, a Docker image, a zip archive or a synced folder. Clean it either way.

    Is Claude Code the only tool with this risk? Not necessarily. The researchers compared the documentation of 16 coding agents and say Claude Code is the only one confirmed to save the full approved command in a project file by default. Check your own tool's behavior rather than assuming.

    I deleted the file. Am I safe? No. Old versions stay in git history and in forks. In the research, 211 forks of 74 repositories carried the same secrets as the originals.

    Where can I read the full report? Apiiro published it on November 5, and LATENT's write-up separates what each headline number counts. The totals are Apiiro's own findings, not an independent replication.

    Share this post