Claude Code Architecture
Claude Code runs locally, right inside your project folder. Unlike an editor's autocomplete, it doesn't just suggest a line and wait - it runs in a loop: search the code, propose an edit, run the tests, fix what breaks. You stay in one terminal window instead of juggling an editor, a browser tab, and a test runner.
A real session: Claude reads the files, edits the code, runs the tests, and commits - all without leaving this window.
Claude Code works in a four-step loop: scan, plan, execute, correct.
Indexing
Claude Code maps your project's files and finds the code that matters using fast search, the same way you'd grep for a function name.
Proposal
It reads the target code and drafts the exact edit. You see the plan before anything gets written to disk.
Execution
It runs your build, tests, and linters to check the change actually works - not just that it looks right.
Correction
If a test fails, it reads the error, fixes the code, and re-runs the tests - looping until they pass.
How slash commands structure agent workflows.
A slash command is a shortcut for a task you'd otherwise have to explain in a full sentence every time. Type /commit instead of describing what a good commit message looks like.
Write Git Commit
Reads your staged changes and writes a clear commit message. You approve it before it lands.
Draft Pull Request
Compares your branch against main and writes the PR description - what changed, and why.
Diagnose Issue
Starts an investigation into a reported bug - tracing the call path to find where it breaks.
Why working in the terminal beats an IDE sidebar.
No More Tab-Switching
You describe the bug, Claude reads the file and fixes it - without a browser tab or an IDE panel in between.
Bulk Migrations
Ask it to convert 50 tests from Jest to Vitest. It does the mechanical work; you review the diff.
Follow-Ups Without Repeating Yourself
Because it remembers the session, you can say "also allow numbers in that field" without re-pasting the file.
You Approve, It Executes
You decide what to build and review every diff. Claude handles the typing.
Two habits that keep a terminal-running agent safe.
Command Confirmation
Claude Code asks before running write commands or bash calls. You read the command before you approve it.
Clean Git Tree Baseline
Start with a clean git index. If Claude breaks something, `git reset --hard` gets you back instantly.
"The terminal is no longer just a shell. It is the agent's workspace."
Start clean. Git is your rollback if the agent takes a wrong turn.
Read before you approve. Don't authorize a command you haven't looked at.