Claude Code
authorKRIATIZ
02 · Steering the agent / lesson 2 of 3

Permissions and modes

20 minIntermediate5 steps

By default the agent asks before every file change and command. Safe, but slow. Here is how to allow routine work, forbid dangerous actions and stay in control.

data and requestsproblem
Lesson stepsstep 1 of 5
  1. Prompts
  2. allow
  3. ask
  4. deny
  5. Modes
step 1 / 5problem

Confirming every step

By default the agent asks before every command. Safe, but you press "yes" on npm test for the twentieth time.

Key point

Allow routine, forbid danger.

← → steps · space pause · R restart · ⌘K search
You will learn 5
Lesson notes

Work modes

ModeWhat happensWhen to use
Defaultthe agent asks before edits and commandsgetting started, unfamiliar project
Accept editsfile edits without asking, commands with permissiona clear task while you watch the changes
Planthe agent only reads and plans, changes nothingbig 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.
No-permissions mode. The --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.json in 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.

Set up Claude Code safely for your team?

I will prepare a shared settings.json with permissions, hooks and rules for your team.

Let’s talk
Vladyslav Koshelyev
Vladyslav Koshelyev

Developer at KRIATIZ. I build chatbots, websites and automation for businesses. Author of the course.

About the author · Telegram