If you've used Claude Code for more than an hour, you've hit this: you ask it to do something, it starts, then stops to ask if it can run ls or cat or npm install. You say yes. It runs one command and stops again.
This is the default behavior. It's not a bug. But it makes autonomous work basically impossible.
There are two places to fix it, and you probably want both.
Fix 1: settings.json
In your project root (or ~/.claude/), add or update .claude/settings.json:
{
"defaultMode": "acceptEdits"
}
This tells Claude Code to accept file edits without asking. For shell commands, add:
{
"defaultMode": "acceptEdits",
"bash": {
"allowedCommands": ["*"]
}
}
The allowedCommands: ["*"] wildcard is the aggressive version — Claude runs any shell command without prompting. For projects where you want more control, list specific commands instead: ["npm", "git", "ls", "cat", "grep"].
Fix 2: CLAUDE.md
Settings handle the permission layer, but Claude also has an instruction-following layer. If your CLAUDE.md doesn't explicitly say to stop asking, Claude may still pause for confirmation on anything that looks consequential.
Add this near the top of your CLAUDE.md:
Do not ask for confirmation before running shell commands. Execute and report results.
One sentence. It changes how Claude interprets its own caution — it stops treating every command as a checkpoint and starts treating them as steps in a task.
Why both?
The settings.json controls what Claude can do without asking. The CLAUDE.md instruction controls what Claude does do without asking. A gap between those two is where unexpected pauses come from.
With both in place, Claude runs through multi-step tasks without stopping. If something fails, it reports the failure and keeps going — which is the behavior you actually want for anything longer than a single command.
One caveat
allowedCommands: ["*"] in a shared codebase means anyone running Claude Code in that project gets the same permissions. Fine for solo projects. Worth thinking about before committing to a team repo — you might want the allowed list to be explicit instead.
I've collected about 25 system prompt patterns like this — instructions that change Claude's default behavior in specific, predictable ways. They're in the Agent Prompt Playbook at builtbyzac.com if you want the full set. $29.
Top comments (0)