
Anthropic’s Claude Code is under scrutiny after security researchers found that its “Don’t Ask Again” convenience feature can leave sensitive data exposed in local files and, in some cases, public repositories. The issue centers on how the AI coding tool stores permanent command approvals, sometimes capturing secrets embedded in shell commands and spreading them across project files, git history, and chat transcripts.
How Claude Code’s approval feature can expose secrets
According to agentic security firm Apiiro, when a developer responds “Yes, and don’t ask again” to approve a shell command, Claude Code records that approval as a permanent permission rule in .claude/settings.local.json. That local configuration file can end up containing embedded credentials, passwords, and API tokens if those values were present in the command itself.
The problem is not limited to one repository state. If Claude Code creates the file inside a git repo, it adds the path to the developer’s global git ignore list, which covers a common case. But that protection does not follow the project itself, so it fails if a folder later becomes a repository, is cloned onto another machine, or already had the file committed.
What Apiiro found across repositories
Apiiro said it identified 1,122 secrets in claude/settings.local.json files and another 1,160 secrets in git history, shared settings.json files that were intentionally committed, and agent chat transcripts stored in repositories. The firm reported that 63 organizations were affected.
The exposed material included cloud API keys, production passwords, access tokens, and npm tokens. In some cases, Apiiro found that Claude Code itself committed the file, making the leakage even more likely to propagate beyond a developer’s local machine.
Why common scanners missed some of the leaks
Apiiro said generic secret scanners such as gitleaks and TruffleHog did not catch all of the exposed credentials, largely because the secrets were buried inside shell commands rather than appearing in familiar standalone key formats. That matters because many detection tools are tuned to look for obvious patterns, not secrets embedded in command text, logs, or transcripts.
The researchers described the underlying issue as broader than a single file path. Any system that records what an agent ran — including transcripts, memory files, and handoff notes — can preserve secrets in places a scanner may not expect to search.
A security problem built into the workflow
Apiiro also argued that the design choice creates a security gap by itself. As the firm put it, the file can become “a list of the systems the developer can reach and the passwords that open them, one file search away,” stored in the same location across projects and therefore easy for malware or an intruder to find.
That makes the issue relevant well beyond accidental public exposure. A local file meant to make workflows smoother can become a concentrated inventory of access, especially if developers habitually paste secrets into commands that are later saved for reuse.
GitGuardian’s separate findings add weight
Apiiro’s report was later reinforced by GitGuardian, which said it found 31,088 secrets in Claude Code’s .claude/settings.local.json on public GitHub. Of those, 5,343 were still valid at the time of detection. GitGuardian also found another 613 secrets in Docker Hub images.
The security company had previously warned that “Cursor, Claude Code, and GitHub Copilot leave credentials scattered across config files, logs, and shell history.” Together, the findings suggest the issue is not isolated to one product so much as a recurring risk in AI coding tools that save developer context automatically.
What developers can do now
Apiiro’s immediate recommendation is to remove the file from version control with git rm --cached .claude/settings.local.json and add it to the repository’s .gitignore. The company also recommends rotating any credentials that the file may have contained, since exposure may already have occurred.
For a safer cleanup, the researchers advise inspecting the file and deleting any rule that contains a secret. More broadly, they recommend avoiding secrets in command lines altogether and using environment variables instead.
Practical steps for teams using Claude Code
- Audit
.claude/settings.local.jsonand related AI tool files for embedded credentials. - Remove any tracked copies from git history where possible.
- Rotate API keys, passwords, tokens, and other credentials that may have been exposed.
- Update
.gitignoreso local AI config files stay out of the repository. - Prefer environment variables or other secret-management methods over inline command secrets.
Developer reaction points to a broader concern
The report also drew reactions from developers online. Reddit user T_Thriller_T remarked that “Somewhere, someone said AI companies are ignoring basic cyber security principles.” Another user, MattV0, said they had stopped adding AI files into projects entirely, including settings files, CLAUDE.md, and AGENTS.md, and had turned off Claude’s memory.
That response reflects a growing concern that AI-assisted coding tools can create new categories of operational risk, especially when they store context automatically in files developers may not treat as sensitive.
Source: Original report
Was this helpful?
Explore more: Application Audit & Review More Cybersecurity Tech News
Last Modified: November 22, 2026 at 10:32 pm
0 views

