← Back to the exam
Claude Code
Master Exam
Free · Ranked result

Study guide

The 7-Layer Harness, read straight through

About 20 minutes · no sign-up

This is the same set of diagrams and explanations as the exam, reordered by layer instead of by question. Read it from the top and you come away with the whole shape of Claude Code environment design.

Basics

Harness basics

The harness is the entire environment the AI runs inside. It is not a set of prompting tricks.

The thinker and the thing that puts it to work are separate🐴Claudethe model — it thinksput onClaude Code = the harness (horse tack)Toolsread, write, searchMemoryinstructions, historyRuntimecommands, filesPermissionsblock, allowAll of this environment is the "harness". Not a bag of prompt tricksSame horse, different saddle and reins — almost all of the gap comes from this environment

How it works

A harness — the word comes from the straps and saddle you put on a horse — is defined in the official glossary as "the scaffolding around a model that gives an agent its tools, memory, and execution environment." In other words: everything except the model itself. You can also read it as the foundation that decides how the AI gets to work. Claude … the side that thinks. The model — the horse Claude Code … the side that puts it to work. The harness — the saddle and reins Reading files, running commands, blocking dangerous operations through permissions, loading instruction files — all of that is Claude Code, not Claude.

What you actually see

Two people run the same Claude and get completely different output. Almost all of that gap comes from the outside — because the model itself is identical for everyone.

So what do you do

Before you go learning clever prompts, decide three things: which folder you open, what gets read, and what is forbidden. That is the entire subject of this exam.

Source: Glossary — Agentic harness

The desk (the context window) is finite, and quality falls as it fills. Nearly every design choice traces back here.

There is only one desk (the context window)Start of the conversationfollows instructionsAfter a whilethe first rules get pushed outBefore it fills upauto-summary runs, detail is cutOn it: system, instructions, tool descriptions, conversation. "Load more, get smarter" does not hold

How it works

The context window — think of it as a desk — is how much Claude can hold in view at once. Your instruction files, the conversation so far, every file it has read, and the descriptions of its tools all sit on that same desk. As the desk fills up: · the rules you put down first get pushed out of view · /compact runs before it overflows and summarises away detail So "how much you loaded" and "how well it follows instructions" are not proportional. If anything they run the other way.

What you actually see

The person who trimmed their instructions to 80 lines gets followed more reliably than the one who wrote 500. It is the most common reversal you'll see in practice, and this is why.

So what do you do

Nearly everything that follows is a response to this one constraint. Separate what must be loaded every single time from what should load only when it is needed. That separation is what harness design actually is.

Source: Glossary — Context window
L1

Ground and reach

Use + in the prompt box, then "Add folder". A folder picker opens.

Desktop app — press + in the prompt box🖼Add file or photo📁Add folder🔌Connectors/Slash commandsA folder picker opensYou can now read and write that folder/add-dir with a path does exactly the sameCopying a pathMac: select in Finder, Option+Cmd+CWin: Shift+right-click → "Copy as path"When it says it cannot read something, suspect the folder scope, not your wording

How it works

Claude Code treats the folder you opened — the working directory — as its default territory. Files outside it prompt for confirmation every time, even if you paste the full path. Approving works, but depending on your permission mode it may go through without asking, so behaviour varies by setup. It is a safety measure that keeps it from wandering over your whole machine. Adding the folder up front puts it inside the territory regardless of settings. In the desktop app there are four ways to widen the reach: 1. + in the prompt box → "Add folder" (the most reliable) 2. Type /add-dir followed by the path 3. Put it in your settings file (permissions → additionalDirectories) 4. Use /cd to move the working directory itself The + menu also offers "Add file or photo", but that attaches a single file to the conversation — a different thing from bringing a folder into scope. "Connectors" is the entry point for outside services like Gmail or Notion.

What you actually see

Option 2 is fastest if you like pasting paths. On a Mac, select the folder in Finder and press Option+Cmd+C; on Windows, Shift+right-click → "Copy as path".

So what do you do

When it says it cannot read something, suspect the folder scope rather than the wording of your request. + → "Add folder" resolves it almost every time.

