Study notes · 3.1% of the exam

Claude Code Operation

Configure and operate Claude Code for a team: know where instructions, skills, commands, subagents and memory live; how the CLAUDE.md and settings hierarchies resolve; and how to run sessions, headless and streaming modes, and permission modes safely.

Key points

  1. 1

    Core components: CLAUDE.md files and .claude/rules/ hold standing instructions. Skills (SKILL.md) are reusable procedures, invoked as /name or loaded automatically when their description matches. Subagents (.claude/agents/, ~/.claude/agents/) run in their own context windows. Hooks give deterministic automation. Auto memory holds notes Claude keeps for itself.

  2. 2

    Custom commands have been merged into skills. .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy; skills add supporting files and automatic invocation. $ARGUMENTS (or $0, $1, and so on) inserts the text typed after the command.

  3. 3

    CLAUDE.md scopes: managed policy (for example /etc/claude-code/CLAUDE.md on Linux) for the whole organization; ~/.claude/CLAUDE.md for you in every project; ./CLAUDE.md or ./.claude/CLAUDE.md for the team, committed; ./CLAUDE.local.md for you in this project, gitignored.

  4. 4

    CLAUDE.md files in the working directory and its parents load at launch and are concatenated, not overridden. Files in subdirectories load on demand when Claude reads files there. @path imports still load at launch, so they organize content without saving context. Keep each file under about 200 lines.

  5. 5

    Rules: .md files in .claude/rules/ load unconditionally unless they have paths frontmatter (globs), in which case they load only when Claude works with matching files. ~/.claude/rules/ holds personal rules for all projects.

  6. 6

    Repository initialization: /init analyzes the codebase and generates a starting CLAUDE.md (build and test commands, conventions). If one exists, it suggests improvements instead of overwriting. Then add what Claude cannot discover on its own.

  7. 7

    Auto memory is on by default and machine-local: notes live in ~/.claude/projects/<project>/memory/, with a MEMORY.md index loaded at session start. It is not shared with teammates, so team conventions belong in the project CLAUDE.md. Manage it with /memory.

  8. 8

    Subagent persistent memory (the memory frontmatter field) has three scopes: user (~/.claude/agent-memory/, all projects), project (.claude/agent-memory/, shareable through git) and local (.claude/agent-memory-local/, not committed).

  9. 9

    settings.json precedence, highest first: managed settings, command-line arguments, .claude/settings.local.json, .claude/settings.json, ~/.claude/settings.json. Nothing a developer sets overrides managed settings. Array settings such as permissions.allow merge across scopes.

  10. 10

    Sessions: claude --continue (-c) reopens the most recent conversation in the current directory. claude --resume (-r) reopens a specific session by ID or name, or shows a picker. --fork-session resumes under a new session ID. In scripts with overlapping runs, capture session_id from JSON output and use --resume.

  11. 11

    Headless mode: claude -p "..." runs once and exits. --output-format is text, json (one final object with result, session_id and cost) or stream-json (newline-delimited events). --json-schema with json returns structured_output. Use --allowedTools to pre-approve tools and --bare for fast, reproducible scripted runs.

  12. 12

    Streaming mode: --output-format stream-json --verbose --include-partial-messages streams token deltas, and the last line is a result message. --input-format stream-json accepts streamed input.

  13. 13

    Permission modes: default (Manual), acceptEdits (file edits and common filesystem commands), plan (read-only analysis), auto (acts without prompts while background safety checks screen actions), dontAsk (only pre-approved actions; everything else is denied, suited to CI) and bypassPermissions (no checks; isolated containers or VMs only). Shift+Tab cycles modes.

  14. 14

    Auto mode treats boundaries you state in chat ("don't push") as block signals, but these live in the transcript and can be lost to compaction. For a hard guarantee, add a deny rule; deny rules apply in every mode. Admins can turn auto mode off with disableAutoMode in managed settings.

Test yourself on Claude Code Operation

Ten questions, with the answer and explanation after each one.