Skip to content

coding-agents

2 posts with the tag “coding-agents”

Claude Fable 5.1 Ships: Cache Reads at $0.25 and Agent Work Gets 45% Cheaper

Claude Fable 5.1 Ships: Cache Reads at $0.25 and Agent Work Gets 45% Cheaper

Section titled “Claude Fable 5.1 Ships: Cache Reads at $0.25 and Agent Work Gets 45% Cheaper”

Anthropic shipped its next frontier coding model today. Claude Fable 5.1 is generally available on the Claude API, Amazon Web Services, Google Cloud, and Microsoft Azure (Anthropic, 2026). Input and output rates stay at $10 and $50 per million tokens, but cache reads drop to $0.25, a 75% cut (Finout, 2026). Anthropic’s price math: typical workloads cost about 25% less, and highly agentic work up to about 45% less (Anthropic, 2026). For teams whose agent bills are dominated by long, tool-heavy sessions, that is the number that changes the buy decision.

Anthropic calls Fable 5.1 and Mythos 5.1 “the world’s most advanced models for coding and knowledge work” (Anthropic, 2026). The published table shows the largest gains on agentic and scientific coding:

BenchmarkFable 5.1Fable 5Opus 5
Terminal-Bench-Science 0.152.6%24.7%29.0%
Terminal-Bench 4.055.8%42.0%52.3%
AutomationBench31.4%17.1%26.9%
OSWorld 2.0 (partial)77.9%72.9%75.4%
Humanity’s Last Exam (with tools)65.0%63.8%63.6%
CursorBench 3.2.073.4%70.5%70.0%

The science-coding jump is the standout: 52.6% versus 24.7% for Fable 5, more than double (Anthropic, 2026). Guardrails still clip some runs. On tasks where Anthropic’s safeguards intervened, Fable 5.1 and Fable 5 scored zero on OSWorld 2.0 (Anthropic, 2026).

The price cut is real, and it depends on your prompt structure

Section titled “The price cut is real, and it depends on your prompt structure”

Agent loops re-read the same context every turn. That is why the cache cut matters. Reads fell from $1.00 to $0.25 per million tokens, or 2.5% of the base input rate (Finout, 2026). A write-then-reuse cycle at one million tokens costs $12.75. Sending that million tokens fresh twice costs $20.00 (Finout, 2026).

Independent measurement adds a caveat. Artificial Analysis found Fable 5.1 at $3.76 per task on its Intelligence Index at max effort, about 20% more than Fable 5’s $3.14, because the model writes more output tokens to reach higher scores (Finout, 2026). Anthropic’s own cost model, measured over four weeks of August usage at default effort, shows the 25% typical savings (Anthropic, 2026). The difference is prompt structure. Static content up front, variable content at the end, and the cache does the rest.

Five effort levels give another lever. Fable 5.1 defaults to High in Claude Code and Medium in Claude Cowork and on claude.ai (Anthropic, 2026). At xhigh effort, Artificial Analysis measured a score of 65 at $2.72 per task, one point below the max-effort 66 at $3.76 (Finout, 2026). For the first time, Anthropic’s and OpenAI’s flagship reasoning models carry identical per-token pricing (Finout, 2026). Frontier vendor choice becomes a workload-fit question, not a price-card question.

The twin with fewer guardrails: Mythos 5.1 and EFS

Section titled “The twin with fewer guardrails: Mythos 5.1 and EFS”

Mythos 5.1 is the same model with more permissive safeguards for vetted teams. It reaches users through the Cyber Verification Program and the Life Sciences Verification Program, built in partnership with the US government (Anthropic, 2026). Access is limited to US organizations for now. Anthropic says Mythos 5.1 has the strongest cyber capabilities of any model it has released, with no critical-severity jailbreak found in testing that included external organizations and Gray Swan (Anthropic, 2026). Claude Security, the vulnerability scanner, now runs on Mythos 5.1 (Anthropic, 2026).

