Claude Code keeps asking permission for the same command

It is not broken and it is not learning. Nothing has told it that command is allowed, so it asks every time — forever.

Last updated: 2026-09-20

Why it happens

Claude Code asks before it runs a shell command. When you approve one, that approval covers that run — it is not remembered for next time and it is not remembered tomorrow. If nothing in a settings file says npm test is allowed, you will be asked about npm test for the rest of your life.

So the prompts are not a sign that something is misconfigured. They are a sign that nothing is configured.

The fix: a permissions allowlist

Create .claude/settings.json at the root of your project:

{
  "permissions": {
    "allow": [
      "Bash(git status)",
      "Bash(git diff:*)",
      "Bash(git log:*)",
      "Bash(npm test:*)",
      "Bash(npm run lint:*)",
      "Bash(npm install)"
    ],
    "deny": [
      "Bash(rm -rf:*)",
      "Bash(git push --force:*)",
      "Read(./.env*)"
    ]
  }
}

Restart Claude Code. The prompts for those commands stop.

The three reasons it still does not work

SymptomCauseFix
Still prompts for npm test -- --watchBash(npm test) matches that exact string onlyUse Bash(npm test:*) — the :* covers arguments
Nothing changed at allEdited the wrong settings file, or the JSON has a trailing comma and silently fails to parseConfirm the path is .claude/settings.json in this project, then check it parses
Works for you, not your teammateThe rules are in settings.local.json, which is personal and usually gitignoredMove shared rules into settings.json and commit it

Do not allow everything

An allowlist is worth having because it lets you stop reading the prompts. That is only safe if the prompts you would want to read are still there. Allow the boring, repeated, read-only things. Leave deletes, force-pushes and anything that reads .env outside it.

A blanket allow-all turns a safety feature into decoration, and you will not notice until the day it matters.

Copy a working one

The free starter repo has a settings file with both lists already filled in, plus the CLAUDE.md that fixes the other week-one problem — see Claude Code forgets my project every session.

Free starter repo

What does it cost to have someone set this up?

Flat prices, written scope, stop at any rung. No call to book, no retainer.

RungWhat you getClock
Free — starter repoA real setup you copy yourselfnow
$29 — Setup LiteOne project: CLAUDE.md, allowlist, one skill, as a pull request you review24 hours
$99 — Setup Sprint3–5 skills, hooks, up to 3 MCP servers, plus a runbook48 hours
$79 — Surface AuditAlready set up and still fighting it: contradictions and an exact fix list48 hours
Setup Lite $29 Or start free

Clocks run from a complete intake, not from the Stripe receipt.