LeetLLM
My PlanLearnGlossaryTracksPracticeBlog
LeetLLM

Your go-to resource for mastering AI & LLM systems.

Product

  • Learn
  • Glossary
  • Tracks
  • Practice
  • Blog
  • RSS

Legal

  • Terms of Service
  • Privacy Policy

© 2026 LeetLLM. All rights reserved.

All Topics
Your Progress
0%

0 of 177 articles completed

🛠️Computing Foundations0/9
Git, Shell, Linux for AIDocker for Reproducible AIPython for AI EngineeringNumPy and Tensor ShapesCUDA for ML TrainingMPS & Metal for ML on MacData Structures for AISQL and Data ModelingAlgorithms for ML Engineers
📊Math & Statistics0/8
Gradients and BackpropVectors, Matrices & TensorsLinear Algebra for MLAdam, Momentum, SchedulersProbability for Machine LearningStatistics and UncertaintyDistributions and SamplingHypothesis Tests, Intervals, and pass@k
📚Preparation & Prerequisites0/13
Neural Networks from ScratchCNNs from ScratchTraining & BackpropagationSoftmax, Cross-Entropy & OptimizationRNNs, LSTMs, GRUs, and Sequence ModelingAutoencoders and VAEsThe Transformer Architecture End-to-EndLanguage Modeling & Next TokensFrom GPT to Modern LLMsPrompt Engineering FundamentalsCalling LLM APIs in ProductionFirst AI App End-to-EndThe LLM Lifecycle
🧮ML Algorithms & Evaluation0/11
Linear Regression from ScratchLogistic Regression and MetricsDecision Trees, Forests, and BoostingReinforcement Learning BasicsValidation and LeakageClustering and PCACore Retrieval AlgorithmsDecoding AlgorithmsExperiment Design and A/B TestingPyTorch Training LoopsDataset Pipelines and Data Quality
📦Production ML Systems0/6
Feature Engineering for Production MLBatch and Streaming Feature PipelinesGradient Boosted Trees in ProductionRanking and Recommendation SystemsForecasting and Anomaly DetectionMonitoring Predictive Models
🧪Core LLM Foundations0/8
The Bitter Lesson & ComputeBPE, WordPiece, and SentencePieceStatic to Contextual EmbeddingsPerplexity & Model EvaluationFile Ingestion for AIChunking StrategiesLLM Benchmarks & LimitationsInstruction Tuning & Chat Templates
🧰Applied LLM Engineering0/24
Dimensionality Reduction for EmbeddingsCoT, ToT & Self-Consistency PromptingFunction Calling & Tool UseMCP & Tool Protocol StandardsContext EngineeringPrompt Injection DefenseResponsible AI GovernanceData Labeling and Human FeedbackEvaluating AI AgentsProduction RAG PipelinesHybrid Search: Dense + SparseReranking and Cross-Encoders for RAGRAG Evaluation for Reliable AnswersLLM-as-a-Judge EvaluationBias & Fairness in LLMsHallucination Detection & MitigationLLM Observability & MonitoringExperiment Tracking with MLflow and W&BPrompt Optimization with DSPyModel Versioning & DeploymentSemantic Caching & Cost OptimizationLLM Cost Engineering & Token EconomicsModel Gateways, Routing, and FallbacksDesign an Automated Support Agent
🎓Portfolio Capstones0/9
Capstone: Delivery ETA PredictionCapstone: Product RankingCapstone: Demand ForecastingCapstone: Image Damage ClassifierCapstone: Production ML PipelineCapstone: Document QACapstone: Eval DashboardCapstone: Fine-Tuned ClassifierCapstone: Reproducible ML Study
🧠Transformer Deep Dives0/8
Sentence Embeddings & Contrastive LossEmbedding Similarity & QuantizationScaled Dot-Product AttentionVision Transformers and Image EncodersPositional Encoding: RoPE & ALiBiLayer Normalization: Pre-LN vs Post-LNMechanistic InterpretabilityDecoding Strategies: Greedy to Nucleus
🧬Advanced Training & Adaptation0/16
Scaling Laws & Compute-Optimal TrainingPre-training Data at ScaleBuild GPT from Scratch LabJAX for PyTorch ResearchersContinued Pretraining for Domain ShiftSynthetic Data PipelinesSupervised Fine-Tuning PipelineMixed Precision TrainingDistributed Training: FSDP & ZeROLoRA & Parameter-Efficient TuningReward Modeling from Preference DataRLHF & DPO AlignmentConstitutional AI & Red TeamingRLVR & Verifiable RewardsKnowledge Distillation for LLMsModel Merging and Weight Interpolation
🤖Advanced Agents & Retrieval0/16
Vector DB Internals: HNSW & IVFAdvanced RAG: HyDE & Self-RAGGraphRAG & Knowledge GraphsRAG Security & Access ControlStructured Output GenerationReAct & Plan-and-ExecuteGuardrails & Safety FiltersCode Generation & SandboxingComputer-Use / GUI / Browser AgentsHuman-in-the-Loop Agent ArchitectureAI Coding Workflow with AgentsAgent Memory & PersistenceAgent Failure & RecoveryRecursive Language Models (RLM)Multi-Agent OrchestrationCapstone: Production Agent
⚡Inference & Production Scale0/19
Inference: TTFT, TPS & KV CacheMulti-Query & Grouped-Query AttentionKV Cache & PagedAttentionPrefix Caching and Prompt CachingFlashAttention & Memory EfficiencyContinuous Batching & SchedulingScaling LLM InferenceModel Parallelism for LLM InferenceModel Quantization: GPTQ, AWQ & GGUFLocal LLM DeploymentSLM Specialization & Edge DeploymentSpeculative DecodingLong Context Window ManagementMixture of Experts ArchitectureMamba & State Space ModelsReasoning & Test-Time ComputeAdvanced MLOps & DevOps for AIGPU Serving & AutoscalingA/B Testing for LLMs
🏗️System Design Capstones0/9
Content Moderation SystemCode Completion SystemMulti-Tenant LLM PlatformLLM-Powered Search EngineVision-Language Models & CLIPMultimodal LLM ArchitectureDiffusion Models: Images & TextReal-Time Voice AI AgentReasoning Agent System Design
🎤AI Lab Interviewing0/4
AI Lab Coding Interview: Python SystemsAI Lab System Design InterviewAI Lab Behavioral InterviewAI Lab Technical Presentation
🔬Project Deep Dives0/17
Deep Dive - vLLMDeep Dive - SkyRLDeep Dive - FlashAttentionDeep Dive - FlashInferDeep Dive - DeepGEMMDeep Dive - NCCLDeep Dive - MegatronDeep Dive - DeepSpeedDeep Dive - RayDeep Dive - MLflowDeep Dive - PyTorchDeep Dive - TransformersDeep Dive - SGLangDeep Dive - slimeDeep Dive - DeepEPDeep Dive - TinkerDeep Dive - Light-PEFT
Back to Topics
LearnApplied LLM EngineeringContext Engineering
🤖MediumLLM Agents & Tool Use

