Learn Everything

Paths/Claude Engineer/Claude Code Essentials / Settings & Permissions

Guided Taskbeginnerubuntu:24.04Ask AI

Write the Settings File

The settings file decides the model, the tools and the rules for every session. Write one for a project that builds with pnpm.

Validator

⏱ 0:00

IDLE — checks run live as you type commands; submit when done

01Requirements

live checks
  • Directory ~/.claude exists○
  • File ~/.claude/settings.json exists○
  • The settings name the model○
  • The settings list allowed and denied commands○

02Walkthrough

4 steps
  1. 01

    Create the claude directory

    The user settings live in your home directory, so every project inherits them.

    mkdir -p ~/.claude
  2. 02

    Write the settings

    model picks the engine, permissions decides what runs without a prompt. The allow list is short on purpose.

    echo '{\n "model": "claude-sonnet-4",\n "permissions": {\n "allow": ["Bash(pnpm test:*)", "Bash(pnpm build:*)", "Read", "Edit"],\n "deny": ["Bash(rm -rf:*)", "Bash(git push:*)", "Read(./.env)"]\n }\n}' > ~/.claude/settings.json
  3. 03

    Verify the settings

    cat prints the file. Every allowed command is a command you no longer approve one by one.

    cat ~/.claude/settings.json
  4. 04

    Submit for validation

    The validator checks the model and both permission lists.

03Stuck?

0 of 3 revealed

Take a hint without losing the lab — each one points at the thing to look at, not at the answer.

04AI Tutor

guides, never solves

Tell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?

04Notebook

saved locally in this browser

learner@lab — ubuntu:24.04

↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list