AWS Strands Harness Cuts Agent Costs 77% vs Claude Code by Optimizing Context, Not Model

AWS open-sourced Strands Harness, a pre-assembled agent runtime that decouples the model from the execution system; benchmarks show using the same Claude Fable 5 model, Strands achieves 77% lower cost and higher accuracy than Claude Code by optimizing context management, prompt caching, and layered memory, proving harness design critically impacts agent performance.

DataFunSummit
DataFunSummit
DataFunSummit
AWS Strands Harness Cuts Agent Costs 77% vs Claude Code by Optimizing Context, Not Model

Benchmark: Same Model, Vastly Different Cost and Accuracy

AWS ran a harness benchmark across six suites (ALFWorld, ContextBench, GAIA, WebShop, τ³-bench, Terminal-Bench 2.1) using EC2 distributed infrastructure managed by Harbor. All systems used the identical underlying model — Claude Fable 5 — across 89 trials each. The results:

Strands Harness : $56.29 total cost, accuracy 69.7

oh-my-pi : $86.83, accuracy 69.7

OpenCode : $73.42, accuracy 66.3

Claude Code : $248.05, accuracy 61.8

DeepSeek Harness : $40.30, accuracy 59.5

Strands reduces cost ~77% versus Claude Code while improving accuracy by 7.9 points. DeepSeek Harness is cheaper still but sacrifices accuracy. AWS notes the data is self-reported; a full paper is not yet public, so it should not be treated as an independent benchmark conclusion. However, it surfaces a key insight: agent performance is increasingly determined by the harness, not just the model.

How Strands Compresses Context: 1500-Token Truncation and 85% Compaction

AWS attributes the token efficiency to default-enabled Context Management and Prompt Caching. Two rules are central:

Tool Result Offloading at ~1500 tokens : Long tool outputs (shell logs, search results, test reports) are the main context bloat. Strands' ContextManager truncates results exceeding ~1500 tokens, keeping only head/tail previews in the active context. The full output is written to a Stash and can be retrieved via retrieve_context when needed. This differs from traditional truncation, which discards information; Strands moves it to external storage, creating a tiered context.

Compaction at 85% context utilization : When the context window reaches 85% capacity, a summarization strategy runs, compressing older messages while preserving the most recent ones (e.g., last 4 messages). If overflow persists, Context Recovery continues execution inside the agent loop instead of aborting with a context-length error.

These rules compound over many turns. For example, a tool returning 4000 tokens over 20 calls would accumulate 80,000 tokens of tool output if retained naively. By offloading processed results, Strands avoids repeated input-token charges on every subsequent model call.

Layered Storage: Context Window, Session, and Long-Term Memory

Strands separates three storage layers, analogous to traditional compute hierarchy:

Context Window ≈ working memory — only what the model currently sees, kept lean via offloading and compaction.

Session ≈ task state — full conversation state persisted to disk ( ./.agent/sessions), enabling resume after process restart with the same Session ID.

Long-Term Memory (MemoryManager) — cross-session knowledge with three capabilities: Recall (search history), Injection (prepend relevant memories to prompt), and Extraction (write new durable knowledge). Recall and Injection are enabled by default; Extraction requires explicit opt-in.

This design prevents dumping all history, tool returns, preferences, and task state into the context window, which would increase cost, latency, and attention dilution.

Skills Use Progressive Disclosure

Instead of loading all skill instructions into the system prompt at startup, Strands loads only skill names and descriptions. Full instructions are fetched via tool call when the model decides they are needed. This mirrors the tool-result offloading philosophy: don't pre-load everything that might be used.

Pre-Assembled Harness with Sensible Defaults

create_harness()

includes shell, read, write, edit, web_fetch, web_search, programmatic_tool_caller, subagent, plus plugins for todos and environment. Defaults enable long-term memory, prompt caching, context manager, and MCP server configuration. A Generalist Subagent handles open-ended subtasks, tracked via Todos. Even the system prompt is part of the harness defaults, enforcing exploration before modification, confirmation for irreversible actions, and re-verification before task completion.

Prompt Caching Makes Cost More Than Token Price

Strands sets caching to auto, leveraging provider-level prompt caching (Bedrock, Anthropic) for system prompts, tool definitions, and stable message prefixes. Because caching capabilities differ across providers, the model interface cannot fully abstract away underlying API differences. The effective cost formula becomes:

Effective Context × Call Count − Cache Hits − Offloaded History + Compaction Cost + Subagent/Tool Call Cost

Thus two harnesses with the same model can yield wildly different bills.

Model × Harness × Workload: The New Evaluation Unit

Strands standardizes the Model Provider interface (streaming, tool calling, structured output) across Bedrock, Anthropic, OpenAI, Google, Ollama, LiteLLM, Mistral, Llama API, llama.cpp, Vercel, etc. The same harness can run on any Linux-container platform (Cloudflare Containers, Azure Container Apps, Google Cloud Run, Amazon ECS, Bedrock AgentCore, Modal). This decouples model from harness, and harness from cloud.

However, provider capabilities still differ (prompt caching, tool schema support, reasoning effort, context window, parallel tool calls). Swapping models does not guarantee unchanged performance. AWS's own benchmark demonstrates that Model × Harness is a combined variable : the harness controls what the model sees, retains, and when it calls tools; the model determines how well it uses that information. Therefore, production evaluation should test Model × Harness × Workload — measuring cost, success rate, and step count on real workloads — rather than relying on model leaderboards alone.

Conclusion

Strands Harness represents a shift: agent scaling is moving from the model itself to the surrounding runtime system. The model sets the capability ceiling, but context, memory, tools, skills, cache, and execution loops determine how much of that ceiling is realized. AWS aims to fix the "body" so developers can keep swapping "brains." Caveats remain: the benchmark is AWS-internal, DeepSeek Harness shows a cheaper-but-less-accurate trade-off, and independent verification is pending.

References

Strands Agents, Introducing Strands harness: frontier performance with 28% lower token cost , Sep 21, 2026.

Strands Agents Documentation: Strands harness / Configuration reference / Context Management / Memory / Skills.

The New Stack, AWS open-sources an AI agent it says is 45% cheaper than Claude Code and Codex , Sep 21, 2026.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AWSbenchmarkingContext ManagementAgent evaluationPrompt CachingModel AbstractionAgent runtimeStrands Harness
DataFunSummit
Written by

DataFunSummit

Official account of the DataFun community, dedicated to sharing big data and AI industry summit news and speaker talks, with regular downloadable resource packs.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.