Context Engineering

Move past fitting tokens into the window and learn context engineering: curate a high-signal working set, package reusable Agent Skills, and build resumable harnesses with durable checkpoints.

23 min read
Learning path
Step 60 of 177 in the full curriculum
MCP & Tool Protocol StandardsPrompt Injection Defense

Personalize this lesson

Adapt explanations and teaching visuals to your background and preferred voice.

Prompt engineering taught you to write a clear instruction. Function calling and the Model Context Protocol (MCP) added tool schemas, tool results, and external resources. Once an agent works through several steps, its request contains much more than a prompt: instructions, tool definitions, retrieved text, conversation history, intermediate results, and saved state.

A model's context window is the token capacity available for that request. Context engineering decides which tokens deserve a place in it at each step. Capacity asks whether the request fits; context engineering asks whether each included item helps the model make the next decision.

More tokens don't guarantee better answers. A request may sit far below its limit yet perform worse than a smaller curated packet because irrelevant tools, stale results, or wrong intermediate claims remain active. Compare curation policies on answer quality, latency, and cost instead of treating available capacity as permission to include everything.

How does context engineering differ from prompt engineering and context capacity?

Answer

Prompt engineering improves one instruction. Context capacity sets how many tokens a request can hold. Context engineering curates the instructions, tools, evidence, history, and state that enter each request so the model reasons on a small high-signal set.

A longer trace can make the agent worse

Picture an incident agent investigating why deploy RUN-842 failed its canary. It reads the deploy record, checks CI logs, searches rollback runbooks, and follows request traces. Every tool call dumps its raw output back into the conversation. After forty turns the context holds: the original alert, four full runbooks (most of which were a dead end), six multi-thousand-token trace exports, three issue-search results, and one early hallucinated guess that a database migration lock caused the outage.

The agent now performs worse than it did at turn five. It re-runs the dead-end issue search, cites a migration lock that doesn't exist, and picks a verbose, irrelevant rollback paragraph over the trace span that matters. The window is nowhere near full, yet the agent is failing.

This isn't a tool-protocol or prompt-wording problem. Every tool returned a valid payload, and the request fits. The active context has accumulated low-signal and even wrong tokens, and the model is attending to all of them. Context engineering is the set of techniques that would have prevented this failure. The failed-canary agent will anchor the rest of the chapter.

Context includes more than the instruction

For a few years the applied-AI conversation was dominated by prompt engineering: finding the right words and phrasing for a single instruction. Anthropic frames context engineering as the natural successor to that practice.[1]Reference 1Effective context engineering for AI agentshttps://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents Prompt engineering is about writing one good instruction. Context engineering is the broader discipline of curating and maintaining the entire set of tokens present during inference: the system prompt, tool definitions, retrieved documents, conversation history, tool results, and any memory loaded back in.

Anthropic's framing is a useful operating objective because it gives you a single guiding principle:

Find the smallest set of high-signal tokens that maximize the likelihood of your desired outcome.[1]Reference 1Effective context engineering for AI agentshttps://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents

Every technique below tests a way to approach that minimal, high-signal set. A 2025 survey organizes the same strategies into a formal taxonomy.[2]Reference 2A Survey of Context Engineering for Large Language Models.https://arxiv.org/abs/2507.13334

Why is "context engineering" framed as the successor to "prompt engineering" rather than a replacement?

Answer

Prompt engineering optimizes the wording of one instruction. Context engineering keeps the prompt-writing skill but expands the scope to the entire token set entering the model at inference: tools, retrieved docs, history, tool results, and memory. The goal becomes curating the smallest high-signal set, rather than phrasing one message well.

Why curation needs evaluation: context rot

The reason you shouldn't assume "just add more" is empirical, not stylistic. Chroma's Context Rot report evaluated 18 models across increasing input lengths and reported non-uniform performance as input grew, including on simple retrieval and copying tasks.[3]Reference 3Context Rot: How Increasing Input Tokens Impacts LLM Performancehttps://research.trychroma.com/context-rot The magnitude and shape depend on model, task, and distractors; additional tokens are a hypothesis to evaluate, not free signal.

Anthropic describes the same engineering concern with an "attention budget" mental model and recommends seeking the smallest high-signal token set that supports the desired outcome.[1]Reference 1Effective context engineering for AI agentshttps://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents Padding a window with low-signal tokens always increases input cost and can lower workload quality; a paired evaluation should determine when.

Context rot is one reason behind the techniques below. Cost, latency, stale state, and contradictory evidence are others. Curation should be an explicit candidate policy with quality checks, not an article of faith.

Define context rot and explain why it makes curation worth evaluating.

Answer

Context rot is the reported pattern that reliability can degrade as input token count grows, including before the hard limit is hit. It means an engineer should measure whether adding context helps a workload, and compare it with a curated high-signal alternative.

Four failure modes of an overloaded context

Before fixing context, you need vocabulary for how it breaks. Drew Breunig describes four useful failure-mode labels for long contexts.[4]Reference 4How Long Contexts Failhttps://www.dbreunig.com/2025/06/22/how-contexts-fail-and-how-to-fix-them.html They are diagnostic categories, not a formal completeness proof. Each one can show up in our failed-canary agent.

Failure modeWhat it'sSymptom in the failed-canary agent
PoisoningA hallucination or error enters the context and is then referenced repeatedlyThe early wrong guess about a migration lock keeps getting cited
DistractionThe context grows so long the model over-focuses on its history and stops forming new plansThe agent re-runs the dead-end issue search instead of trying something new
ConfusionSuperfluous content (often too many tools) drives a low-quality responseWith dozens of tools loaded, the agent picks a cluster-admin tool
ClashNew information or instructions conflict with earlier ones in the contextA tool defined in XML contradicts the system rule to answer only in JSON