Enterprise Frontier Safeguards (EFS) change the data story. EFS stores customer data on customer-controlled cloud infrastructure, and human review defaults to the customer side (Anthropic, 2026). More than 100 customers helped design it. It rolls out in phases this fall across Claude Code, Claude Enterprise, the Claude Platform, Amazon Bedrock, and Google Cloud. Until EFS arrives, eligible customers can use Fable 5.1 with zero data retention (Anthropic, 2026).

Defensive security work gets easier. Fable 5.1 can now identify software vulnerabilities, and Claude Code users see about 60% fewer safeguard interventions per session (Anthropic, 2026). Dual-use tasks still redirect to Opus models: penetration testing, exploit generation, and binary-based vulnerability scanning (Anthropic, 2026).

The same week: Projects becomes a coordinator

Section titled “The same week: Projects becomes a coordinator”

Fable 5.1 ships the same week Anthropic rebuilt Claude Code Projects. A coordinator now scopes the request, delegates work to parallel threads, reviews outputs, and assembles the result (The New Stack, 2026). Each thread is a full Claude Code cloud session on its own branch and copy of the repository (The Verge, 2026). Threads draw from shared memory, split work into subagents, loops, and workflows, and overlapping changes surface as merge conflicts like any pull request (The Verge, 2026).

The trade-off is stated plainly. Projects reach usage limits faster, because every thread counts as a full session (The New Stack, 2026). Threads run in the cloud today, and support for running them on your machine is coming soon (ZDNET, 2026). The beta starts with select Pro and Max subscribers who use cloud sessions (ZDNET, 2026). Teams already running several agents should read this alongside the weekly-limit math.

  1. Structure for cache hits. Keep system instructions, tool schemas, and reference material static and up front. Variable content goes last. That is what turns the $0.25 cache rate into your biggest lever (Finout, 2026).

  2. Tune effort per task. The five effort levels span roughly 11x in output tokens. Reset defaults per workload instead of running everything at max (Finout, 2026).

  3. Assume parallel agents are the new normal. A coordinator that fans out five threads is five concurrent sessions against one usage plan (The New Stack, 2026).

  4. Keep dual-use security work on Opus. Vulnerability discovery is allowed on Fable 5.1. Exploitation-adjacent tasks redirect, so plan around it (Anthropic, 2026).

Fable 5.1 is GA today, priced for long agent runs, and paired with orchestration that treats parallel agents as the default. The model itself is not the whole story. The coordinated, cache-disciplined workflow around it decides whether the 45% saving shows up on your invoice (Anthropic, 2026). Point one real agent task at claude-fable-5-1, measure the cost per task, and let the numbers pick your default (Finout, 2026).

How Cline Engineers Context

Every AI coding tool wants your attention. Most of them are autocomplete with better marketing. Cline is a different class of tool. It is an open-source agent that reads your files, runs commands, and edits code without hand-holding (DeployHQ, 2026).

The interesting part is not the model. The interesting part is the context around the model. We mapped the public codebase end to end (github.com/cline/cline). This post walks the full architecture, the harness-to-model exchange, and why the design works.

Cline is a loop. The harness builds a prompt, sends it to a model, receives a streaming answer, executes any tool calls, appends the results, and repeats. The system prompt is rebuilt from parts on every turn, not stored as one document.

┌──────────────────────────── HARNESS ────────────────────────────┐
│ │
│ PromptRegistry (singleton) │
│ ├─ loadVariants() → 12 model variants │
│ │ each: { config, overrides, template, matcher } │
│ └─ loadComponents() → 13 component functions (fixed order) │
│ │
│ getSystemPrompt(context) │
│ ├─ getModelFamily(context) → iterate matchers, first wins │
│ └─ PromptBuilder(variant, context) │
│ ├─ buildComponents() → sections[] (each gated) │
│ ├─ preparePlaceholders() → {{CWD}}, {{IDE_NAME}}... │
│ ├─ TemplateEngine.resolve() │
│ └─ postProcess() → final prompt (~500 lines) │
└──────────────────────────────┬─────────────────────────────────┘
┌─────────────────────────────┐
│ API Transform Layer │
│ ANTHROPIC_CHAT, GEMINI, │
│ OPENAI_CHAT, R1, RESPONSES │
│ internal format → wire │
└──────────────┬──────────────┘
┌──────────────────┐
│ THE MODEL │
└────────┬─────────┘
streaming response stream
text / tools / thinking / usage
┌─────────────────────────────┐
│ Transform back to internal │
│ format (content blocks) │
└──────────────┬──────────────┘
┌─────────────────────────────┐
│ Harness executes tool │
│ call → result appended │
│ to conversation history │
│ ContextManager: │
│ dedup → truncate if over │
│ token budget │
└──────────────┬──────────────┘
└── loop back to the API call

