techlist.io

Claude Agent Sdk

3 posts

Anthropic2026-03-245 min readCurated summary

Harness design for long-running apps

# Anthropic's Three-Agent Harness for Long-Running Autonomous Coding and Frontend Design Prithvi Rajasekaran of Anthropic's Labs team describes a multi-agent approach that improves Claude's output on two hard problems: subjective frontend design and long autonomous full-stack coding. The core idea is to separate the agent doing the work from an evaluator agent that judges it, borrowing the generator-discriminator structure of GANs. A standalone evaluator, tuned to be skeptical, gives the generator concrete feedback to iterate against, which self-evaluation alone cannot provide. The post also shows that harness components should be continually stress-tested as models improve, since some scaffolding becomes unnecessary over time. ## Why Naive Implementations Fall Short - Models lose coherence on long tasks as the context window fills, and some (notably Claude Sonnet 4.5) show "context anxiety," wrapping up work early as they near what they believe is their limit. - Context resets, which clear the window and hand off state through a structured artifact, address this more fully than compaction, which summarizes history in place and leaves the anxiety intact. Resets add orchestration complexity, token overhead, and latency. - Agents reliably overpraise their own work, especially on subjective tasks like design where no binary test exists. - A separate evaluator is still an LLM and tends to be lenient, but tuning a standalone evaluator to be skeptical is far more tractable than making a generator self-critical. ## Making Subjective Design Quality Gradable - The team wrote four grading criteria given to both generator and evaluator: design quality, originality, craft, and functionality. Design quality and originality were weighted more heavily, since Claude already handled craft and functionality well by default. The originality criterion explicitly penalized "AI slop" patterns such as purple gradients over white cards. - The evaluator was calibrated with few-shot examples and detailed score breakdowns to align with the author's taste and reduce score drift. - The loop ran on the Claude Agent SDK. The evaluator used the Playwright MCP to navigate the live page, screenshot it, score each criterion, and write a critique. The generator chose each iteration to either refine its direction or pivot aesthetically. - Runs took 5 to 15 iterations and up to four hours. Scores generally improved before plateauing, and the criteria wording itself steered the output: even the first iteration beat a no-prompt baseline. - In one run, a Dutch museum site moved on iteration ten from a polished dark landing page to a spatial 3D gallery built with CSS perspective and doorway-based navigation. ## Scaling to Full-Stack Coding - **Architecture:** Three agents. A planner expands a 1–4 sentence prompt into a product spec, staying high-level to avoid cascading errors from wrong technical details. A generator works in sprints on a React, Vite, FastAPI, and SQLite (later PostgreSQL) stack and uses git. An evaluator tests the running app with Playwright. - **Sprint contracts:** Before each sprint, generator and evaluator negotiate what "done" means and how it will be tested. Communication happens through files. - **Evaluation:** Each criterion has a hard threshold. Failing any one fails the sprint and returns detailed feedback. Sprint 3 alone had 27 criteria for the level editor. - **Tuning the QA agent:** Out of the box, Claude was a poor QA agent. It found real issues, then talked itself into approving them, and tested superficially. The team tuned the evaluator's prompt over several rounds by comparing its judgments to their own. - **Cost comparison (retro game maker, Opus 4.5):** A solo run took 20 minutes and $9 but produced an app where the central feature did not work. The full harness took 6 hours and $200, producing a richer app with a functional play mode, though with physics and level-design rough edges. ## Simplifying the Harness - Every harness component encodes an assumption about what the model cannot do alone, and those assumptions go stale as models improve. The author follows the principle from "Building Effective Agents": use the simplest solution, adding complexity only when needed. - A first attempt to cut the harness radically failed to match the original performance and made it unclear which pieces were load-bearing. The team then removed one component at a time to measure its impact. - **Sprint construct removed:** Opus 4.6 could sustain longer coherent work, so the sprint decomposition was dropped. The planner stayed, since without it the generator under-scoped. The evaluator moved to a single pass at the end. - **Evaluator as a conditional:** The evaluator is worth its cost only for tasks beyond what the current model reliably does alone. On 4.6 that boundary moved outward, so the evaluator was unnecessary for some parts of a build but still helped at the edges. - The team also added prompting so the generator built proper tool-driven agents inside the apps, since this knowledge was thinly covered in training data. ## Results and Limits - A Digital Audio Workstation built with the simplified V2 harness took about 4 hours and $124.70. The build ran coherently for over two hours without sprints. - The QA agent still caught real gaps across rounds: clips could not be dragged, instrument and effect UIs were display-only, audio recording was a stub, and the EQ was numeric rather than graphical. - The final app had a working arrangement view, mixer, and transport, and the agent could compose a short snippet end to end through tools. The author acknowledges it is far from professional-grade, and that Claude cannot hear, which limits musical judgment in QA. ## Takeaways The author argues that as models improve, some scaffolding becomes obsolete, but the space of useful harness designs does not shrink; it shifts toward new combinations. Practical advice includes testing against the target model, reading its traces on realistic problems, decomposing complex tasks into specialized agents where useful, and re-examining the harness whenever a new model ships by removing components that no longer carry weight and adding new ones that unlock capabilities.