Source: Permissions — Working directories

It builds no index. It searches on the spot every time and reads only what it hits.

No index. Each time you ask, three sieves run on the spot12,000Everything in the working directory401. Match by name (Glob) 100 per call62. Match by content (Grep) scans with ripgrep23. Read only the hits (Read)Step 1 sees names only. Findable names hit first try and cut the round tripsTen thousand files cost nothing, because only the last few ever reach the desk

How it works

Searching happens through three sieves: 1. Match by name (Glob) — looks only at file and folder names. 100 results per call 2. Match by content (Grep) — scans the text inside files 3. Read — opens only what steps 1 and 2 turned up Steps 1 and 2 run on ripgrep, a very fast search engine, which gets through ten thousand files instantly. Nothing is sent to the cloud, and no index is built ahead of time.

What you actually see

Even in a folder of ten thousand files, only a handful ever reach the desk. Forty hits from step 1, six after step 2, two actually read — that is roughly how it thins out.

So what do you do

You do not need to brace yourself and "load everything". Opening a large folder does not slow anything down. But step 1 sees names only, so the more findable your names are, the more often it hits on the first try. That is where tidying up folder names pays off.

Source: Tools reference — Glob / Grep / Read

A .docx is compressed, so a content search never hits it. Put anything you want found later in .md or plain text.

What a content search finds, and what it misses○Found.md.txt.csv.json.py.htmlplain text inside△Not found.docx.xlsx.pptx.pdf.png.jpgtop row: ZIP-compressed / bottom row: not plain textName the file and it reads any of them. Readable and findable are different thingsKeep what you will search for later in .md or text (a PDF will not be found)

How it works

There are two ways to search: by name (Glob) and by content (Grep). A content search can only pick up files where the characters sit in the file as they are: .md .txt .csv — plain text inside → found .docx .xlsx .pptx — several XML files in a ZIP → no plain text, so not found .pdf .png .jpg — not plain text → readable, but not findable That said, if you name it directly — "read notes.docx" — Claude will unpack it and read it (in a standard setup where running commands is permitted). It gets the body text, tables, embedded images, even review comments. So the problem is not that it cannot read them. The problem is that it cannot find them.

What you actually see

Ask it to "find the documents that mention the subsidy" and you get the .md note back, while the Word file simply never existed. You notice the unreadable case because you can name the file; the missed search happens silently.

So what do you do

Put anything you will want to search for later in .md or plain text. That is the fix. Watch out for one thing: exporting to PDF does not make it findable either. A PDF's contents are not plain text, so it is readable but not searchable. If all you have is Office files, keep a Markdown export alongside them and the search will start hitting. The difference shows up most on meeting notes, specs and runbooks — the things you write specifically to look up later.

Source: Tools reference — Grep / Read

Adding a folder does not bring its instruction file along. You only gain the ability to read and write.

Add a folder and the instruction file does not come with itWorking directory (what you opened)Folder added afterwardsreading and writing files○○included in searches○○CLAUDE.md (instructions)○✕that folder's .claude/ settings○✕The official heading is the answer: "Additional directories grant file access, not configuration"

How it works

The heading in the official documentation is the answer: "Additional directories grant file access, not configuration." When you add a folder with + → "Add folder" in the desktop app, here is what does and does not come with it: yes reading and writing files (this is the whole point) yes being included in searches no CLAUDE.md (the instruction file) no settings in that folder's .claude/ (Only when you launch from a terminal with --add-dir do Skills and subagents get picked up as an exception. The instruction file is not read in either case.) Option 4 describes correct behaviour — for a CLAUDE.md in a subfolder of your working directory. It does not apply to a folder added afterwards.

What you actually see

The instruction says one form of address, and somehow the other one keeps coming out. You definitely added the folder. This is the hardest failure to spot, because the instruction file is being ignored silently.

So what do you do

To make those instructions count, either (1) reopen with that folder as your working directory (/cd), or (2) copy the same content into the CLAUDE.md of your working directory. The safe rule of thumb: never rely on the instruction file of a folder you added.