The loop is the product. Every piece below exists to make that loop cheap, sharp, and crash-free.

Cline does not ship one giant system prompt. It ships a registry. The registry holds 12 model variants and 13 component functions. Each component covers one concern, and the builder runs them in a fixed order (source):

1 AGENT_ROLE always rendered
2 SYSTEM_INFO always — {{PLATFORM}}, {{CURRENT_DATE}}, {{CWD}}
3 MCP only if MCP servers are connected
4 USER_INSTRUCTIONS only if .clinerules / .cursorrules exist
5 TOOL_USE always — 24 tools, each individually gated
6 EDITING_FILES always
7 CAPABILITIES always — browser / web / MCP placeholders resolved
8 SKILLS only if skills are loaded
9 RULES always — yolo / browser / CLI branches resolved
10 OBJECTIVE always — yolo branch selected
11 ACT_VS_PLAN always — yolo branch selected
12 FEEDBACK only if focus chain is enabled
13 TASK_PROGRESS varies — focus chain / variant template gating

Order matters. Role comes first so the model knows who it is before it reads anything else. Task progress comes last because it is the least stable content. A real Claude-class snapshot lands around 500 lines and 8,000 characters.

Principle 1: Gate every section on real context

Section titled “Principle 1: Gate every section on real context”

Each component receives the session state and decides whether to render. No MCP servers connected? The MCP section disappears. No skills loaded? The skills section disappears. Browser use disabled? The browser rules vanish. YOLO mode off? The objective stays on the conservative branch.

The same gating runs at the tool level. Every tool declares a contextRequirements check. A false return hides the tool from the model completely:

browser_action → browser configured + enabled
use_mcp_tool → MCP hub exists
access_mcp_resource → MCP hub exists
ask_followup_question → NOT in yolo mode
new_task → NOT in yolo mode
use_subagents → subagents on, not already a subagent
focus_chain → focus chain flag on
use_skill → skills loaded
generate_explanation → NOT the CLI
web_search → MCP has no web search tool
execute_command → always
read_file → always
write_to_file → always
replace_in_file → always
search_files → always
attempt_completion → always

This is a compile-time filter on the tool list, not a runtime guard. A tool that fails its check never reaches the prompt. The model cannot call what it cannot see. That keeps the prompt lean and stops the model from inventing capabilities.

The registry holds 12 variants, one per model family. A matcher walks the variants and picks the first match. No match? The generic variant applies.

Tool calling is where the variants differ most:

Native tool calling (GPT-5, GPT-5.1, Gemini 3):
structured JSON tool definitions passed as a separate API parameter
model returns tool_calls natively
XML tool calling (Claude, Hermes, Generic, GLM, Trinity):
tools described as XML inside the system prompt
model answers with XML tool call syntax

Same behavior, correct dialect per model. Claude-class prompts run ~500 lines with XML tools. Hermes and Gemini variants run leaner at ~400 lines. The content is the same. The encoding follows the model.

Principle 3: Treat tokens like a hard budget

Section titled “Principle 3: Treat tokens like a hard budget”

A context window is a finite resource. Cline does not hope it fits. It computes the budget per model:

ModelRaw windowSafety bufferEffective window
DeepSeek64,00027,00037,000
Most models128,00030,00098,000
Claude200,00040,000160,000

The safety buffer reserves room for tool results and the next user message. When the history passes the effective window, the ContextManager acts in two phases:

Phase 1 — dedup:
scan user messages for repeated file reads
replace duplicates with a duplicate-read notice
if savings ≥ 30% → stop here, keep everything else
Phase 2 — truncation (only if dedup was not enough):
remove last 2 message pairs, or half, or a quarter
always keep the first user-assistant pair
inject a truncation notice into the first assistant message
serialize the change log to disk (undo + crash recovery)

