Work modes
| Mode | What happens | When to use |
|---|---|---|
| Default | the agent asks before edits and commands | getting started, unfamiliar project |
| Accept edits | file edits without asking, commands with permission | a clear task while you watch the changes |
| Plan | the agent only reads and plans, changes nothing | big tasks, exploration |
Switch modes with Shift+Tab right in the session.
Rules in settings.json
Persistent permissions live in the project’s .claude/settings.json (shared with the team) or in your personal settings. Three lists:
{
"permissions": {
"allow": ["Bash(npm run test:*)", "Bash(npm run lint)", "Bash(git status)", "Bash(git diff:*)"],
"ask": ["Bash(git push:*)"],
"deny": ["Read(./.env)", "Read(./secrets/**)", "Bash(rm -rf:*)"]
}
}
- allow: the agent runs it without asking.
- ask: always asks, even in faster modes.
- deny: fully forbidden.
The /permissions command shows the current rules and lets you change them.
What to allow and what not
- Allow: tests, linter, formatter, build, reading git status.
- Ask: push, installing packages, database migrations, deploys.
- Deny: reading .env and keys, deleting outside the project, production access.
--dangerously-skip-permissions flag turns off all prompts. Use it only in an isolated environment (a container, a throwaway VM) without secrets or production access.The agent’s boundaries
The agent works in the folder where you started it. To give it another folder, add it explicitly. Check changes with git diff before committing: git is your safety net, every change can be reverted.
Team safety
- A shared
.claude/settings.jsonin the repo: the same rules for everyone. - Secrets outside the repository and out of the agent’s reach.
- Hooks for extra checks, such as blocking commands with dangerous patterns. See lesson 10.
Today's task
Create .claude/settings.json in your project: allow tests and the linter, require confirmation for push, deny reading .env. Check the rules with /permissions.