Study · Claude Course

Controlling Output

Steer the *shape* of Claude's output without changing the core prompt, via **prefilling** (seed a partial assistant message Claude continues from) and **stop sequences** (halt when a string appears; the string is excluded).

type conceptstatus activeapi · output · structured-data

Key points

  • Structured data extraction: prefill the opening delimiter (```json) + stop on the closing delimiter (```) → copy/parse-ready output, no markdown chatter.
  • Works for any structured format.
  • A more reliable alternative for structured output is a tool whose input schema is the data structure (see Tool-Use).

Sources

  • 2026-06-28-claude-course
Compiled from wiki/study/claude-course/Controlling-Output.md · git is the source of truth