AWS released Strands Harness on September 21 — an open-source agent runtime that starts in one line, runs on any cloud or locally, and claims to use 28% fewer tokens than comparable frameworks. Apache 2.0, no vendor lock-in. The benchmark numbers come with real caveats, but the context management approach underneath is worth understanding on its own terms.
Why Token Efficiency Actually Matters Here
Most agent frameworks leave you to manage context manually. Once a task runs for more than a few turns, you’re re-sending tool output that hasn’t changed and conversation history that’s no longer relevant. Strands automates three mechanisms that cut this waste:
- Tool result truncation: Outputs over ~1,500 tokens get trimmed. Long bash outputs, file reads, and API responses stop consuming the full context window.
- Context compaction: When the conversation hits 85% of the model’s context limit, the harness compacts older turns automatically.
- Overflow recovery: If the window overflows anyway, the harness recovers without crashing the agent loop.
AWS engineer Marc Brooker described this as “one of the hardest problems” in building long-running agents. It’s a real failure mode — agents that degrade mid-task because they ran out of clean context. Strands handles it by default, which is not something you get from manually wiring up most frameworks.
Getting Started
Install via pip or npm:
pip install strands-harness # Python 3.10+
npm install @strands-agents/harness # Node.js 20+
npm install -g @strands-agents/cli # optional CLI
Python quickstart with Anthropic:
from strands_harness import create_harness
agent = create_harness(model="anthropic/claude-sonnet-5")
agent("Research the three most common REST API versioning strategies, compare tradeoffs, and write a recommendation to api-versioning.md")
TypeScript with OpenAI:
import { createHarness } from "@strands-agents/harness"
const agent = await createHarness({ model: "openai/gpt-5.4" })
await agent.invoke("Research REST API versioning strategies...")
Session persistence — memory across runs without extra infrastructure:
agent = create_harness(session={"id": "api-design"})
agent("Which of those strategies would you pick for an API with external customers?")
Provider setup is one environment variable:
export ANTHROPIC_API_KEY=your_key # Anthropic
export OPENAI_API_KEY=your_key # OpenAI
export GEMINI_API_KEY=your_key # Google
# Bedrock: use AWS credentials or IAM role (zero-config on EC2)
# Ollama: run ollama serve + ollama pull llama3.1
Supported providers: Amazon Bedrock (default), Anthropic, OpenAI, Google Gemini, Ollama (local), and LiteLLM. Deployment targets include Amazon ECS, Google Cloud Run, Cloudflare Containers, and any Linux container runtime.
The CLI Prototype-to-Export Workflow
The most underrated feature is the CLI. Describe what the agent should do in natural language, test it against your model provider, and run /export to get production-ready Python or TypeScript. No code required to validate an idea. For teams where the person who understands the task is not the one writing the code, this is a real workflow improvement — not just a demo feature.
About Those Benchmark Numbers
AWS reported Strands Harness at 69.7 on Terminal-Bench 2.1 with a cost of $56.29, versus Claude Code at 61.8 and $248.05. That’s a 77% cost reduction on comparable tasks, with the 28% token reduction figure coming from six additional benchmark comparisons.
Here’s the problem: AWS benchmarked against coding-specific agents — Claude Code, OpenAI Codex, OpenCode, DeepSeek Harness — while positioning Strands as general-purpose. Comparing a general-purpose harness against domain-specialized tools does not produce clean signal. Terminal-Bench maintainers have since released v4.0, superseding the version used. No independent validation exists yet.
The context compaction mechanisms are real and inspectable in the open-source code. The specific percentages are vendor-reported against AWS’s own competing framework. Treat them as directionally interesting, not production-decision data.
Should You Use It?
If you’re building multi-step agents that need to run anywhere — local, ECS, Cloud Run, Cloudflare Containers — and want automatic context management without extra infrastructure, Strands Harness is worth evaluating. The quickstart takes five minutes and Apache 2.0 means no usage restrictions.
If you’re already running Claude Code or Cursor for coding-specific workflows, the benchmark comparison does not apply to your use case. The framework is v0.1.0 — wait for independent benchmarks on general tasks before making switching decisions based on numbers AWS measured against their own competing tools.













