How Does Claude Code Work? A Look Under the Hood
How does Claude Code work inside? The agentic loop, tools, permissions and checkpoints — explained for non-programmers, no computer science required.
Claude Code works as a loop: it gathers context about your project, takes action with tools, verifies the result, and repeats until the task is done. Inside there are two parts — a model that reasons and tools that act — wrapped in what the docs call an agentic harness. Today I'm popping the hood, because once you see the mechanism, you stop treating it like magic and start steering it like a machine.
No computer science ahead, I promise. If you can follow how a dishwasher cycles — fill, wash, rinse, check — you can follow this.
What actually happens when you press Enter?
Your request kicks off three phases that blend into each other: gather context, take action, verify results. Ask a question about your project and the loop might stop at phase one. Ask for a bug fix and it cycles through all three repeatedly — reading files, editing, running tests, reading the failures, editing again. The key insight: Claude decides each next step based on what the previous step taught it, chaining dozens of actions and course-correcting along the way. It's not executing a pre-written script; it's navigating.
Anatomy of one task: 'fix the failing tests'
- 1Claude runs your test suite to see what's actually failing — facts first.
- 2It reads the error output, like a doctor reading the chart.
- 3It searches your project for the files involved.
- 4It reads those files to understand how the code is supposed to behave.
- 5It edits the files to fix the issue.
- 6It runs the tests again. Still failing? The loop goes around again — without you typing anything.
What tools does Claude Code have?
Without tools, an AI can only talk. Tools are what make Claude Code an agent: every tool use returns information that feeds the next decision. The built-in set falls into five families — file operations (read, edit, create), search (find files and text across the project), execution (run commands, start servers, use git), web (search and fetch documentation), and code intelligence (spot type errors after edits, via plugins). On top of that it can spawn subagents — helper copies of itself with their own clean workspace — and ask you questions when it's unsure.
What can Claude Code access on my computer?
When you run claude in a folder, it sees: the files in that folder and its subfolders (elsewhere only with your permission), your terminal, your git state, your CLAUDE.md instruction file, and auto memory — notes it saved for itself in past sessions. Your conversations are stored locally on your machine, as plain-text files under ~/.claude/projects/ — that's what makes resuming and rewinding sessions possible. And before Claude edits any file, it snapshots the current version first.
Can it break something? The two safety nets
Net one: checkpoints. Every file edit is reversible — press Esc twice to rewind to an earlier state, or just ask Claude to undo. Net two: permissions. By default Claude asks before editing files or running commands. Press Shift+Tab to cycle modes: default (asks), auto-accept edits (file changes without asking), and plan mode, where Claude only explores and proposes a plan without touching your files at all. The honest caveat from the docs: actions with external side effects — sending things, deleting things in online services — can't be checkpointed, which is exactly why Claude asks before those.
The loop isn't a sealed machine — you can interrupt at any point. Press Esc to stop Claude mid-action, or just type a correction and press Enter without stopping it: Claude reads your note as soon as the current step finishes and adjusts course. Steering beats restarting, every time.
How do you use it well, knowing all this?
Three habits fall straight out of the mechanism. First, be specific upfront — name files, constraints, examples — because precise context means fewer loop iterations spent guessing. Second, give Claude something to verify against: expected results, a screenshot of the design, 'the page should show 5 items'. The verify phase is only as good as the target you define. Third, treat it as a conversation: when the first attempt misses, don't start over — say what's wrong and let the loop continue from there.
claude
Open a terminal in any project folder and type claude. Then give it a real task and watch the loop run: reading, acting, checking — narrated live in front of you.
Here's the kicker: tonight, give Claude Code one task and don't touch the keyboard until it finishes. Just watch the loop — what it reads, what it tries, how it checks itself. Ten minutes of watching the mechanism will improve your prompts more than any list of tips, because you'll finally know who you're talking to.

Author
Evgeny Arsentyev
PhD · Chief Product Officer at a healthtech company
▌ Reading is the blue pill
Want to actually build this?
Guides explain. The free course transforms — personalized, gamified, and built to get you shipping fast.
◉ Take the red pill →