Don't turn reported examples into universal thresholds. Breunig cites an agent anecdote where long history encouraged repeated actions and a tool-use experiment where reducing tool count improved one model's benchmark result.[4]Reference 4How Long Contexts Failhttps://www.dbreunig.com/2025/06/22/how-contexts-fail-and-how-to-fix-them.html Those observations justify testing history pruning and tool gating on your model, tools, and task distribution.

failure-mode-router.py
1def diagnose_context(signals: set[str]) -> tuple[str, str]: 2 routes = [ 3 ("wrong_fact_repeated", "poisoning", "remove disproven spans and rebuild notes"), 4 ("old_trace_replayed", "distraction", "compact old history and retain decisions"), 5 ("irrelevant_tool_called", "confusion", "gate tools for the current phase"), 6 ("rules_disagree", "clash", "reconcile conflicting instructions"), 7 ] 8 for signal, mode, action in routes: 9 if signal in signals: 10 return mode, action 11 return "unknown", "inspect trace and add an evaluation case" 12 13mode, action = diagnose_context({"wrong_fact_repeated", "old_trace_replayed"}) 14print(f"diagnosis={mode}; next_action={action}")
Output
1diagnosis=poisoning; next_action=remove disproven spans and rebuild notes
Diagnostic graph mapping four canary-agent symptoms to context failure modes and fixes: repeated wrong fact to poisoning and drop span, old-trace replay to distraction and compact, irrelevant tool call to confusion and gate tools, conflicting rules to clash and reconcile.
The first job is diagnosis. Map the symptom to a failure mode, then test the matching move instead of blindly stuffing more tokens into the window.

The write, select, compress, isolate taxonomy

Naming failure modes tells you what went wrong. LangChain organizes agent context strategies into four useful buckets: write, select, compress, and isolate.[5]Reference 5Context Engineering for Agentshttps://blog.langchain.com/context-engineering-for-agents/ The LLM acts like a CPU, and its context window acts like RAM: a working set to manage deliberately. The buckets classify many common tactics without claiming they exhaust every design.

Context-engineering loop with working set at center and four surrounding moves: write durable notes out, select current evidence in, compress stale history, and isolate noisy search into sub-agents, then evaluate quality.
Most context decisions reduce to four moves around a working set. Save durable state outside the window, load only current evidence, shrink what must stay, and isolate noisy exploration into separate windows.

Write: keep state outside the window

The cheapest token is the one you never put in the window. Write means persisting information outside the context so it doesn't consume the attention budget until it's needed.[5]Reference 5Context Engineering for Agentshttps://blog.langchain.com/context-engineering-for-agents/ The classic pattern is a scratchpad: the agent writes notes, plans, or intermediate findings to a file or a state field, then reloads only the relevant note later. Agentic memory works the same way, persisting durable facts across sessions.[6]Reference 6Agent Memory: How to Build Agents that Learn and Rememberhttps://www.letta.com/blog/agent-memory/

For the failed-canary agent, a write strategy means: instead of leaving four full runbooks in the conversation, the agent records "auth callback errors confirmed; migration lock ruled out" as a one-line note and drops the raw tool results. The finding survives; the tokens don't.

write-durable-findings.py
1def promote_findings(tool_results: list[dict]) -> tuple[list[str], list[str]]: 2 notes, discarded_raw = [], [] 3 for result in tool_results: 4 if result["confirmed"]: 5 notes.append(f"{result['source']}: {result['finding']}") 6 discarded_raw.append(result["raw_output"]) 7 return notes, discarded_raw 8 9notes, discarded = promote_findings([ 10 {"source": "deploy_RUN_842", "finding": "auth callback errors confirmed", "confirmed": True, "raw_output": "..." * 600}, 11 {"source": "db_lock_check", "finding": "migration lock ruled out", "confirmed": True, "raw_output": "..." * 900}, 12]) 13print("notes:", notes) 14print("raw_results_to_remove:", len(discarded))
Output
1notes: ['deploy_RUN_842: auth callback errors confirmed', 'db_lock_check: migration lock ruled out'] 2raw_results_to_remove: 2

Select: pull in only what this step needs

Select means retrieving only the tokens relevant to the current step.[5]Reference 5Context Engineering for Agentshttps://blog.langchain.com/context-engineering-for-agents/ Retrieval-augmented generation (RAG) applies that idea to documents: a retriever surfaces a small set of relevant chunks instead of dumping the whole corpus into one request. Selection also applies to tools. The confusion failure mode above appears when an agent loads all 50 tools instead of the 5 needed for its current phase.

phase-specific-tool-gate.py
1TOOLS_BY_PHASE = { 2 "investigate": {"deploy_lookup", "trace_lookup", "runbook_search"}, 3 "resolve": {"runbook_search", "rollback_advisor", "page_oncall"}, 4} 5 6def tools_for_phase(phase: str, available: set[str]) -> list[str]: 7 allowed = TOOLS_BY_PHASE.get(phase, set()) 8 return sorted(allowed & available) 9 10available = {"deploy_lookup", "trace_lookup", "runbook_search", "rollback_advisor", "cluster_admin"} 11print("investigate tools:", tools_for_phase("investigate", available))
Output
1investigate tools: ['deploy_lookup', 'runbook_search', 'trace_lookup']

Prompt caching is a separate efficiency tactic: when requests reuse a stable prefix, a provider may avoid repeating part of the work needed to process it.[7]Reference 7Prompt caching.https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching Caching does not select better evidence or reduce the number of tokens the model reasons over. It improves eligible repeated-prefix economics only when the provider and cache policy support it.

cacheable-prefix-check.py
1import hashlib 2 3def prefix_key(system_prompt: str, stable_docs: str) -> str: 4 payload = system_prompt + "\n" + stable_docs 5 return hashlib.sha256(payload.encode()).hexdigest()[:12] 6 7stable = prefix_key("Use cited policy only.", "Policy version: 7") 8same_prefix = prefix_key("Use cited policy only.", "Policy version: 7") 9changed_prefix = prefix_key("Use cited policy only.", "Policy version: 8") 10print("reuse eligible:", stable == same_prefix) 11print("changed source invalidates candidate:", stable != changed_prefix)
Output
1reuse eligible: True 2changed source invalidates candidate: True

Compress: shrink what must stay

When information has to stay in the window, compress reduces it to the required tokens.[5]Reference 5Context Engineering for Agentshttps://blog.langchain.com/context-engineering-for-agents/ Two common candidate patterns follow.

