techlist.io

Anthropic/Git

3 posts

Anthropic2026-10-136 min readCurated summary

Redesigning source control at Anthropic

# Scion: Anthropic's In-House Source Control for Agent-Scale Development Anthropic built Scion, an in-house version control system, to replace git for its monorepo after AI coding tools pushed merge volume past what git could handle. Merges grew from about 2,500 per day in May 2026 to over 30,000 per day by September, and the monorepo's main branch history alone is nearly 100 GB. The team migrated fully from git in five months. Their core argument is that git's offline-first, fully replicated design fits poorly when nearly every client is an always-online agent or CI job, and that a server-centric design can scale far more cheaply. ## Why Git Stopped Fitting - The main branch history is almost 100 GB, and a compressed working copy exceeds 25 GB. - CI and research jobs perform about 25 million checkouts per day. Naively fetched, that would be over 600 PB of git traffic daily. - Standard workarounds (shallow clones, sparse checkouts, promisor remotes, blob-stored seeds) helped, but Anthropic ran several hundred internal git mirrors at peak. Seeds drifted from the tip of main between refreshes, and maintaining history-dependent operations like diff and blame on partial clones grew harder. ## Principles for Agent-Scale Source Control The team designed around five principles that depart from git's model: - **Clients are always online.** Clients fetch data on demand from a reachable server instead of holding complete copies. - **Client-server asymmetry.** The server handles history, blame, commit creation, merges, and rebases. The client keeps a bounded object cache, lays out files, and watches the filesystem, so it needs far less local data. - **Source control as an API.** Queries that CI jobs and tools need, like "who last changed this line" or "how are these commits related," are exposed programmatically, so many jobs need no local repository. Automated bisect and revert pipelines depend on this. - **Horizontal scalability.** No full copy of the repo exists anywhere, even on the server. There are no packfiles, so no repository maintenance is required. - **Cheap, lock-free commits.** Commits, rebases, and merges happen server-side, and their cost scales with the size of the change rather than the repo. Refs are discouraged outside main and release branches, since global state that every server must agree on becomes a scaling problem. - **Optional, sparse working copies.** Many CI diffs and writes run via API without checkouts. When files are needed, sparse and virtualized checkouts materialize only what the client reads. ## How Scion Works ### Changesets and Derived Data - The unit of work is a "changeset," an entry in a write-ahead log. Instead of a pointer to a tree, it stores the list of files changed relative to its first parent, plus content-addressed pointers to compressed blobs. - Creating changesets requires no packfiles, locking, cross-server coordination, or ref movement. Refs, when used, are a compare-and-swap on a single Spanner row. - Queries like blame, path history, and commit-graph ancestry rely on "derived data," computed recursively from parent values through one generic mechanism. Each derived data type can be computed eagerly or deferred, and because clients never see these internals, the team can change them without touching the client. ### Serving Layers - Scion servers are stateless and horizontally scalable. All data is content-addressed and immutable, so any server can cache it without coordination. - The client, `scn`, uses a negotiation protocol that asks only for trees and blobs it wants, walking down from a root tree and requesting missing objects recursively. There is no multi-gigabyte packfile, so transfers are efficient and resumable. Sparse and virtual checkouts need no special handling because the client simply doesn't request unwanted trees. - A three-tier topology is strictly enforced to isolate failures: `scion-daemon` on each node (storing objects for the whole node, refreshed from a periodic snapshot), regional `scion-cache` servers that stream objects from memory, and authoritative `scion-server`s that read from Spanner or cloud storage on a cache miss. - All three tiers respond to the same RPCs, so clients don't need to know the topology. ### Results - Scion's CPU and memory footprint is about 200x smaller than the previous git mirror infrastructure. - CI and research checkouts dropped from minutes to seconds, and CI alone gained 25% in CPU capacity. - Each tier sustains a cache hit rate above 99% and holds no long-lived state. ## Lessons From the Build - **Small teams can move fast.** Seven engineers built Scion, Antique (the code review tool), and several related systems, and completed the migration in five months while merge volume grew tenfold. - **Engineers shift from writing code to setting constraints.** Claude outperformed the engineers at writing code, but the team's role was to supply system-level judgment and say "no" when agents violated architectural constraints. Examples include brute-forcing merge times by scanning the commit log instead of querying the review tool, and over-defensive validation driven by adversarial review. Reviewers now evaluate change intent rather than every line. - **Testing and optimization improved.** Claude helped build hermetic simulations of infrastructure interactions, fuzzing, and rate limiting, and found optimizations, such as an ancestry-query fix that bypassed an index, that would otherwise have taken experts days. - **Monorepo security was built in.** Scion supports per-directory permissions, and Antique can express semantic approval rules, such as separating comment-only changes from sensitive logic changes. - **Operations gained "superfan" agents.** Claude instances are dedicated to watching individual components through telemetry and logs. They catch subtle issues that threshold alerts miss. - **Human-scale workflows need rethinking.** A traditional merge queue with a global lock doesn't work at this volume. Anthropic relies on post-merge and pre-deploy testing instead, accepting that concurrent changes can conflict and relying on Claude to fix them quickly. ## Practical Takeaway Anthropic does not recommend that most organizations adopt Scion, which is highly bespoke and would require replacing the entire development toolchain. The more transferable lesson is architectural: git servers don't have to mirror git clients, and server-side RPCs, content-addressed immutable data, and strictly tiered caching can meaningfully improve scalability. The team plans to share these ideas so the git ecosystem can adopt the server-side techniques without abandoning git's overall model.

