Recipe · Build apps (vibe coding)
Check Claude Code's local settings file for secrets
Find whether a "Yes, and don't ask again" approval saved a command that holds a secret in .claude/settings.local.json, rotate any key first, then untrack the file and stop it being committed.
Steps
- Open the project folder and, if `.claude/settings.local.json` exists, list the standing approvals with `jq -r '.permissions.allow[]?' .claude/settings.local.json`. If the file is missing, there is nothing to check in this step. Look for a password, token or key in any command string — for example a fake value like `sk-EXAMPLE-NOT-REAL` or `PGPASSWORD=EXAMPLE-NOT-REAL`. Never paste a real secret into a chat or a ticket.
- If any approval looks like it holds a secret, rotate that key first, in the service's own dashboard, before you delete or edit the file. See the token-rotation recipe. Removing the file does not revoke a leaked key, and older git history can still hold it.
- After the new key works and the old one is revoked, untrack the file if git already has it: `git rm --cached .claude/settings.local.json`. Do not use `git rm` without `--cached` unless you also want the local file removed.
- Add `.claude/settings.local.json` to the repository's own `.gitignore` and commit that change. Anthropic's settings docs (checked 2026-11-13) say Claude Code adds this file to your global git excludes the first time it writes it, so it stays out of your commits; if you create the file by hand, add it to `.gitignore` yourself. The global exclude is per machine and does not travel with the repo, so the project-level ignore is what protects clones.
- Do not type a token or password into a command you approve. Anthropic's permissions docs (checked 2026-11-13) say that choosing "Yes, and don't ask again" when the approval saves permanently stores the rule in `.claude/settings.local.json` at the root of the git repository, including the exact command string. Prefer environment variables or a secret manager, then approve a command that reads them.
- Add a pre-commit secret scan (for example a local hook, or your git host's secret scanning) so a settings file or a command string that contains a key is caught before it is pushed.
Prompt
Replace anything in { } with your details.
I use Claude Code. Using only Anthropic's settings and permissions docs (https://code.claude.com/docs/en/settings and https://code.claude.com/docs/en/permissions), help me check `.claude/settings.local.json` for standing approvals, tell me how to untrack it and add it to the repo `.gitignore`, and remind me to rotate any key first. Do not ask me to paste a secret. If you need an example, use a fake like sk-EXAMPLE-NOT-REAL. Expected output
A cleaned allow list, any leaked keys rotated, the file untracked and listed in the repo .gitignore, and a pre-commit scan in place.
Gotchas
- ⚠ We quote Anthropic's settings and permissions docs for the "Yes, and don't ask again" behaviour (checked 2026-11-13). Apiiro reports that 1,122 of 104,185 public GitHub copies of this file held a real secret (research write-up dated 5 Nov 2026, page checked 2026-11-13). We have not re-counted their figures or tested whether those secrets still work.
- ⚠ Examples in this recipe use obvious fakes such as `sk-EXAMPLE-NOT-REAL`. Never commit, paste or screenshot a real key.
- ⚠ Rotate first. Deleting the file, or running `git rm --cached`, does not undo a leak in git history or in forks.
Where Claude Code breaks
- The limit, from Claude Code’s page: Claude Code draws from the same pool as Claude chat: Pro ($20/mo) and Max ($100/mo, 5x Pro) each have a 5-hour session cap plus a weekly cap, while Ultra ($200/mo, 10x Pro… (support.claude.com, checked )
- Known problem with Claude Code: Fake extension copies on Cursor's marketplace (29 Oct) (, cursor.com)
- Watch out with Claude Code: Claude Code is not on the free Claude plan; it uses your Pro or Max usage limits, and a batch of photos burns through them faster than text. Do 30 to 50 receipts at a time. From a recipe
- Real example with Claude Code: Burned a 5-hour Claude Max quota in 30 minutes via subagent file reads vs Spotify's 90% token-reduction harness. The catch: Self-reported developer post on X (24 Oct 2026) and architectural summary of Spotify's engineering setup; token savings depend on codebase size and subagent… (source dated )
How to rotate and check the tokens your AI agents use MCP config safety check: auto-approve, unpinned packages and the ~/.mcp-auth re-login loop
Sources (3): public reports, not re-tested by us
Claude Code settings (checked 2026-11-13): settings.local.json and global git excludes Claude Code permissions (checked 2026-11-13): Yes, and don't ask again saves the rule to settings.local.json Apiiro research (dated 5 Nov 2026, page checked 2026-11-13): 1,122 of 104,185 public copies held a secret