The first is compaction: when a conversation approaches the budget, summarize it and start a fresh window seeded with that summary.[1]Reference 1Effective context engineering for AI agentshttps://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents The agent keeps its working knowledge but sheds the verbose transcript that produced it.

The second is tool-result pruning, a low-risk candidate fix for our failed-canary agent. Anthropic describes clearing old tool results as a light-touch form of compaction: once the relevant finding has been captured, old raw results can often leave the active context.[1]Reference 1Effective context engineering for AI agentshttps://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents Preserve evidence that the next decision still needs, and compare quality before adopting an aggressive pruning policy.

tool-result-pruning-policy.py
1def prune_results(results: list[dict], keep_recent: int) -> list[str]: 2 retained = [] 3 cutoff = max(0, len(results) - keep_recent) 4 for index, result in enumerate(results): 5 if index < cutoff and result["finding_recorded"]: 6 retained.append(f"[pruned raw output] finding={result['finding']}") 7 else: 8 retained.append(result["raw"]) 9 return retained 10 11history = [ 12 {"raw": "old trace span" * 100, "finding": "auth errors confirmed", "finding_recorded": True}, 13 {"raw": "latest canary trace", "finding": "rollback review needed", "finding_recorded": False}, 14] 15pruned = prune_results(history, keep_recent=1) 16print(pruned[0]) 17print(pruned[1])
Output
1[pruned raw output] finding=auth errors confirmed 2latest canary trace

Isolate: split work across focused windows

Isolate means splitting context across focused workers so no single window has to hold every exploratory trace.[5]Reference 5Context Engineering for Agentshttps://blog.langchain.com/context-engineering-for-agents/ A lead agent delegates a focused subtask, such as "check linked issues and rollback notes for every failed-canary exception", to a worker with its own clean context window. The worker does noisy exploration in isolation and returns a bounded evidence summary to the lead.[1]Reference 1Effective context engineering for AI agentshttps://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents

Isolation can reduce distraction and confusion because the lead doesn't need every intermediate search result. It also adds coordination overhead and creates clash risk when worker outputs disagree, so isolate is a candidate for separable exploration, not a default.

isolated-handoff-contract.py
1def accept_handoff(handoff: dict, token_limit: int = 400) -> bool: 2 required = {"claim", "evidence", "next_check", "tokens"} 3 return required <= handoff.keys() and handoff["tokens"] <= token_limit 4 5handoff = { 6 "claim": "auth callback failure qualifies for staged rollback", 7 "evidence": "trace span 2026-05-28 and rollback runbook section 4", 8 "next_check": "quote rollback blast radius for RUN-842", 9 "tokens": 86, 10} 11print(f"bounded handoff accepted: {accept_handoff(handoff)}")
Output
1bounded handoff accepted: True

Map each of the four context-engineering moves to a concrete technique, then to the failure mode it most directly fights.

Answer

Write (scratchpad or memory file) keeps tokens out of the window entirely. Select (RAG, tool gating) pulls in only relevant items and fights confusion. Compress (compaction, tool-result pruning) shrinks history and fights distraction and poisoning. Isolate (sub-agents) splits work into clean windows and fights distraction and confusion.

Package repeatable procedures as Agent Skills

A tool gives an agent an action such as reading a file or querying a trace. A prompt gives instructions for one conversation. An Agent Skill packages reusable procedural knowledge as a directory containing a SKILL.md file and optional scripts, references, and assets.[8]Reference 8Agent Skills Specificationhttps://agentskills.io/specification The agent can discover the Skill from its metadata, load its instructions when relevant, and fetch deeper resources only when the task calls for them.[9]Reference 9Agent Skillshttps://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview

That loading pattern is progressive disclosure. Instead of placing every runbook in every prompt, the runtime first exposes a small name and description. A matching task activates the full SKILL.md; a specialized reference or script stays outside the window until the instructions point to it. This is context selection implemented as a reusable package.

Skills, tools, and harness state solve different problems:

ComponentOwnsIt shouldn't own
Promptcurrent objective and constraintsreusable procedures for every future run
Toolan executable capability with a typed contractpolicy for when the action is appropriate
Skillreusable workflow, examples, scripts, and referenceslive task status or authorization decisions
Harnessdurable progress, retries, budgets, and completion evidencedomain instructions duplicated across every run

Build a small Skill package

Suppose the incident agent repeatedly performs the same triage procedure. Package that procedure instead of pasting a long runbook into every task. The Agent Skills specification requires name and description in SKILL.md frontmatter. It also defines conventional scripts/, references/, and assets/ directories whose contents can be loaded when needed.[8]Reference 8Agent Skills Specificationhttps://agentskills.io/specification

incident-triage-skill.txt
1incident-triage/ 2├── SKILL.md 3├── references/ 4│ └── handoff-contract.md 5└── scripts/ 6 └── validate-handoff.py

The description is part of the routing surface. It needs both capability and trigger language, while the body should keep only steps needed on most runs:

incident-triage/SKILL.md
1--- 2name: incident-triage 3description: Investigate failed deployments from alerts, traces, and approved runbooks. Use for canary failures, rollback analysis, or incident evidence handoffs. 4--- 5 6# Incident triage 7 81. Read the current alert and deploy record. 92. Load only investigation-phase tools. 103. Record each confirmed or disproven finding in the task checkpoint. 114. Read `references/handoff-contract.md` before delegating broad searches. 125. Run `scripts/validate-handoff.py` before returning evidence. 13 14Never execute a rollback. Return a proposed action with supporting source IDs.

The skill doesn't need a full rollback runbook in its main file. references/handoff-contract.md can define the worker response schema, while validate-handoff.py can check it deterministically. Only the validator's output needs to enter the model context when the script runs. Anthropic's Skills documentation describes this split between instructions, executable code, and resources as the mechanism behind progressive disclosure.[9]Reference 9Agent Skillshttps://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview

Test routing, procedure, and trust separately

A well-formed directory can still produce poor behavior. Evaluate at least three layers: whether the Skill activates for relevant requests, whether it stays inactive for unrelated requests, and whether following it produces a valid artifact. Keep these cases beside the Skill so a description edit can't silently change routing.

incident-triage/evals/routing.json
1[ 2 { 3 "request": "Investigate why canary RUN-842 failed and return trace evidence.", 4 "expected_activation": true, 5 "expected_artifact": "validated evidence handoff" 6 }, 7 { 8 "request": "Summarize our vacation policy.", 9 "expected_activation": false, 10 "expected_artifact": null 11 }, 12 { 13 "request": "Roll back RUN-842 now.", 14 "expected_activation": true, 15 "expected_artifact": "proposal only; no write executed" 16 } 17]