Source: Permissions — Additional directories grant file access, not configuration

Hidden is still visible to it. Hiding something does not make it safe.

Hidden folders turn up in searches tooFinder (what a person sees)📁 docs 📁 contracts 📄 notes.md📁 .drafts ← invisibleClaude's search📁 docs 📁 contracts 📄 notes.md📁 .drafts ← shows upName search (Glob)sees hidden / ignores .gitignoreContent search (Grep)sees hidden / respects .gitignoreDo not hide what you want untouched — stop it with deny under permissions

How it works

When Claude Code calls its search engine (ripgrep), it passes --hidden by default — for searching by name and by content alike. So a hidden folder starting with "." shows up in searches like anything else. (An environment variable can turn this off, but the default is on.) The two searches do cover slightly different ground, though: Name search (Glob) — ignores .gitignore. It looks at everything Content search (Grep) — respects .gitignore, but still looks inside hidden files Both exclude version-control folders such as .git, .svn and .hg from the outset.

What you actually see

Searching a 13-file folder for "acceptance" turned up .hidden/notes.md — a file Finder does not show at all.

So what do you do

Hiding does not protect anything. To keep something off limits, write it into the deny list under permissions. deny beats allow, and approving at the prompt will not get past it. The most dangerous state to be in is leaving something sensitive lying around while assuming it is out of sight.

Source: Permissions — Configure permissions
L2

Context design

They stack, they don't override. Every one found gets chained together, from the top level down.

Not one file wins — every one chains together, from the top down~/.claude/CLAUDE.mdshared by every project~/work/CLAUDE.mdthe shape of that tree~/work/client-a/CLAUDE.mdthis job's assumptions (nearest)What lands on the deskthe nearer, the lateron conflict, the nearer winsThe ones above are not removed — they keep taking up desk spaceShared rules up, job assumptions down — and the higher it sits, the shorter it stays

How it works

CLAUDE.md — the instruction file read first, every single time — is not a matter of picking one. Every file found gets chained together from the top level down and lands on the desk. ~/.claude/CLAUDE.md — shared across all projects (the widest) ~/work/CLAUDE.md — the shape of that whole tree ~/work/client-a/CLAUDE.md — assumptions for this job only (the nearest) Because the nearer file comes last, it wins in practice when two of them contradict. But it does not delete what is above it — the unnecessary rules up top keep taking up desk space.

What you actually see

You can see what is loaded right now with /context. "More is being loaded than I thought" is what nearly everyone says.

So what do you do

Put shared rules at the top and job-specific assumptions at the bottom — and keep the ones at the top short, because they follow you into every folder you ever open.

Source: Memory — CLAUDE.md hierarchy

It looks tidier, and not one character less lands on the desk. This is the single biggest trap.

Split it across files and not one character less lands on the deskBeforeCLAUDE.md, 500 lines500 lines on the deskAfter20 lines+480 lines pulled in with @ (expanded at startup)500 lines on the deskTo actually make it lighter — change when it is read, not where it livesConditional rules (read only for that work) / Skills (body loads only when called)Aim for under 200 lines per file. "I tidied it and it got no lighter" is almost always this

How it works

A line starting with @ inside CLAUDE.md is an import. At startup its contents are expanded in place and land on the desk as part of the file. Before splitting: CLAUDE.md, 500 lines → 500 lines on the desk After splitting: CLAUDE.md 20 lines + 480 via @ → 500 lines on the desk All that shrank is the line count you can see. The amount loaded is identical.

What you actually see

Almost every "I tidied it up and it did not get any lighter" question comes down to this. Check /context and you get the same number as before.

So what do you do

To actually make it lighter, change when things get read rather than where they live. · Conditional rules (.claude/rules/) — read only during that kind of work · Skills — the body loads when you call it Move anything you do not need every time into one of those two. Aim for under 200 lines per CLAUDE.md.

Source: Memory — CLAUDE.md imports
L3–L4

Procedures and connections

All that normally sits on the desk is a name and a one-line description. That is why writing more of them costs nothing.

