{
  "id": 19850014,
  "title": "Why settings.local.json Leaks Secrets on GitHub and How to Fix It",
  "url": "https://urgent.news/2026/11/13/why-settings-local-json-leaks-secrets-on-github-and-how-to-fix-it",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-13T19:12:38.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/seanjhkwon/why-settingslocaljson-leaks-secrets-on-github-and-how-to-fix-it-59c1"
  },
  "original_language": "en",
  "account": "The security scan of public GitHub repositories found 1,122 configuration files exposing active credentials. The issue stems from a common terminal coding agent convenience feature: the \"Yes, and don't ask again\" approval prompt. When you grant standing approval for a command containing credentials, the client saves the exact string in .claude/settings.local.json under its permissions allow list. If this file gets tracked, every key becomes part of your commit history. Here's the mechanism behind the leak and steps to prevent it.\n\nWhen Claude Code requests permission to execute a shell command and you select \"Yes, and don't ask again,\" it creates an entry in the local settings file. If the proposed command contains credentials, the command string is saved to disk. Git automatically adds .claude/settings.local.json to your workstation's global Git excludes file, but this doesn't travel with the repository. When you clone the repository onto a different machine without global excludes configured, Git treats it as an untracked file, leading to accidental commits.\n\nTo verify if your repository history contains the file, run `git log --all --full-history -- */.claude/settings.local.json`. If commit hashes appear, the file has been committed. To fix the issue, first enforce repository-level Git ignore by adding `.claude/settings.local.json` to your project's `.gitignore`. If the file was already tracked, unstage it using `git rm --cached .claude/settings.local.json` and commit the `.gitignore` update.\n\nSecond, use environment variables instead of literal commands. Instead of approving commands with inline secrets, substitute them with variables defined in your shell. Update your shared, committed team configuration in `.claude/settings.json` to restrict standing permissions to generalized command patterns and deny common credential patterns. Lastly, add a pre-commit secret hook in `.git/hooks/pre-commit` to prevent accidental staging of agent configuration files. Test the hook to ensure it blocks attempts to commit the file.",
  "summary": "A security scan across public GitHub repositories identified 1,122 configuration files exposing active credentials. The culprit was a common convenience feature in terminal coding agents: the \"Yes, and don't ask again\" approval prompt. When an agent proposes running a command containing credentials and you grant standing approval, the client records that exact string into…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}