Treat installed Skills as code. Review and version their instructions, scripts, dependencies, network access, and expected outputs. A Skill can recommend a write or run a bundled script, but trusted application code still owns identity, authorization, sandboxing, and confirmation. A Skill-bundled script inherits the same PreToolUse hooks, sandbox, rate limits, and confirmation stack as any ordinary tool: progressive disclosure loads instructions into context but can't bypass the tool runtime. Progressive loading reduces context use; it doesn't create a security boundary.

Why is an Agent Skill a context-engineering primitive rather than a larger system prompt?

Answer

A Skill exposes small discovery metadata first, loads its reusable workflow only when the request matches, and reads or runs deeper resources only when needed. A larger system prompt pays the full token and distraction cost on every call. The Skill still needs routing, behavior, and security evaluation.

Make long-running work resumable

Compaction can preserve a conversation, but a task that lasts hours or days needs durable execution state outside that conversation. When a fresh context starts, it should reconstruct scope, completed work, current evidence, and the next safe action from files or records. Guessing from a summary invites duplicate work and premature completion.

Anthropic's long-running-agent experiments used an initializer, a feature list, a progress file, repository history, and repeatable startup checks so later sessions could make incremental progress from a known state.[10]Reference 10Effective harnesses for long-running agentshttps://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents A later harness design added planner, generator, and evaluator roles plus a written sprint contract that defined acceptance evidence before implementation began.[11]Reference 11Harness design for long-running application developmenthttps://www.anthropic.com/engineering/harness-design-long-running-apps These are reported designs, not universal requirements, but the durable-state principles transfer to research, incident response, and data work.

A resumable harness needs five artifacts:

ArtifactRequired contentResume question it answers
Task manifeststable task IDs, dependencies, status, acceptance criteriaWhat remains in scope?
Progress checkpointlast completed action, evidence paths, known failuresWhat happened in prior sessions?
Bootstrap commanddeterministic environment and smoke checkIs current state healthy before more work?
Work receipttests, outputs, hashes, or review resultIs a completed claim supported?
Recovery ruleretry, rollback, cancellation, and stale-lease behaviorWhat happens after interruption?

The task manifest is machine-readable scope, while the progress log is a human-readable explanation. Neither should silently overwrite the other. A task marked complete needs a receipt, and a receipt needs a stable path or identifier that a fresh session can verify.

Mini-lab: resume from verified receipts

The script below simulates a new context choosing the next ready task. It refuses to treat a done item as complete unless the checkpoint names its evidence. Dependencies prevent the final report from starting before source verification finishes.

resume-from-checkpoint.py
1from dataclasses import dataclass 2 3@dataclass(frozen=True) 4class WorkItem: 5 task_id: str 6 depends_on: tuple[str, ...] 7 status: str 8 receipt: str | None 9 10def verified_done(items: list[WorkItem]) -> set[str]: 11 invalid = [item.task_id for item in items if item.status == "done" and not item.receipt] 12 if invalid: 13 raise ValueError(f"done tasks missing receipts: {invalid}") 14 return {item.task_id for item in items if item.status == "done"} 15 16def next_ready(items: list[WorkItem]) -> WorkItem | None: 17 completed = verified_done(items) 18 for item in items: 19 if item.status == "pending" and set(item.depends_on) <= completed: 20 return item 21 return None 22 23checkpoint = [ 24 WorkItem("collect-traces", (), "done", "artifacts/traces-run-842.json"), 25 WorkItem("verify-cause", ("collect-traces",), "pending", None), 26 WorkItem("write-report", ("verify-cause",), "pending", None), 27] 28 29selected = next_ready(checkpoint) 30assert selected is not None 31print(f"resume_task={selected.task_id}") 32print(f"verified_receipts={sorted(verified_done(checkpoint))}")
Output
1resume_task=verify-cause 2verified_receipts=['collect-traces']

At session start, read manifest and checkpoint, inspect version history, run bootstrap smoke check, then select one ready task. At session end, run its acceptance check, write receipt, update status, and leave workspace recoverable. Cancellation should stop new work without deleting receipts; resume should verify them before continuing.

Separate generation from evaluation

For quality-critical work, define a small contract before generation. Producer proposes artifact and expected checks; evaluator reviews contract, then independently tests resulting artifact. The 2026 Anthropic harness used a comparable generator-evaluator agreement before each sprint.[11]Reference 11Harness design for long-running application developmenthttps://www.anthropic.com/engineering/harness-design-long-running-apps

sprint-contract.json
1{ 2 "task_id": "verify-cause", 3 "input_receipts": ["artifacts/traces-run-842.json"], 4 "deliverable": "artifacts/cause-analysis.json", 5 "acceptance": [ 6 "every causal claim cites a trace span", 7 "disproven migration-lock claim is absent", 8 "rollback remains a proposal" 9 ], 10 "evaluator": "incident-evidence-check" 11}

The evaluator shouldn't rely on the producer's claim that checks passed. It should open artifact, run named validation, and write its own receipt. This split controls premature completion and keeps acceptance criteria stable across context resets.

FailureSymptom after resumeGuardrail
Narrative-only progressnew session can't tell which claims were verifiedstructured task IDs and evidence paths
Completion without receiptharness skips unfinished workreject done status without verifiable evidence
Non-idempotent restartduplicate ticket, write, or deploymentoperation keys plus read-before-write checks
Stale leasetwo sessions work same taskowner and lease expiry in checkpoint store
Producer grades itselfplausible output passes without inspectionindependent evaluator and separate receipt
Secret in checkpointdurable context becomes data leakstore references or redacted facts, not credentials

An Agent Skill can teach each session the procedure for incident triage. The harness owns which incident task is active, what already passed, and how to resume safely. Keeping those responsibilities separate lets instructions evolve without corrupting live progress.

What must survive a context reset for a long-running task to resume safely?

Answer

Stable scope and task IDs, dependency and status data, receipts for completed work, current failures, a repeatable bootstrap check, and retry or cancellation rules must survive outside model context. A narrative summary can explain progress, but it can't replace machine-checkable state and evidence.

Rebuild the failed-canary working set

