micky@garden:~/claude-working-directory$cd ..

claude code · the working directory

Where Claude works, and how it reaches outside

Run claude in a folder and that folder becomes its world — the working directory. But the project isn't a cage. Claude reads memory from parent folders, loads your global ~/.claude, and can be handed extra roots — while anything genuinely outside the fence has to clear a permission prompt first. Step through it: the boundary is drawn, and every crossing is either pre-authorized or asked for out loud.

A nested-folder map of Claude Code's working directory: a green scope fence around my-app, a claude token, and reach lines out to ~/.claude and a blocked secrets/.env.

guided walkthrough

The fence, and four ways across it

The orange claude token sits on the working directory. The green dashed fence is what Claude can touch without asking. Walk the six steps — watch reaches stay inside, climb to parents, pull in global config, get stopped at the line, and finally widen the fence with --add-dir.

~/Users/micky
.claudeglobal · always in scope
CLAUDE.mdglobal memory
skills/
agents/
settings.json
projectsmonorepo root
CLAUDE.mdinherited memory
my-appcwd
CLAUDE.mdproject memory
src/
index.ts
utils.ts
package.json
shared-uisibling package
Button.tsx
secretsoutside the fence
.env
$claude

The working directory is the anchor

You ran claude inside my-app. That folder becomes the working directory — the root of everything Claude does. On launch it already reads my-app/CLAUDE.md for your project's instructions.

cwd~/projects/my-app
--add-dirnone
in scopemy-app
always~/.claude
Parent walk-up

Claude reads CLAUDE.md / AGENTS.md from the cwd and every parent directory up to your home folder. Project memory inherits from above.

Global ~/.claude

Global memory, skills, subagents, and settings in ~/.claude are loaded for every session, no matter which project you start in.

--add-dir

Add extra trusted roots at launch or mid-session. The boundary grows to include them, so reads and edits there happen with no prompt.

Permission prompt

Reach for any path outside the trusted roots and Claude must ask first. Allow once, allow always (added to settings), or deny — your call.