Anthropic2025-11-264 min readCurated summary

Effective harnesses for long-running agents

# Anthropic's Approach to Long-Running Agents Across Context Windows Long-running agents struggle because each new session starts with no memory of prior work, and compaction alone does not keep progress consistent across many context windows. Anthropic addresses this with a two-part harness: an initializer agent that sets up the environment on the first run, and a coding agent that makes incremental progress each session while leaving clean, documented artifacts for the next one. The approach was tested by building a claude.ai clone with the Claude Agent SDK, and it substantially reduced the failure modes that plague multi-session development. ## Why Long-Running Agents Fail - Compaction preserves some context, but it does not reliably pass clear instructions to the next agent. - Agents tend to try to do too much at once, often running out of context mid-implementation and leaving a feature half-built and undocumented. - Later agents may look at partial progress and declare the whole project finished too early. - Without a clean handoff, each new session must spend time guessing what happened and getting the basic app working again. ## The Two-Part Solution - **Initializer agent:** The first session uses a specialized prompt to create an `init.sh` script for starting the dev server, a `claude-progress.txt` log of agent activity, and an initial git commit showing the added files. - **Coding agent:** Every later session makes incremental progress on one feature, then leaves structured updates through git commits and progress notes. - The two agents differ only in their initial user prompt. The system prompt, tools, and harness are otherwise identical. ## Environment Scaffolding ### Feature List - The initializer expands the user's prompt into a comprehensive JSON feature list. The claude.ai clone example produced over 200 features, each with a category, description, verification steps, and a `passes` field. - All features start as failing, giving later agents a clear picture of full functionality. - Coding agents may only change the `passes` status. The prompt forbids removing or editing tests. - JSON was chosen over Markdown because the model is less likely to inappropriately overwrite it. ### Incremental Progress and Git - Coding agents work on one feature at a time, which curbs the tendency to one-shot the app. - Agents commit to git with descriptive messages and update the progress file, so bad changes can be reverted and working states recovered. - This removes the need for each new session to reconstruct what happened. ### Testing - Claude often marked features complete after unit tests or curl checks, without confirming they worked end-to-end. - Explicitly prompting it to use browser automation (Puppeteer MCP) and test as a human user would markedly improved results, exposing bugs not visible from the code alone. - Remaining limitations include weak vision and an inability to see browser-native alert modals, which made features relying on them buggier. ## Getting Up to Speed Each coding session starts with a consistent routine: - Run `pwd` to confirm the working directory. - Read the git log and progress file to see recent work. - Read the feature list and select the highest-priority unfinished feature. - Run `init.sh` to start the dev server and perform a basic end-to-end check, such as creating a chat and receiving a response. This catches any broken state left by the previous session before new work begins. ## Failure Modes and Mitigations - **Premature victory:** The initializer writes a feature list; the coding agent works on one feature and verifies it. - **Buggy or undocumented handoffs:** The initializer creates a git repo and progress notes; the coding agent reads them first and ends each session with a commit and update. - **Premature completion marks:** Agents self-verify every feature before marking it passing. - **Time spent figuring out how to run the app:** The initializer writes `init.sh`, which the coding agent runs at the start of each session. ## Open Questions and Future Work - It is unclear whether a single general-purpose coding agent performs best, or whether specialized agents for testing, QA, or code cleanup would do better. - The demo targets full-stack web development. Anthropic hopes to generalize these lessons to fields such as scientific research and financial modeling.