With the taxonomy in hand, the running example fixes itself. Instead of letting the window grow monotonically, the agent runs a curation step before each model call:

  1. Select only the tools relevant to the current phase (an investigation needs deploy lookup and traces, not cluster administration), then evaluate whether tool-call accuracy improves.
  2. Write durable findings to a scratchpad ("auth callback errors confirmed; migration lock ruled out") and drop the raw tool results.
  3. Compress by pruning trace exports older than a few turns and compacting the transcript once it grows large.
  4. Isolate the noisy "check every linked issue" exploration into a sub-agent that returns a one-paragraph summary.
  5. Detect poisoning: when the early migration-lock guess is identified as wrong, remove it from history so it stops being cited.

The window now holds the alert, current evidence, a short notes block, and a clean tool set. In the concrete script below, it shrinks an illustrative 12.4K-token raw set to a 3.2K-token active window plus short external notes. Lower input cost is immediate; better task performance still requires evaluation.

Flow chart splitting a 12,436-token raw agent trace into a 3,160-token active window, 186 external note tokens, and 9,090 removed stale, irrelevant, or poisoned tokens.
Curation keeps current evidence and active tools, writes two durable findings to notes, and removes 73% of the raw trace. The smaller window remains a candidate until evaluation confirms that quality holds.
Diagram showing Raw history, Curate: write / select / compress / isolate, Small high-signal window, and Evaluate quality, latency, cost.
Raw history, Curate: write / select / compress / isolate, Small high-signal window, and Evaluate quality, latency, cost.

The logic is simple enough to simulate with a tiny script. This version turns the failed-canary agent's messy transcript into a compact working set by keeping the current alert and evidence, writing durable findings to notes, and dropping poisoned or irrelevant tokens.

incident-agent-context-curation.py
1from dataclasses import dataclass 2 3@dataclass 4class ContextItem: 5 name: str 6 kind: str 7 tokens: int 8 signal: int 9 keep: str 10 11items = [ 12 ContextItem("alert_RUN_842", "task", 180, 10, "window"), 13 ContextItem("latest_trace_span", "evidence", 420, 10, "window"), 14 ContextItem("rollback_runbook", "evidence", 1800, 9, "window"), 15 ContextItem("scratchpad", "notes", 260, 8, "window"), 16 ContextItem("deploy_lookup_tool", "tool", 240, 8, "window"), 17 ContextItem("trace_lookup_tool", "tool", 260, 8, "window"), 18 ContextItem("old_trace_export", "log", 8200, 2, "drop"), 19 ContextItem("cluster_admin_tool", "tool", 360, 1, "drop"), 20 ContextItem("issue_search_tool", "tool", 410, 1, "drop"), 21 ContextItem("wrong_migration_lock_guess", "poison", 120, 0, "drop"), 22 ContextItem("auth_errors_confirmed", "finding", 90, 7, "notes"), 23 ContextItem("migration_lock_ruled_out", "finding", 96, 7, "notes"), 24] 25 26def summarize(selection): 27 return ", ".join(item.name for item in selection) 28 29raw_total = sum(item.tokens for item in items) 30window_items = [item for item in items if item.keep == "window"] 31notes_items = [item for item in items if item.keep == "notes"] 32dropped_items = [item for item in items if item.keep == "drop"] 33 34curated_total = sum(item.tokens for item in window_items) 35notes_total = sum(item.tokens for item in notes_items) 36 37print(f"raw_tokens={raw_total}") 38print(f"curated_window_tokens={curated_total}") 39print(f"external_notes_tokens={notes_total}") 40print(f"removed_tokens={raw_total - curated_total - notes_total}") 41print("window:", summarize(window_items)) 42print("notes:", summarize(notes_items)) 43print("dropped:", summarize(dropped_items))
Output
1raw_tokens=12436 2curated_window_tokens=3160 3external_notes_tokens=186 4removed_tokens=9090 5window: alert_RUN_842, latest_trace_span, rollback_runbook, scratchpad, deploy_lookup_tool, trace_lookup_tool 6notes: auth_errors_confirmed, migration_lock_ruled_out 7dropped: old_trace_export, cluster_admin_tool, issue_search_tool, wrong_migration_lock_guess
working-set-budget-packer.py
1from dataclasses import dataclass 2 3@dataclass 4class Candidate: 5 name: str 6 tokens: int 7 priority: int 8 required: bool = False 9 10def pack_working_set(candidates: list[Candidate], budget: int) -> list[str]: 11 ordered = sorted(candidates, key=lambda item: (not item.required, -item.priority)) 12 selected, used = [], 0 13 for item in ordered: 14 if used + item.tokens <= budget: 15 selected.append(item.name) 16 used += item.tokens 17 elif item.required: 18 raise ValueError(f"required item does not fit: {item.name}") 19 return selected 20 21items = [ 22 Candidate("alert RUN-842", 180, 10, required=True), 23 Candidate("latest trace span", 420, 10, required=True), 24 Candidate("rollback runbook", 1_800, 9), 25 Candidate("stale trace export", 8_200, 1), 26] 27print(pack_working_set(items, budget=3_000))
Output
1['alert RUN-842', 'latest trace span', 'rollback runbook']

Suppose a production incident trace reaches 120K tokens of mostly stale logs and one referenced hallucination, while the selected model advertises a much larger window. Why is "we have headroom, leave it" the wrong call?

Answer

Headroom is a capacity fact, not a quality result. Stale logs and a referenced hallucination create plausible distraction and poisoning failures. Compare a pruned or compacted candidate against the raw trace rather than relying on spare capacity.

Context thrashing: management work exceeds useful work

An agent can also over-manage a bounded window. Context thrashing is the operating pattern where it spends more tokens and tool calls retrieving, summarizing, evicting, and reloading context than advancing the task. One turn fetches a trace, the next compacts it, the next retrieves the same trace because the summary omitted a field, and the loop repeats without a new verified finding.

Don't diagnose thrashing from one large retrieval. Look for repeated churn with little progress:

SignalEvidence of thrashing
Context operations per completed task stepretrieval, compaction, or reload count rises while completed steps stay flat
Reload raterecently evicted evidence is fetched again without a changed question
New-evidence yieldretrieved tokens grow while accepted facts or receipts remain flat
Decision latencymost wall time occurs before the agent takes or verifies a task action

Use a stable working-set contract instead of a bigger window. Pin the task, current evidence, and next acceptance check for the phase. Cap retrieval and compaction cycles, require each cycle to add a named fact or resolve a decision, and isolate broad exploration behind a bounded handoff. If required evidence still doesn't fit, split the task or persist a structured checkpoint instead of paging the same material repeatedly.

How does context thrashing differ from ordinary context bloat?

Answer

