Claude Code 101
← All lessons
Lesson 02Claude Code 101

How Claude Code Works

Summary audio

Spoken summary — press play to read along: the line being spoken stays near the top.

Study notes

The Agentic Loop

  • User enters a prompt
  • Claude gathers required context by interacting with the model
  • Model returns text or tool calls that Claude executes
  • Claude takes action (e. g. , editing files, running commands)
  • Claude verifies results against the original prompt goal
  • If successful, waits for next prompt; if not, repeats the loop
  • User can add context, interrupt, or steer the model during the loop

Context Window

  • Stores conversation history, file contents, and command outputs
  • Has a size limit
  • When full, Claude automatically compacts the conversation by summarizing and removing non-essential information

Tools

  • The backbone of how agents work
  • Allow Claude to execute code rather than just output text
  • Examples: read file tool, search web tool
  • Claude uses semantic searching to determine when to call tools

Permission Modes

  • Default: Asks explicit permission before editing files or running shell commands
  • Auto-accept edits (Shift+Tab): Automatically edits files without asking, but still asks for commands
  • Plan mode: Uses read-only tools to compile an action plan before starting
  • Caution: Skipping permissions can make mistakes harder to catch

Core Difference from Chat Applications

  • Combines agentic loop, managed context window, tools, and configurable permissions
  • Can read codebases, take action, and verify its own work
  • Fundamentally different from standard chat windows

Takeaways

  • The Agentic Loop: Claude iteratively gathers context, executes tool calls (file edits, commands), verifies results against your goal, and repeats until successful—you can interrupt or steer at any point.
  • Tools Enable Action: Tools are what allow Claude to execute code and take real actions (read files, run commands, search) rather than just output text; Claude uses semantic searching to decide when to call them.
  • Context Window Management: The conversation history and file contents are stored in a limited context window that automatically compacts by summarizing when full.
  • Permission Modes Control Safety: Default mode asks permission before edits/commands; auto-accept skips file edit confirmations; plan mode uses read-only tools first—choose based on your risk tolerance.
  • Fundamentally Different from Chat: Claude Code combines agentic loops, managed context, tools, and permissions to read codebases, take autonomous action, and verify its own work—not just a standard chat interface.
Flashcards 10 cards
Question
click to reveal · ←/→
Answer
click to flip back
Export to Anki (.tsv) ↓
Knowledge check 5 questions