The Summarize Prompt
the summarize prompt
Part of: AI Text Summarizer
Every summarizer runs the same loop: read the source, ask the model for the gist, print the result. This lesson builds the piece the rest of the project depends on, the summarize prompt . What we're building By lesson 8 you'll have a command-line tool. Paste an article or pipe in a text file, and you get back a short summary. Inside, it runs the same loop each time: read the input, build the prompt, call the model, parse the reply, print it. The job is narrow. It compresses long text into short text without inventing anything. The prompt does the real work. A summary prompt is more than "summarize this please." It's a precise instruction set the model follows on every run, including articles you'll never read yourself. The prompt has two channels The Anthropic Messages API takes the standing rules and the actual input on separate channels: - system carries who the model is and exactly what to return. You write it once. - messages carries the article to summarize, as a single user turn. Notice the article rides in messages, never in system. The system prompt is the config; the article is the data. Keeping them apart means you write the rules once and only swap the input each call. W
Challenge: Summarize or Keep