Bloat means too much low-signal material remains active. Thrashing means the agent repeatedly spends retrieval and compaction work moving context in and out without producing new evidence or completing task steps. Bound the working set and require measurable progress per context operation.

Larger windows don't remove curation

Large-window model offerings make it tempting to treat curation as obsolete.[12]Reference 121M context is now generally available for Opus 4.6 and Sonnet 4.6https://claude.com/blog/1m-context-ga Bigger windows raise the capacity ceiling; they don't establish quality for an overloaded agent trace. Frameworks such as LangGraph expose short- and long-term memory plus summarization or deletion patterns because state management remains an application responsibility.[13]Reference 13LangGraph Memory Overviewhttps://docs.langchain.com/oss/python/concepts/memory

When an agent underperforms, inspect the transmitted context alongside model and window choices. Name a suspected failure mode, apply a bounded candidate change, and measure whether it improves the task.

When context curation breaks down

SymptomLikely causeFix
Agent gets worse over a long session despite spare windowDistraction from accumulated stale historyCompact the transcript; prune old tool results
Agent keeps citing a wrong factContext poisoning: an early error is being re-referencedRemove the bad tokens from history; don't just add a correction
Agent picks irrelevant tools or ignores the right oneContext confusion from overlapping active toolsGate tools per phase; evaluate a smaller active set
Model violates a format rule when a Model Context Protocol (MCP) tool is attachedContext clash between tool instructions and system rulesReconcile instructions or isolate the tool behind a sub-agent
Costs balloon and latency rises with no quality gainStuffing the window instead of curating itApply the smallest-high-signal-set principle: select and compress
Agent repeatedly reloads evidence it just summarized or evictedContext thrashingPin phase evidence; cap context operations; require new evidence or a completed step
Sub-agent answers conflict with each otherIsolation without reconciliationHave the lead agent resolve clashes before acting

Use this checklist before shipping an agent that handles long sessions:

  • Does the context shrink or stay bounded across turns, or does it only grow? Unbounded growth invites distraction and rot.
  • Are tool results pruned or compacted once they are no longer needed for the next step?
  • Does a phase-gated active tool set outperform loading every available tool on your evaluation cases?
  • When a sub-agent is used, does it return a distilled summary rather than its full transcript?
  • Do repeated retrieval or compaction calls produce a new accepted fact, receipt, or completed task step?
  • Do you have an eval that catches poisoning: a wrong fact persisting and being re-cited across turns?

An agent that worked in short demos degrades in long production sessions. What is the systematic first step before changing models?

Answer

Inspect the actual context being sent. Name a suspected failure mode (poisoning, distraction, confusion, or clash), then test a matching move: prune or compact for distraction and poisoning, gate tools for confusion, reconcile or isolate for clash. Compare the candidate on quality and cost before escalating architecture.

Diagnostic playbook

When a long-running agent underperforms, use this sequence:

  1. Inspect the actual context, not the window size or cost alone.
  2. Name the failure mode: poisoning, distraction, confusion, or clash.
  3. Choose the matching move: write, select, compress, or isolate.
  4. Rebuild the next call around the smallest high-signal working set.
  5. Compare baseline and curated calls on accuracy, latency, token cost, and failure recurrence.
  6. Only after that ask whether you still need a different model, window, or architecture.
remove-disproven-facts.py
1def rebuild_notes(notes: list[dict]) -> list[str]: 2 return [ 3 note["text"] 4 for note in notes 5 if note["status"] != "disproven" 6 ] 7 8notes = [ 9 {"text": "auth callback errors confirmed", "status": "confirmed"}, 10 {"text": "migration lock caused RUN-842", "status": "disproven"}, 11 {"text": "database lock ruled out", "status": "confirmed"}, 12] 13print("rebuilt notes:", rebuild_notes(notes))
Output
1rebuilt notes: ['auth callback errors confirmed', 'database lock ruled out']
curation-release-gate.py
1def approve_curation( 2 baseline_accuracy: float, 3 curated_accuracy: float, 4 baseline_tokens: int, 5 curated_tokens: int, 6 poisoned_references_after: int, 7) -> bool: 8 quality_ok = curated_accuracy >= baseline_accuracy 9 cost_ok = curated_tokens < baseline_tokens 10 poisoning_removed = poisoned_references_after == 0 11 return quality_ok and cost_ok and poisoning_removed 12 13approved = approve_curation( 14 baseline_accuracy=0.82, 15 curated_accuracy=0.87, 16 baseline_tokens=12_436, 17 curated_tokens=3_346, 18 poisoned_references_after=0, 19) 20print(f"curated context approved: {approved}")
Output
1curated context approved: True

Context engineering gives an agent a bounded, inspectable working set even as tools and history accumulate. The next chapter studies prompt injection, where untrusted content tries to turn retrieved evidence or tool output into instructions. Curation and source labels provide the context boundary that those defenses need.

State the one-sentence guiding principle of context engineering and explain why it subsumes the four-move taxonomy.

Answer

Find the smallest set of high-signal tokens that maximizes the chance of the desired outcome. Write, select, compress, and isolate are simply the four mechanisms for pushing toward that minimal high-signal set, each removing or avoiding low-value tokens in a different way.

Complete the lesson

Mastery Check

Answer every question, then check your score. Score 75% or higher to mark this lesson complete.

1.An incident agent already fits within the model window and serving latency is acceptable, but each call includes raw trace exports, irrelevant tool definitions, and a disproven migration-lock guess. Which engineering move targets the actual problem?

Correct answer: Apply context engineering: curate the evidence, tools, history, and notes so only a small high-signal working set enters the next call.

The failure is not capacity or serving efficiency, because the prompt fits and latency is acceptable. The bad tokens are still present and influencing inference. Context engineering decides which evidence, tools, history, tool results, and notes deserve the window; window management and caching do not remove low-signal or poisoned tokens.

2.A trace audit finds these symptoms: a disproven migration-lock cause is still cited; the agent re-runs an old issue search; it picks a cluster-admin tool from an overloaded tool set; and an XML tool instruction conflicts with a JSON-only system rule. Which mapping is correct?

Correct answer: Poisoning: remove the disproven fact. Distraction: compact stale history. Confusion: gate tools by phase. Clash: reconcile instructions or isolate the tool.

Poisoning is a wrong span being reused, so the repair is to remove or rebuild without it. Distraction comes from stale history pulling the agent back into old actions, so compacting or pruning helps. Confusion comes from too many irrelevant active tools, so selection through tool gating is appropriate. Clash is conflicting instructions, so the instructions must be reconciled or separated.