Anthropic2026-02-055 min readCurated summary

Building a C compiler with parallel Claudes

# Enabling Long-Running Claudes with Agent Teams Nicholas Carlini, a researcher on Anthropic's Safeguards team, describes "agent teams," a setup where multiple Claude instances work in parallel on a shared codebase without human intervention. To test it, he tasked 16 agents with writing a Rust-based C compiler from scratch that could build the Linux kernel. Across nearly 2,000 Claude Code sessions and about $20,000 in API costs, the team produced a 100,000-line compiler that builds Linux 6.9 on x86, ARM, and RISC-V. The post's main lesson is that the work shifts from writing code to designing the environment (tests, feedback, and coordination) so agents can orient themselves and make progress on their own. ## Autonomous Loop Harness - Existing tools like Claude Code stop and wait for human input, so Carlini wrote a bash loop that restarts a Claude session with the same prompt whenever one finishes. - The agent prompt asks Claude to break the problem into small pieces, track its work, choose the next task, and keep going. - The loop should run in a container, since agents can do destructive things. In one case, Claude ran `pkill -9 bash` and ended its own loop. ## Parallel Agents and Task Locking - Parallel agents address two limits of a single session: only one task runs at a time, and specialized agents can handle side jobs such as documentation, code quality, or subtasks. - Each agent runs in its own Docker container with a local clone of a shared bare git repo mounted at `/upstream`. Agents push and pull through git. - To avoid duplicate work, an agent locks a task by writing a file to `current_tasks/`. If two agents claim the same task, git sync forces one to pick another. After finishing, the agent pulls, merges, pushes, and removes its lock. Merge conflicts were frequent, but Claude resolved them. - There is no orchestrator and no formal communication channel between agents. Each agent chooses the "next most obvious" problem and often keeps a running doc of failed approaches. ## Designing the Environment for Claude **Write extremely high-quality tests.** Claude solves whatever problem the verifier describes, so a flawed verifier means the wrong problem gets solved. Carlini drew on existing compiler test suites, wrote verifiers and build scripts for open-source projects, and added new tests as failure modes appeared. Late in the project, Claude kept breaking existing features, so he added a CI pipeline that blocks commits that break existing code. **Design for the model's limitations.** - *Context pollution:* Output should be a few lines, with details written to log files. Errors are tagged with `ERROR` on the same line so `grep` can find them, and summary statistics are precomputed. - *Time blindness:* Claude cannot judge elapsed time and will run slow tests for hours. The harness prints progress rarely and offers a `--fast` mode that runs a random 1% or 10% sample. The sample is deterministic per agent but varies across agents, so the whole codebase gets covered while each agent can still spot regressions. **Orient agents from scratch.** Each agent starts in a fresh container with no context, so the harness requires extensive READMEs and progress files that agents keep updated. ## Making Parallel Work Possible - Parallelism is easy when there are many independent failing tests, since each agent takes a different one. After the suite reached 99%, agents worked on compiling different open-source projects such as SQLite, Redis, libjpeg, MQuickJS, and Lua. - Compiling the Linux kernel was one giant task, so all 16 agents hit the same bug and overwrote each other. The fix was to use GCC as a known-good oracle: most kernel files were compiled with GCC and only a random subset with Claude's compiler. Agents could then fix different bugs in different files. Delta debugging found pairs of files that failed together but worked separately. ## Specialized Agent Roles Carlini assigned agents to specific jobs: removing duplicated code, improving compiler performance, generating efficient output code, critiquing the design from a Rust developer's perspective, and writing documentation. ## Results and Limitations - **Cost and scale:** Opus 4.6 used about 2 billion input tokens and 140 million output tokens over two weeks, for just under $20,000. - **Clean room:** Claude had no internet access and relied only on the Rust standard library. - **Capabilities:** The 100,000-line compiler builds a bootable Linux 6.9 on x86, ARM, and RISC-V, and compiles QEMU, FFmpeg, SQLite, Postgres, and Redis. It passes about 99% of most compiler test suites, including the GCC torture tests, and can compile and run Doom. - **Limitations:** - On x86 it calls GCC for 16-bit real-mode code, because its output exceeds Linux's 32 KB limit. ARM and RISC-V compile fully on their own. - It has no native assembler or linker yet; the demo used GCC's. - It does not build every project and is not a drop-in GCC replacement. - Generated code is less efficient than GCC with all optimizations disabled. - The Rust code is reasonable but not expert-level. - Fixes often broke existing functionality, suggesting Opus 4.6 is near the limit of what this setup can reliably do. ## Looking Ahead Carlini sees agent teams as a step beyond tab completion and single-task tools like Claude Code, enabling autonomous construction of complex projects. He also warns that autonomous development is risky. Passing tests can create false confidence, and code deployed without human verification is a real concern. He calls the experiment exciting but unsettling, and expects the benefits to outweigh the harms while calling for new safety strategies.

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.