Context Engineering + Long-Context Workflows for Marketing
Copy-ready Claude prompt
Here are this week's 30 new threads from our five anchor subreddits, pasted above this instruction: {{pasted_threads}}. Score each on buying intent, flag any thread over 24 hours old as low-priority per our first-hour rule, and summarize the top 5 in a ranked list.Learning objectives
- Define "attention budget" and system-prompt "altitude" in Anthropic's own terms.
- Apply the rule that long documents belong at the top of a prompt, above the query and instructions.
- Map Anthropic's five agent workflow patterns to specific Reddit-ops tasks.
- Distinguish compaction from context editing as the two core context-management levers.
- Decide when a task needs the memory tool versus the Project knowledge base versus neither.
Prerequisites: Lessons 6.1.1-6.1.2.
Core concepts
Context engineering is Anthropic's term for curating the smallest set of high-signal tokens the model actually needs, because every model operates on a limited "attention budget", more context is not free, and irrelevant context actively degrades output quality (Anthropic Engineering, "Effective context engineering for AI agents"). The practical rule this course uses constantly starting now: for any input over roughly 20,000 tokens, a week's worth of pasted Reddit threads, for instance, place that long material at the top of the prompt, above your query, instructions, and examples. This is a concrete, testable formatting rule, not a vague best practice (platform.claude.com prompting guide), and it is the reason a weekly-digest prompt should read "here are 40 threads, now analyze them" rather than "analyze the following 40 threads" with the threads buried below.
System prompts should also sit at the right "altitude", specific enough to actually guide behavior, loose enough to leave Claude's own judgment room to work. A prompt that hardcodes every possible subreddit rule is too low-altitude and brittle; one that just says "be helpful on Reddit" is too high and useless. The workable altitude states your ethics line, disclosure requirement, and scoring rubric precisely, then trusts Claude's judgment for the specific wording of any individual draft.
Anthropic's five agent workflow patterns, prompt chaining, routing, parallelization, orchestrator-workers, and evaluator-optimizer, map directly onto Reddit tasks, with the explicit guidance to start simple and add complexity only when it demonstrably helps ("Building Effective AI Agents," Anthropic Engineering). Routing decides whether a new thread goes to the intent-scoring path or the competitor-monitoring path. Parallelization runs five subagents (Lesson 6.3.3) across five anchor subreddits simultaneously instead of serially. Orchestrator-workers has one Claude instance delegate subreddit-specific research to workers, then synthesize their output into the weekly digest (Lesson 6.4.1). Evaluator-optimizer gives a drafted reply a second pass explicitly scoring it against Stage 4's 80/20 ratio and disclosure rule before it reaches the human queue.
For sessions that run long, a full week of monitoring in one continuing conversation, two levers keep quality from degrading: compaction, which distills the window into a high-fidelity summary, and context editing (tool-result clearing), which drops old, re-fetchable tool outputs rather than letting them pile up (Anthropic, "Managing context on the Claude Developer Platform"). Combined with the memory tool, a persistent, cross-session file directory for "just-in-time" retrieval instead of front-loading everything, Anthropic reports a 39% performance improvement over baseline. Practically: your daily run does not re-explain your ICP and ethics rules from scratch every morning; it reads them just-in-time from memory or the Project knowledge base.
Video lessons
Supporting reading
- Effective context engineering for AI agents, Anthropic Engineering (https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents), the definitive statement on attention budget and altitude this lesson is built on.
- Building Effective AI Agents, Anthropic Engineering (https://www.anthropic.com/engineering/building-effective-agents), the canonical source for the five workflow patterns and the start-simple principle.
- Managing context on the Claude Developer Platform, Anthropic (https://claude.com/blog/context-management), explains compaction and context editing as the two concrete long-session levers.
Exercise
Take your longest single Reddit-ops task from Stage 4 (a week of monitoring logs, say) and rewrite the prompt so the raw thread data sits above the instructions. Compare Claude's output quality against the original ordering.
Assignment
Write a one-page memo mapping each of the five agent workflow patterns to one named Reddit-ops task you will build in Modules 6.3-6.4, with a one-sentence justification for why that pattern (not a simpler one) is warranted.
Claude workflow
- Skill idea: a "context-order-checker" skill that flags any drafted prompt where long pasted material appears below the instructions instead of above it.
- Automation: a scheduled weekly compaction pass on any Reddit-ops conversation running longer than five days, keeping the working session lean without losing the thread history.
Expected outcomes
- Can state the "long documents at the top" rule and demonstrate it on a real prompt.
- Can map all five agent workflow patterns to a specific named Reddit-ops task.
- Can explain the difference between compaction and context editing without notes.
Pass the chapter quiz (70%+) to unlock the next chapter.