Anthropic2025-10-164 min readCurated summary

Equipping agents with Agent Skills

# Agent Skills: Packaging Procedural Knowledge for Agents Anthropic introduces Agent Skills, organized folders of instructions, scripts, and resources that agents can discover and load on demand to perform specialized tasks. The core argument is that as general-purpose agents gain access to full computing environments, they need a composable, scalable, and portable way to acquire domain expertise, rather than relying on fragmented, custom-built agents for each use case. Skills are published as an open standard and are supported across Claude.ai, Claude Code, the Claude Agent SDK, and the Claude Developer Platform. ## Anatomy of a Skill - At its simplest, a skill is a directory containing a `SKILL.md` file. - The file begins with YAML frontmatter that includes two required fields, `name` and `description`. - At startup, the agent preloads the name and description of every installed skill into its system prompt, so it knows when each skill applies without loading the full content. - If a skill seems relevant, Claude reads the full `SKILL.md` into context. - Complex skills can bundle additional files (for example, `reference.md` or `forms.md`) that `SKILL.md` references by name. Claude loads these only when needed. - The PDF skill used as the example keeps form-filling instructions in a separate file, so the core skill stays lean. ## Progressive Disclosure - Skills load information in levels: metadata first, then the core instructions, then linked files as needed. This works like a manual with a table of contents, chapters, and an appendix. - Agents with filesystem and code execution access don't need to load an entire skill into context, so the amount of material a skill can contain is effectively unbounded. ## Skills and the Context Window - The context starts with the system prompt, the metadata for installed skills, and the user's message. - When a request matches a skill, Claude uses a Bash tool to read that skill's `SKILL.md`. - Claude then decides whether to read any bundled files, such as `forms.md`, before completing the task. ## Executable Code in Skills - Skills can include scripts that Claude runs as tools. - Code suits operations that LLMs handle poorly or expensively, such as sorting or deterministic processing. Running a script is also consistent and repeatable. - The PDF skill includes a Python script that extracts form fields from a PDF. Claude can run it without loading the script or the PDF into context. ## Developing and Evaluating Skills - **Start with evaluation:** Run agents on representative tasks, find where they struggle, and build skills to close those gaps incrementally. - **Structure for scale:** Split large `SKILL.md` files into referenced files, keep rarely combined paths separate to save tokens, and make clear whether scripts should be executed or read. - **Think from Claude's perspective:** Observe how Claude uses skills in practice. The `name` and `description` fields matter most, since Claude uses them to decide whether to trigger a skill. - **Iterate with Claude:** Have Claude capture successful approaches and common mistakes into the skill, and ask it to self-reflect when it goes off track. ## Security Considerations - Malicious skills can introduce vulnerabilities or direct Claude to exfiltrate data or take unintended actions. - Install skills only from trusted sources. For less-trusted skills, audit bundled files, especially dependencies, scripts, and instructions that connect to external networks. ## Looking Ahead - Anthropic plans to add features covering the full skill lifecycle: creating, editing, discovering, sharing, and using skills. - Skills may complement Model Context Protocol (MCP) servers by teaching agents multi-step workflows that involve external tools. - The longer-term goal is for agents to create, edit, and evaluate their own skills, codifying their behavior into reusable capabilities. Skills are intentionally simple in concept and format, which makes it easier for organizations, developers, and end users to build customized agents. Developers can start with the Skills docs and cookbook.