A Skill stays off the desk until used. So any number of them costs nothing10 Skills sitting there← only one gets used todayNormallyonly names and one-line descriptions10 of them = a few linesWhen calledthat one's body lands on the deskand stays for the rest of the sessionCLAUDE.md loads in full every time — the decisive difference. Long procedures belong in Skills

How it works

A Skill is a written procedure. You put what to do in a single file (SKILL.md) and leave it there. Normally — only the name and the description (one line) sit on the desk When called — the body lands on the desk This is the decisive difference from CLAUDE.md. CLAUDE.md loads in full every time; a Skill does not load until you use it. Which is exactly why long procedures are worth turning into Skills.

What you actually see

Everyone has at least one instruction they re-paste into the chat every time. "Turn what we just did into a skill" is enough to make it one.

So what do you do

Move anything you paste repeatedly into a Skill. But note that once a Skill has been called, its body stays on the desk for the rest of the session — so keep the body short and put long reference material in a separate file with a note to read it if needed. Store them in ~/.claude/skills/ and they work in whatever folder you open.

Source: Skills — How skills load

Normally only the tool names and a short per-server note load. The detailed spec is fetched right before use.

Connectors (MCP) also cost nothing until they are usedNormally on the desk — just the list of tool namesGmailNotionSlackDriveCalendarGitHubFigmaLinearExcelfreeeOnly just before use is that one spec loaded (deferred loading)Weight is not the worry. But gate any connector that can send, post or deleteService contents are never synced across on their own. It reads only when asked

How it works

A connector links you to an outside service through MCP (Model Context Protocol), a shared standard. Gmail, Notion, Slack, Google Drive and others become available as tools. The official documentation answers this directly: "Tool search is enabled by default. MCP tools are deferred rather than loaded into context upfront ... Only the tools Claude actually uses enter context." Normally — a list of tool names, plus a short note per server (capped around 2KB each) Just before use — the detailed spec for that one tool (argument types and so on) Ten connections behave like Skills: nothing loads until it is used. Option 4 is close but wrong, because the list of names is loaded.

What you actually see

The contents of those services — email bodies, pages — are never synced across on their own. It goes and reads only when you ask it to.

So what do you do

You do not need to hold back for fear of "connecting too much and slowing it down". But connecting does widen what Claude can do, so any connector that can write — send, post, delete — should be blocked in your permission settings or set to always require approval.

Source: MCP — Scale with MCP tool search
L5–L7

Enforcement, automation, observability

CLAUDE.md is a request; permissions is enforcement. If you want it stopped, put it in the settings.

Ways of stopping it, in order of strengthWrite it in CLAUDE.mdRequestpushed out of view as the desk fillsPermission mode: ManualConfirmasked every time; a person can still approvedeny under permissionsEnforceapproving will not get past itdeny beats allow. One folder in that list turns a request into enforcement

How it works

Ways of stopping something, in order of strength: weak Write it in CLAUDE.md — a request delivered as context. Sometimes ignored medium Permission mode: Manual — asked every time. A person can still approve it strong deny under permissions — forbidden in settings. Approving will not get past it deny beats allow and overrides any permission setting. The state you end up in is not "it asks before doing it" but "it cannot do it at all".

What you actually see

Writing DO NOT TOUCH in capitals in CLAUDE.md does not help: once the conversation runs long and the desk fills up, that line gets pushed out of view. Writing it more forcefully is not the fix.

So what do you do

Put one folder you do not want touched into deny right now. That alone turns a request into enforcement. Conversely, put the routine work you are tired of approving into allow and let it run. Deciding deny and allow together is the whole job of this layer.

Source: Permissions — Configure permissions

A hook is your own code, attached to a given event. It runs without waiting for Claude to decide anything.

A request and a mechanism are different thingsWritten in CLAUDE.md = a requestwrite it in the instructionsClaude decidessometimes it runs, sometimes notdesk fills up, that line leaves viewHooks = a mechanisman event happensit always runsno waiting on ClaudeDesk usage: zeroAttach points: before a tool, after a tool, conversation end, session startFound something that must happen every time? Reach for a hook, not another line

How it works

