← Back to blog

Article not found

Claude Code Exposes Local Secrets and Operational Traces in Repositories

An Apiiro analysis warns that Claude Code can leave credentials and tokens in local files, Git history and operational transcripts later found in public repositories.

Claude Code Exposes Local Secrets and Operational Traces in Repositories

A report cited by InfoQ highlights a concrete security issue in assisted coding tools: Claude Code can store secrets in risky ways when a developer approves a command using the option that avoids future prompts. In that case, the permission is saved in a local configuration file, .claude/settings.local.json, which according to Apiiro can end up exposed in public repositories together with credentials, passwords and tokens embedded in the executed commands. The analysis cited by InfoQ mentions 1,122 secrets found in these local files and another 1,160 traced in Git history, in files shared intentionally and in agent chat transcripts archived in repositories.

The critical point is not only the single file, but the way this behavior combines with team workflows. Claude Code adds the file to the computer’s global Git ignore list, but this protection does not automatically follow the project: it does not cover, for example, folders that later become repositories, clones performed on other machines or files already included in a commit. According to the researchers, in some cases Claude Code itself would have committed the file. InfoQ also reports that 63 organizations were involved, with cloud keys, production passwords, access tokens and npm credentials exposed in clear text or embedded in commands.

For those who build custom software or evaluate the adoption of coding agents in companies, this news matters for two reasons. The first is operational: standard controls are not always enough. The article reports that generic secret-scanning tools did not identify all exposures, especially when credentials were hidden inside command lines or replicated in transcripts, memory files and handoff notes between agents. The second is architectural: a local file that collects permissions and command fragments also becomes a map of the resources reachable by the developer. If that path is predictable and recurring, malware or unauthorized access can exploit it more easily.

InfoQ also reports a subsequent finding by GitGuardian, which would have found more than 31,000 secrets in public .claude/settings.local.json files on GitHub, with thousands of credentials still valid at the time of detection, in addition to other exposures in Docker Hub images. The minimum countermeasures indicated are pragmatic: remove the file from Git tracking, add it to the repository’s .gitignore, rotate all credentials that have ever passed through it, clean up rules that include secrets and avoid writing passwords and tokens directly in commands, preferring environment variables or equivalent mechanisms. For an SME, the message is simple: if it adopts AI coding tools, it must treat them as part of the attack surface, not as merely more convenient editors.

Source: InfoQ, 22 November 2026