---
title: Tip: check every repo for a committed .claude/settings.local.json, rotate what it held, then untrack and ignore it | ctxsec
url: https://ctxsec.com/items/tip-claude-code-settings-local-json-rotate-untrack-ignore
description: "A standing \"don't ask again\" approval in Claude Code is written to .claude/settings.local.json, and an inline password or token in that command goes with it. Deleting the file later does not remove it from git history or forks, so rotate first, then clean up, and approve command patterns rather than one-off commands that carry secrets."
status: "operational guidance (Claude Code settings docs; Apiiro research Nov 5)"
published: 2026-11-07
---

> A standing "don't ask again" approval in Claude Code is written to .claude/settings.local.json, and an inline password or token in that command goes with it. Deleting the file later does not remove it from git history or forks, so rotate first, then clean up, and approve command patterns rather than one-off commands that carry secrets.

[← Tips & Guides](/tips) · [markdown](/items/tip-claude-code-settings-local-json-rotate-untrack-ignore.md)

operational guidance (Claude Code settings docs; Apiiro research Nov 5)

2026-11-07

### Tip: check every repo for a committed .claude/settings.local.json, rotate what it held, then untrack and ignore it

- Find it: `git log --all --oneline -- .claude/settings.local.json` in each repo; org-wide, code-search for `path:.claude/settings.local.json`. Also review committed `.claude/settings.json` allow rules and any saved agent transcripts.
- Rotate every password, token and key that ever appeared there, then `git rm --cached .claude/settings.local.json` and add `.claude/settings.local.json` to the repo's own `.gitignore` (global excludes don't follow clones).
- Prefer pattern approvals such as `Bash(npm run test:*)`; pass secrets via environment variables or a secrets manager, never inline in a command you approve.
- Add a custom scanner rule for this path — Apiiro reports both gitleaks and TruffleHog missed ~19% of secret-bearing copies.

Sources: [Claude Code docs: settings files](https://code.claude.com/docs/en/settings) · [Apiiro: coding agents leaking secrets via "don't ask again" (Nov 5)](https://apiiro.com/blog/coding-agents-leaking-secrets-github-dont-ask-again)
