Glean 拾遗
Recent picks

3picks · chronological

11-14

The five primitives behind always-on agents

Always-on agents are mostly asleep: an event wakes a worker, a short run executes, state is written back, and the agent sleeps again. The post decomposes the surrounding architecture into five primitives. An event inbox (durable table + handler + worker) replaces letting each event source call the agent directly, avoiding competing runs and lost events on crash. Timers split into agent-set follow-ups and recurring schedules, stored separately and fired by a polling scheduler that writes into the inbox. Memory is a directory of files for user instructions, user notes, past messages and task progress, with the rule that memory only holds what cannot be looked up elsewhere. Permissions rely on a credential-injecting proxy, classifier-based auto mode, and deferred tool calls that end a run mid-call and resume it from a new event. An outbox with a dispatcher paces delivery and enables retries. The only hard number is a 78% per-task cost drop on a long-horizon coding benchmark versus 40% on typical workloads.

claude.com · 15 min · Agent Architecture · Agent Infrastructure · Agent-Memory
11-10

Choosing a Claude model: dial effort before you switch tiers

Anthropic's own guide to picking among Haiku 5.5, Sonnet 5.5, Opus 5.5 and Fable 5.2. The argument: adjust effort level before switching models, because a higher tier at a lower effort is often cheaper per finished task than a smaller model at max. Evidence is concrete — Opus 5.5 at high beat Fable 5.1 at max on Terminal-Bench 3.0 (58.9% vs 58.0%) using half the tokens; on FrontierCode 2.0 Fable 5.2 at high roughly matched Opus 5.5 at max (45.3% vs 45.5%) at about half the cost per task. On a SWE-bench Pro subset, running everything at low and re-running only failures at high reached roughly 97% for $0.17 per task, against 95.3% for $0.29 with everything at high. Also covers cache-read economics, preserved-thinking rules when swapping models, subagent YAML, and migration gotchas that return 400s. For engineers building agents or budgeting token spend.

claude.dev · 20 min · Claude · Cost Optimization · LLM
08-16

Maximizing the value of your Claude Code sessions

Claude Code bills tokens in two phases: prefill reads the whole request, decode generates output one token at a time, which is why output costs about 5x input. Prompt caching is automatic: shared prefixes are served at 0.1x, but switching /model, /effort, or fast mode, or running /compact, invalidates the cache and forces a full-price re-prefill. Session cost is determined by how many tokens enter the context, how many turns they stay, and how many contexts run in parallel. The guide offers concrete tactics: use @-mentions to avoid Read calls, put quiet flags for daily commands into CLAUDE.md, spill outputs over 30,000 characters to a file, use /rewind instead of /compact to trim dead ends, and offload noisy jobs to subagents (optionally pinned to haiku). Cache expiry is one hour on subscription and five minutes on API keys, extendable via ENABLE_PROMPT_CACHING_1H=1. Practical for heavy Claude Code users.

claude.com · 13 min · Claude Code · Context Engineering · Cost Optimization