Setup · living guide

Claude Code setup: make it ask less and do more

Claude Code works out of the box, but the defaults are conservative — it checks with you before every move. The model is smart enough to earn a longer leash. This page is organised by what you want; every field name and flag was verified against a live install.

Quick reference

You wantWhereHow
Trusted commands, no promptspermissions.allowallowlist in settings.json
File edits without confirmationsacceptEdits modeShift+Tab in session
No prompts at all (isolated env)bypassPermissionsrisk boundary below
It remembers your rulesCLAUDE.mdglobal + project layers
Pin a modelmodel setting/model or settings
Pick up yesterday's sessionsession recoveryclaude -c
Call it from scriptsheadless modeclaude -p

First thing: make it ask less

"Stop asking and just do it" is the number-one configuration request. There are three tiers, in increasing order of trust — start at tier one; most people never need to go past tier two.

Tier 1 · Allowlist trusted commands#

How

List operations you trust under permissions.allow; anything matching runs without a prompt:

~/.claude/settings.json
{
  "permissions": {
    "allow": [
      "Bash(npm run *)",
      "Bash(git status)",
      "Bash(git diff *)",
      "Read(*)"
    ]
  }
}

The * in Bash(npm run *) is a prefix wildcard: npm run build and npm run test -- --watch both match. Only allow prefixes you know are harmless — allow git diff *, not all of git * (which would include git push --force).

Why start here
Precise, auditable, reversible. Every grant is a visible line in a file; delete the line and it is revoked.

Tier 2 · acceptEdits: auto-accept file changes#

How

Press Shift+Tab in a session to cycle permission modes and land on acceptEdits — file creation and edits stop prompting, while everything else (like Bash) still asks. To make it the default:

.claude/settings.json
{
  "permissions": { "defaultMode": "acceptEdits" }
}
Who it suits
Anyone whose code lives in git. A bad edit is one git diff away from visible and one command from reverted — version control is the safety net. The plan mode goes the other way: read-only analysis, plan first, touch nothing — useful when you want the approach before the changes.

Tier 3 · bypassPermissions: no prompts at all#

How
Launch with claude --dangerously-skip-permissions, or set "defaultMode": "bypassPermissions". Every permission check is skipped; any command runs immediately.
Risk boundary
The flag says dangerously, and it means it. Deleting files, changing the system, calling the network — all waved through alike. It is built for isolated environments: Docker containers, dedicated VMs, CI sandboxes — places you can rebuild if they break. Running it bare on the machine that holds your real data hands over the whole keyring. Teams can disable the mode entirely via disableBypassPermissionsMode in settings.

Make it remember your rules: CLAUDE.md

The other half of "ask less" is teach less — repeating your conventions every session is worse than any confirmation prompt. CLAUDE.md is read automatically at session start, in two layers:

LocationScopePut here
~/.claude/CLAUDE.mdAll your projectsLanguage preference, working style ("conclusion first, no preamble")
CLAUDE.md at repo rootThis repository (commit it — whole team benefits)Build/test commands, code conventions, no-go directories

The one rule that matters most: keep it a terse rule list, not an essay. It occupies context every session; length is noise. Three kinds of content pay off: fixed conventions ("comments in English"), common commands ("tests run with npm test, never yarn"), and no-go zones ("migrations/ is read-only").

Pin a model

MethodHowBest for
In-session/model, pick from the listSwitching as you go
Lasting default"model": "..." in settings.jsonLong-term preference
EnvironmentANTHROPIC_MODEL (beats settings)Scripts / CI overrides
One sessionclaude --model <name>One-off runs

Model ids are easy to mistype — pick from the /model list or copy the exact id from the models page.

Sessions: resume, compact, clear

CommandWhat it does
claude -cContinue the most recent session (use it — stop starting from zero)
claude --resume / /resumePick a past session from a list
/compactCondense a long session's history to free context (also triggers automatically near the limit)
/clearWipe clean and start fresh — better than dragging an old session into a new task
EscInterrupt the current response — no need to wait out a wrong turn

Calling it from scripts: headless mode

terminal
# run one prompt, print, exit
claude -p "summarise the TODOs in this directory"

# structured output for downstream tools
claude -p "..." --output-format json

--output-format takes text / json / stream-json (only with -p). CI, cron jobs and batch pipelines all go through this.

Three settings.json files — which wins?

Three layers, highest to lowest. Permission rules merge across layers; single-value fields (like model) resolve to the highest layer:

PriorityFileRole
High.claude/settings.local.jsonPersonal, this machine (not committed)
Mid.claude/settings.jsonTeam-shared, committed
Low~/.claude/settings.jsonYour global defaults

Rule of thumb: personal preferences user-level, team conventions project-level, machine-specific exceptions local.

Advanced, one line each

  • MCP servers: claude mcp add -s user|project|local ... connects external tools (databases, browsers, internal systems); -s chooses which config layer stores it.
  • Hooks: the "hooks" block in settings.json runs automation around tool calls (e.g. lint on PostToolUse) — "auto-format after every edit" lives here.
  • Status line: the statusLine setting customises what the bottom status bar shows.
Verification note: every field and flag on this page was checked on 2026-08-28 against a live install's claude --help and the official docs. Configuration evolves with versions — where your install differs, trust its --help output. This page is kept up to date.

Related