A hook is code you write that runs whenever a particular event happens. There are several places to attach one: Before a tool is used (PreToolUse) — stop a dangerous operation on the spot After a tool is used (PostToolUse) — reformat automatically after a save, say When the conversation ends (Stop) When a session starts (SessionStart) — load today's schedule, for instance Two properties matter: 1. It always runs. Claude gets no say in whether it feels like it 2. The work itself happens off the desk. Attaching more of them does not, by itself, cost context That said, "never loads" is too strong. Hooks on SessionStart and on UserPromptSubmit are built to hand their output to Claude, and whatever they hand over does land on the desk (capped at 10,000 characters). Option 2 describes a Skill, option 3 a connector (MCP), option 4 /compact.

What you actually see

Writing "always do this" in CLAUDE.md and attaching a hook produce wildly different execution rates. The first is a request; the second is a mechanism.

So what do you do

When you find something that must happen every single time, reach for a hook instead of adding another line to CLAUDE.md. You get a guarantee of execution without spending a single character of desk space.

Source: Hooks — Hook events

You see what is on the desk, itemised. It is the tool that replaces guessing with numbers.

/context — what is on the desk right now, itemised100%system descriptiontool descriptions (connectors)CLAUDE.md (every level)Skills already calledconversation so farspace remainingOnce before you touch a setting, once after. That alone puts an end to blind tuningLearn /doctor as well (an environment health check). It finds the cause before you reinstall

How it works

/context shows you what is on the desk right now, itemised: · the system description · tool descriptions (from the connectors you attached) · CLAUDE.md (every level that got loaded) · the bodies of any Skills already called · the conversation so far · what space remains This is the observability layer. Look at it before and after you change something and you get a number telling you whether it worked.

What you actually see

"My CLAUDE.md is bigger than I thought" is the first thing nearly everyone says. Where to start tidying usually turns up right here.

So what do you do

Type /context once before you touch a setting and once after. That habit alone puts an end to adjusting things blind. Worth learning alongside it: /doctor, which checks the health of your environment and often finds the cause before you resort to reinstalling.

Source: Commands reference — /context

Only a cloud routine runs while your machine is closed. Loops and local runs both need it awake.

Four kinds of automation. Pick by where it runs and what happens when you close the lidHookHooksLoop/loopLocalRoutinesCloudRoutinesTriggereach eventevery few mina set timea set timeRuns onyour PCyour PCyour PCAnthropicWindow opennot neededneedednot needednot neededLid closed—stopsstopskeeps runningIn the desktop app: sidebar Routines → New → local or cloud

How it works

In the desktop app, Routines in the sidebar lets you choose between "cloud" and "local". Add /loop and that makes three. The official comparison table is the answer: cloud local /loop Runs on Anthropic your PC your PC PC powered on not needed needed needed Window open not needed not needed needed Shortest interval 1 hour 1 minute 1 minute Local files no (copies) yes yes There is a fourth thing that runs on events rather than times: hooks. The four break down like this: Hook — whenever something happens (a save, a tool being used) Loop — every few minutes, inside the window you have open Local — at a set time, if your machine is awake Cloud — at a set time, even with your machine off

What you actually see

A local routine only runs while the app is open and the machine is awake. Close a laptop and it sleeps, so that run is skipped (it catches up with a single run when the machine wakes).

So what do you do

Anything that has to run overnight, early morning or while you are out goes in the cloud. Anything that has to read local files stays local. Anything that just watches the work in front of you is a loop. Those three cover it.

Source: Routines — Automate work with routines

A checklist for your own setup

When you're done reading, check your own environment against these seven. Whichever line isn't ticked is what to do next.

Now go and test yourself

Everything you just read is exactly what the 15 questions cover. 100 points, 80 to pass, 30 seconds each. No sign-up, free.

15 questions · multiple choice / 100 points / 80 to pass · 30 sec

Take the exam →Follow on 𝕏 for new material →

Every section is sourced from the official Claude Code documentation (code.claude.com/docs). The link sits at the end of each section.

Claude and Claude Code are trademarks of Anthropic. This is an unofficial exam, written by an independent author from the public documentation.