{
  "id": 13572573,
  "title": "Claude Code permissions by example, auto-allow npm scripts, confirm git push, block force push",
  "url": "https://urgent.news/2026/10/10/claude-code-permissions-by-example-auto-allow-npm-scripts-confirm-git",
  "topic": "ai",
  "section": "AI",
  "published": "2026-10-10T23:16:31.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/aicoding-guide/claude-code-permissions-by-example-auto-allow-npm-scripts-confirm-git-push-block-force-push-4blb"
  },
  "original_language": "en",
  "account": "Claude Code lets you set permissions for scripts and Git commands using a settings.json file. Allow rules run commands without prompting, ask rules prompt before running, and deny rules block commands entirely.\n\nThe example configuration allows npm run scripts automatically, confirms Git pushes before allowing, and blocks force pushes.\n\nAuto-allowing npm scripts uses the Bash(npm run:*) prefix match, which triggers for any npm run command followed by a space. Install commands use Bash(npm install:*) and similar patterns for other package managers.\n\nGit push is confirmed with Bash(git push:*) in ask mode, giving a prompt before running. Force pushes are blocked by a deny rule matching Bash(git push --force:*) and other force push variations.\n\nPutting all these rules together in settings.json allows team members to run their own scripts and commits without interruption, while still reviewing pushes and preventing accidental force pushes.",
  "summary": "Originally published at https://aicoding-guide.com . When you let Claude Code drive, you usually want three lines drawn. Scripts you wrote yourself, such as npm run lint and npm run test , should run without a prompt. git push reaches the remote, so you want one last look right before it. git push --force should never run at all. All three fit in a single permissions block in settings.json ,…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 4,
    "also_reported_by": [
      {
        "outlet": "XDA Developers",
        "title": "I connected Claude Code to Mermaid, and it replaced every diagramming app I ever used",
        "url": "https://urgent.news/2026/10/07/i-connected-claude-code-to-mermaid-and-it-replaced-every-diagramming",
        "published": "2026-10-07T21:30:18.000Z"
      },
      {
        "outlet": "Dev.to",
        "title": "Claude Code read a file listed in .claudeignore 12 of 12 times; a Read deny rule blocked every read except grep -r",
        "url": "https://urgent.news/2026/10/08/claude-code-read-a-file-listed-in-claudeignore-12-of-12-times-a-read",
        "published": "2026-10-08T02:17:00.000Z"
      },
      {
        "outlet": "Hacker News Best",
        "title": "I think I found a planet nobody knew existed. I used Claude Code to find it",
        "url": "https://urgent.news/2026/10/08/i-think-i-found-a-planet-nobody-knew-existed-i-used-claude-code-to",
        "published": "2026-10-08T07:07:34.000Z"
      }
    ]
  },
  "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."
}