The change log is a durable JSON map. A checkpoint restore can undo every truncation after a timestamp. A crash reinitializes from the saved state. The budget is managed like a database transaction, not a best-effort trim.

Principle 4: Inject context at three layers

Section titled “Principle 4: Inject context at three layers”

Context does not only live in the system prompt. Cline injects it in three places:

  1. The system prompt appendix carries user custom instructions, cline rules, cursor rules, and preferred language.
  2. Conversation history is mutated before send. Duplicates are removed and the budget is enforced in place.
  3. The next user message warns about files that changed outside the agent.

Each layer has one job. The appendix sets standing rules. History management keeps the budget. File warnings keep the model honest about drift.

The exchange: what the harness picks up, sends, and receives

Section titled “The exchange: what the harness picks up, sends, and receives”

This is the part most write-ups skip. Here is one full turn, item by item.

WHAT THE HARNESS PICKS UP BEFORE THE API CALL
CWD, platform, IDE, current date → resolved into placeholders
.clinerules / .cursorrules files → USER_INSTRUCTIONS section
MCP hub state → MCP section + MCP tools
loaded skills → SKILLS section + use_skill tool
browser configuration → browser_action tool + capabilities
yolo mode toggle → hides ask_followup_question / new_task
focus chain flag → FEEDBACK section + task_progress
recently modified files → file-change warning (next user msg)
conversation history → deduped, budget-checked, truncated
WHAT GOES OVER THE WIRE (the request)
system: the assembled ~500-line prompt, sections already gated
tools: JSON definitions (native models) or XML (everyone else)
messages: deduped + truncated history
cache: cache_control on the system prompt + last 2 user messages
(Anthropic — 90% discount on cached input tokens)

The transform layer is the last step before the wire. It speaks six canonical API formats: Anthropic, Gemini, OpenAI chat, DeepSeek R1, OpenAI Responses, and Responses over WebSocket. Anthropic content blocks are the internal lingua franca. Every converter translates the internal format to the provider’s wire format, then translates the response back.

WHAT COMES BACK (the streaming response)
text → TextDelta model prose, token by token
tools → ToolCall[] tool invocations the model wants
thinking → ThinkingDelta chain-of-thought, where supported
usage → TokenUsage token accounting per call
WHAT THE HARNESS DOES WITH IT
tool calls execute for real (read_file, execute_command, ...)
results append to history as tool_result content blocks
budget re-checked → dedup or truncate if needed
loop continues until the model returns attempt_completion

The response is not one JSON blob. It is a live stream of four event types, normalized back to content blocks as they arrive. Tool calls are executed immediately. Their results feed the next turn. That is the whole agent loop, and every layer above exists to keep that loop inside its token budget.

Four properties do the heavy lifting:

  1. Gating is compile-time, not behavioral. The model only sees tools and sections its session actually supports. A lean prompt is a cheap prompt, and a cheap prompt is a fast one. It also removes the failure mode where a model hallucinates a tool that does not exist.

  2. The budget is enforced, not hoped for. Dedup first, truncate second, keep the first pair, log every mutation. Long sessions survive because the history is actively managed, and the durable change log makes the management reversible.

  3. One dialect per model. XML and JSON tool calling are different encodings of the same contract. Shipping both means one harness serves every major provider without degrading the ones that need native calls.

  4. Caching is applied where reuse is real. The system prompt and the last two user messages carry cache markers. On Anthropic that is a 90 percent discount on cached input tokens. The 500-line prompt stops being a cost center and becomes a fixed cost per session.

  1. Build prompts from components. A prompt assembled from single-concern parts is easier to test and cheaper to run.
  2. Gate every section on real context. If the session lacks a thing, the section for that thing should not render.
  3. Keep a variant per model family. Models differ in dialect, not in intent. Ship both.
  4. Budget tokens with a safety margin. Reserve room for tool results. Dedupe before you delete.
  5. Inject context at the layer where it belongs. Standing rules go in the system prompt. Budget lives in history. Drift warnings go in the message.

The model is the commodity. The context is the product. Cline understands that, and the architecture shows it.