Study notes · 9% of the exam

CLAUDE.md, Settings, Skills and Plugins

CLAUDE.md, rules and auto memory are context that Claude follows as guidance. Settings files are configuration that the client enforces. Skills and plugins package procedures that load on demand. Know where each file lives, what loads at launch versus on demand, how settings precedence and list merging work, how skills are discovered, invoked and restricted (in Claude Code and in the Agent SDK), and what survives `/compact`.

Key points

  1. 1

    CLAUDE.md locations, in load order: managed policy (/etc/claude-code/CLAUDE.md, C:\Program Files\ClaudeCode\CLAUDE.md, or the claudeMd managed key), user ~/.claude/CLAUDE.md, project ./CLAUDE.md or ./.claude/CLAUDE.md, and local ./CLAUDE.local.md (gitignored). Files from the working directory and every directory above it load at launch and are concatenated, root first, with CLAUDE.local.md after CLAUDE.md in each directory. Subdirectory CLAUDE.md files load on demand.

  2. 2

    CLAUDE.md is delivered as a user message after the system prompt, so Claude can miss or misread it. Keep each file under about 200 lines, make instructions concrete and checkable, cut whatever Claude can derive from the code, and avoid contradictions (Claude may pick either side). @path imports expand at launch (relative to the importing file, up to four hops), so they do not save context. Block-level HTML comments are stripped.

  3. 3

    .claude/rules/*.md without frontmatter load like .claude/CLAUDE.md. With paths: globs they load only when Claude reads or edits a matching file. claudeMdExcludes (glob on absolute paths, any settings layer, arrays merge) skips other teams' files in a monorepo but cannot exclude the managed CLAUDE.md.

  4. 4

    AGENTS.md (v2.1.277+): by default it is read only when no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md exists on the path. Set Project instructions to claude-md-and-agents-md to load both, or import it with @AGENTS.md.

  5. 5

    Auto memory lives in ~/.claude/projects/<project>/memory/ (one folder per git repo, shared by worktrees, local to the machine). The first 200 lines or 25KB of MEMORY.md load each session, and topic files are read on demand. Turn it off with autoMemoryEnabled: false or CLAUDE_CODE_DISABLE_AUTO_MEMORY=1. In the SDK it loads regardless of settingSources, and Claude saves new memories with the Write and Edit tools.

  6. 6

    Settings precedence, highest first: managed, then --settings (and the SDK settings option), then .claude/settings.local.json, then .claude/settings.json, then ~/.claude/settings.json. Lists such as permissions.allow merge across files instead of overriding. Environment variables are decided per key: ANTHROPIC_MODEL beats the model key in any file, and --model or /model beat both. Settings files are strict JSON, and a broken file is skipped silently in -p runs (check with claude doctor).

  7. 7

    Skills: .claude/skills/<name>/SKILL.md (project), ~/.claude/skills/ (personal), managed, plugin (/plugin-name:skill). .claude/commands/*.md still works, and a skill beats a command file with the same name. Same-name resolution: enterprise > personal > project. A same-name skill replaces a bundled command but not its aliases. Progressive disclosure: descriptions are always listed (description plus when_to_use capped at 1,536 characters), the body loads on invocation and stays in context, and supporting files are read when needed.

  8. 8

    Key frontmatter: disable-model-invocation: true means user-only and keeps the description out of context. user-invocable: false means Claude-only. allowed-tools pre-approves tools for the invoking turn only and restricts nothing. context: fork plus agent runs the body in a fresh subagent with no conversation history (Explore and Plan also skip CLAUDE.md). paths, model, effort and arguments are also available. $ARGUMENTS, $0, ${CLAUDE_SKILL_DIR} and ${CLAUDE_PROJECT_DIR} are substituted.

  9. 9

    ` !cmd and ``! blocks run before Claude sees the skill and inline the command's output. They are checked against permission rules (never prompted), and any non-zero exit aborts the whole invocation (exit 1 is allowed for grep- and diff-style commands; append || true otherwise). disableSkillShellExecution in managed settings turns injection off for user, project, plugin and added-directory skills.

  10. 10

    Agent SDK: skills and CLAUDE.md come from settingSources (default ["user", "project", "local"]; [] loads none; "project" is needed for repo CLAUDE.md, rules and skills). skills: "all" | string[] | [] filters what the model may invoke and adds the Skill tool. It is not a sandbox, it rejects wildcards, and /name dispatch still works. In Python, setting skills with setting_sources unset narrows sources to ["user", "project"]. The SDK has no API for registering skills in code.

  11. 11

    SDK plugins: plugins: [{ type: "local", path }] (local is the only type; relative paths resolve against cwd; ~ is not expanded; missing paths are skipped silently). Check plugins, plugin_errors, skills and slash_commands in the system/init message. Output style is a settings key: in TypeScript use settings: { outputStyle: "Explanatory" } (not a top-level option); in Python settings takes a JSON string or file path. Values are case-sensitive.

  12. 12

    /compact [focus] summarizes and continues; /clear starts empty (the old session can be resumed). After compaction, the system prompt and output style still apply. Root CLAUDE.md, unscoped rules and auto memory are re-injected. Path-scoped rules and nested CLAUDE.md reload only on demand. Invoked skills are re-attached (first 5,000 tokens each, 25,000 total, newest first). Anything said only in chat is summarized away. In a one-shot SDK query(), /clear has no practical effect.

Common traps

  • Using CLAUDE.md (even a managed one) for a hard rule. It is guidance. Enforce with permissions.deny in managed settings or with a hook.

  • Expecting @imports to shrink context. Use path-scoped rules, nested CLAUDE.md files or skills instead.

  • Assuming a higher-precedence permissions.allow list replaces a lower one. Lists merge, so add an ask or deny rule to take something back.

  • Assuming a project skill beats a personal skill with the same name, the way project settings beat user settings. It is the other way round.

  • Treating allowed-tools as a restriction, or as a session-long grant. It pre-approves tools for one turn, and workspace trust does not gate it in -p.

  • Writing "outputStyle": "explanatory" in lowercase. It silently falls back to the Default style.

  • Passing settingSources: [] with skills: "all" and expecting project skills. Nothing is discovered.

  • Using context: fork for a task that depends on the current conversation. The forked subagent never sees it.

Further reading

Suggest a resource

No extra reading for CLAUDE.md, Settings, Skills and Plugins yet. Found a guide, video or cheat sheet that made it click? Share it and help the next learner.

Test yourself on CLAUDE.md, Settings, Skills and Plugins

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