Agentuna Agentuna
Build an agent

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.

Not tested yet. Vote for it to be next ⏱ ~15 min Updated: 2026-11-13

Jump to the prompt

Steps

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.

Copy & paste
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 )

All notes for Claude Code

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

Real examples All real examples

What people actually did with these tools or for this problem, with the source.

Build apps (vibe coding) Not tested yet

Cap Cursor on-demand spend before it surprises you

Set a monthly limit on the paid usage Cursor bills after your included usage runs out, using Cursor's own settings, so an AI agent can't run up a bill you didn't plan for.

  • Cursor

8 min · Free to start · Copy-paste prompt

Build apps (vibe coding) Not tested yet

Slow Claude Code token burn: idle compaction, resume warnings and /rate-limit-options

Cut wasted weekly and 5-hour Claude Code usage by turning on Anthropic's idle compaction, heeding the Pro/Max resume warning, starting fresh sessions instead of reprocessing a huge idle thread, and stopping unattended sessions from burning the limit after you walk away.

  • Claude Code

15 min · From $20/mo · Agent template

Build apps (vibe coding) Not tested yet

Use the API credits your ChatGPT Pro or Business plan includes

Claim the monthly OpenAI API credits that eligible ChatGPT Pro and Business plans include, and use them to run an AI agent through the API before they expire.

  • ChatGPT
  • OpenAI Codex

10 min · Free to start · Copy-paste prompt