Skip to content

Study guide

Harnesses and the agent loop: what Claude Code and Cursor do every turn

The main points of the lesson, for review.

Read the lesson Take the quiz

Key terms

  • Agent loop: gather context, take action, verify results, and go round again until done
  • Harness: the layer around the model that provides tools and manages what it sees (Claude Code, Cursor's agent)
  • Tool: one action the harness lets the model take: read, edit, search, run a command, fetch a page
  • Context window: everything the model can see right now; the harness fills it
  • CLAUDE.md: standing instructions loaded at the start of every Claude Code session
  • Compaction: replacing older conversation with a summary when the context fills up
  • Checkpoint: a snapshot of files before an edit, so you can rewind
  • Permission mode: how much the agent may do without asking (plan, default, accept edits, auto)

Facts that move (checked November 24, 2026)

  • Claude Code's five tool kinds: file operations, search, execution, web, code intelligence (Anthropic)
  • Esc stops the agent; Esc twice opens checkpoints; Shift+Tab cycles permission modes (Anthropic)
  • Remote actions such as databases, APIs and deploys cannot be checkpointed (Anthropic)
  • Cursor's agent has no limit on tool calls per task and checkpoints before significant changes (Cursor)

Your first week with an agent

  • Work in a folder of copies
  • Start in Plan mode, then Manual mode, which asks before each change
  • Say what done looks like in a way it can check
  • Watch the first minute; press Esc the moment it drifts
  • Keep every client detail out

Back to the lesson