3.A team wants to append every linked issue and trace export to a prompt because the model's hard limit is far away. What does context rot imply they should measure before adopting that policy?

Correct answer: Compare the bloated prompt with a curated high-signal version, because reliability can degrade as input grows even before the hard limit.

Context rot is an empirical quality concern: adding tokens can make reliability worse before the prompt hits the model limit. Truncation, lost-in-the-middle placement, and prefill cost do not fully explain it. The engineering response is a paired evaluation of raw versus curated context on task quality, latency, and cost.

4.During a curation pass, the agent persists 'auth callback errors confirmed' to notes, loads only investigation-phase tools, replaces old raw trace spans with recorded findings, and sends linked-issue exploration to a worker that returns a bounded summary. Which labels match those four actions in order?

Correct answer: Write, select, compress, isolate

Persisting a durable finding outside the prompt is write. Loading only tools needed for the current phase is select. Replacing verbose raw traces with recorded findings is compress. Delegating noisy issue exploration to a separate worker with a bounded summary is isolate.

5.Use compression when verbose information must remain available to the same reasoning thread, and isolation when a separable subtask will produce noisy intermediate traces the lead agent does not need. An incident agent has both a long decision transcript and a broad linked-issue search. Which plan best applies these context-engineering rules?

Correct answer: Compress the main transcript into a compact decision summary, run the broad linked-issue search in an isolated worker, and have the lead consume only a bounded evidence summary.

Compression is appropriate when information must remain available in the same reasoning thread but is too verbose. Isolation is appropriate for noisy, separable exploration whose intermediate traces the lead does not need. The worker should return a bounded summary, and the lead should reconcile any conflicts before acting.

6.An agent retrieves a large trace, summarizes it, evicts the raw result, then retrieves the same trace on the next turn because the summary omitted one field. After six cycles it has no new verified finding or completed task step. What failure is this and what should change?

Correct answer: Context thrashing; pin the phase's required evidence, cap retrieval and compaction cycles, and require each cycle to add a named fact or complete a step.

Thrashing is context-management work that repeats without advancing the task. A stable working-set contract prevents immediate reloads, and a progress gate makes another retrieval or compaction cycle earn its cost through new evidence, a resolved decision, or a completed step.

7.The next call must resolve deploy RUN-842. The available context includes the alert, latest trace span, applicable rollback runbook, a short scratchpad, phase-relevant lookup tools, confirmed findings, stale trace logs, irrelevant issue-search and cluster-admin tools, and a disproven migration-lock guess. Which curation plan preserves needed evidence while reducing confusion and poisoning?

Correct answer: Keep the alert, latest trace span, applicable rollback runbook, short scratchpad, and phase-relevant lookup tools in the window; store confirmed findings as notes; drop stale logs, irrelevant tools, and the disproven guess.

A curated call should contain the current task, current evidence, compact working notes, and only the tools needed for the phase. Durable findings can be written outside the active window and reloaded as notes when needed. Stale logs, irrelevant tools, and disproven poisoned spans should not stay merely because they fit.

8.A long-session incident agent suddenly underperforms. The trace still fits in the selected model's window, and no one has inspected the actual messages sent to the model. What should the team do before switching models or expanding the window?

Correct answer: Inspect the transmitted context, name a likely failure mode, test a matching curation change, and compare accuracy, latency, cost, and recurrence.

The first step is to inspect what the model actually receives, not to assume the model or window is the problem. Once the team names a likely failure mode, it can test a bounded curation change and compare it against the raw baseline on quality, latency, cost, and whether the same failure recurs.

9.An incident-triage procedure includes a short discovery description, common workflow steps, a detailed handoff reference, and a deterministic validator script. How should an Agent Skill use progressive disclosure?

Correct answer: Expose name and trigger description first, load SKILL.md when the task matches, then read the handoff reference or run the validator only when the workflow reaches those steps.

Progressive disclosure keeps discovery metadata small, loads reusable instructions only after activation, and leaves specialized resources outside context until needed. Live task status belongs in harness state, not in a reusable Skill package.

10.A fresh context resumes a three-day incident investigation. One task is marked done, but its checkpoint contains no evidence path; a dependent report task is pending. What should the harness do?

Correct answer: Reject the unsupported done state, recover or rerun that task, and start the dependent report only after a verifiable receipt exists.

A resumable harness ties completion claims to receipts such as test output, artifact paths, or hashes. Dependencies should advance only after those receipts can be checked. A narrative summary or status flag alone can't prove the prior task finished correctly.

10 questions remaining.

Next Step
Continue to Prompt Injection Defense

Context curation controls which tools, evidence, history, and skill instructions reach the model. Prompt injection defense adds the trust labels, authorization checks, and execution boundaries needed when some of that context is untrusted.

PreviousMCP & Tool Protocol Standards
Share this article
XFacebookLinkedInBlueskyRedditHacker NewsEmail
References

Effective context engineering for AI agents

Anthropic · 2025

https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents

A Survey of Context Engineering for Large Language Models.

Multiple authors · 2025 · arXiv preprint

https://arxiv.org/abs/2507.13334

Context Rot: How Increasing Input Tokens Impacts LLM Performance

Hong, K., Troynikov, A., & Huber, J. · 2025

https://research.trychroma.com/context-rot

How Long Contexts Fail

Breunig, D. · 2025

https://www.dbreunig.com/2025/06/22/how-contexts-fail-and-how-to-fix-them.html

Context Engineering for Agents

LangChain · 2025

https://blog.langchain.com/context-engineering-for-agents/

Agent Memory: How to Build Agents that Learn and Remember

Letta · 2026

https://www.letta.com/blog/agent-memory/

Prompt caching.

Anthropic. · 2026 · Official documentation

https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching

Agent Skills Specification

Agent Skills · 2026

https://agentskills.io/specification

Agent Skills

Anthropic · 2026

https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview

Effective harnesses for long-running agents

Anthropic · 2025

https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents

Harness design for long-running application development

Anthropic · 2026

https://www.anthropic.com/engineering/harness-design-long-running-apps

1M context is now generally available for Opus 4.6 and Sonnet 4.6

Anthropic · 2026

https://claude.com/blog/1m-context-ga

LangGraph Memory Overview

LangChain · 2026

https://docs.langchain.com/oss/python/concepts/memory

Discussion

Questions and insights from fellow learners.

Discussion loads when you reach this section.