Give a capable model a well-written ticket and a checked-out repo, and it will usually produce a reasonable diff. We learned early that this is where most of the work starts. A reviewer asks why a query was written a certain way. The coverage gate fails. The tests pass, but the grid on the planning screen shows the wrong total. Each of these needs the context the agent built while writing the code, and a stateless agent has thrown that context away by the time they arrive.
Pawn is the development agent we built to do the whole job, the way an engineer on the team would. It works out whether a ticket is really a code problem, finds the cause, fixes it, tests it, checks it in the app, and stays with the PR through review until it merges. Along the way it gets to know the codebase, so the next ticket goes faster.
Its memory has grown with every ticket since we turned it on. It knows the codebase's conventions and the mistakes it has already been corrected on, and it still asks when only a person has the answer. So far the team has merged 342 PRs opened by Pawn across six repos, and not only engineers use it: so do people who don't write code. This post covers how it works and the design decisions behind it.
The obvious design, and why it breaks
Toolio is a retail planning application, and a product ticket usually means a change in both a backend and a frontend repo.
The obvious way to build a coding agent, and the way we started, is a fresh agent run for each step: one to plan, one to implement, one to fix review comments, one to fix CI. It's simple, and it works for small tickets. For anything larger, it breaks in two ways.
- Every step starts cold. Each run rereads the ticket and re-explores the code the previous run already explored.
- The reasoning is gone. The run that fixes review comments sees the code and the comments, but not why the code was written that way. It can change the code, but it can't defend it, so someone else has to decide which comments are right.
Pawn runs on Claude Managed Agents, which gives us what the second design needs: a session that persists across turns, a sandbox with the repos mounted, subagents in the same workspace, and credentials the sandbox never sees.
What Pawn does with a ticket
For the people who use it, Pawn is a Slack thread attached to a ticket. Behind that thread, one session takes the ticket through the same seven stages an engineer would, and every stage draws on the same foundation: what Pawn has learned in earlier tickets and our internal skill library.
- Triage. Pawn reads the ticket, its history, the repo's docs and its memory, and checks code and configuration with read-only tools. Its first question is whether the cause is in the code at all.
- Implement. When it is, Pawn starts the fix right away, in the backend and the frontend, and opens one linked PR per repo.
- Test. Every change comes with unit tests that clear the coverage gate.
- Verify in the app. A UI-checking subagent tests each case on the ticket's own preview environment and posts before/after screenshots and a recording.
- Independent review. A reviewer subagent with no stake in the approach reads the diff before every push.
- PR cycle. Human reviews, an AI review on every push and CI checks all start a new turn in the same session.
- Ready to merge. When the PR is approved, green and verified, a person merges and the lessons stay in memory.
People reply in the thread the same way they would to a colleague: answering a question, pressing Approve on a plan, or asking for a different approach.
How it works
The system has two halves. A Managed Agents session does the engineering work in a sandbox. Around it sits the orchestrator, a small Node service of ours that owns everything that touches the outside world.
Five design decisions define how these halves work together.
Decision 1: A ticket is one long-lived session
A ticket has at most one live session, and every event on that ticket becomes a turn in it. Opening the PR is the middle of the job, not the end.
Each push is reviewed twice by agents before a person needs to look again. Pawn's own reviewer subagent reads the diff before it pushes, and an independent AI reviewer is triggered on the PR after every push. A change request from a person, findings from the AI reviewer, or a failing required check all wake the same session with the feedback in its message. Pawn decides per comment whether it's in scope, replies with what it fixed or why it skipped it, pushes, and resolves the threads it fixed. When a comment would break an earlier decision, it can say why, because it still has the investigation that led there. The push redeploys the preview, and the loop runs again until the PR is approved and green. Each kind of fix has its own attempt limit, so a check that keeps failing ends with a message to a person instead of an endless loop.
The trade-off. A session that lives for days accumulates context, and context costs money on every turn. We pay for continuity with the cost controls described below. We think it's the right trade, because rediscovering context is also a cost, and the cold-start design paid it on every step while also losing the reasoning.
Decision 2: The agent writes files; the orchestrator acts
Pawn never posts to Slack, comments on the ticket or connects to a database on its own. It writes a result file, and the orchestrator decides what to post. It calls a database query tool, and the orchestrator runs the query through our SQL service, so the databases are never reachable from the sandbox. The ticket tracker is read-only for Pawn.
GitHub is the one place Pawn acts directly, because pushing and answering review comments is the job itself. It does that through a short-lived token that can write to its own pull requests, with the merge tools switched off.
This gives us one place to enforce rules, log what happened and change behavior without editing a prompt. A function that posts to Slack can be unit-tested; a sentence asking the model to post carefully cannot. It also means a deploy can restart the orchestrator mid-turn without losing the ticket: its state lives in Redis, and the reconciler reads the session's outputs once it goes idle.
Decision 3: Triage first, with five outcomes
Pawn doesn't start by writing a plan. It triages: it investigates until it understands the cause, then ends the turn with exactly one outcome in its result file, deciding from what it found whether to act or ask.
Two of these deserve attention. No change gives the agent a legitimate way to conclude that the right fix is no code at all. When the cause is a misconfigured setting or a data issue, Pawn reports the evidence and says who should do what next, in a thread that already tags the ticket's owner. Without this outcome, an agent under pressure to produce a PR will produce one. And Needs approval is enforced by category, not by confidence: a change that touches a migration or a permission always stops for a person, however sure the agent is.
Decision 4: Full-stack changes with subagents in one workspace
A product ticket usually needs a backend change and a frontend change that agree on an interface. Pawn makes both in one session, with every repo in the same workspace and the same context. It doesn't hand the frontend to a second agent that has to guess what the backend did: the agent that designed the API is the one that calls it. Each repo gets its own PR, and the PRs link to each other.
Pawn also leads three kinds of subagents. They run in the same sandbox, so they see the same files without anything being copied around.
- Explorer: read-only research across code, git history, past PRs and configuration. Several can run in parallel.
- Reviewer: an independent review of the diff before every push. It has no stake in the approach, so it catches what the author talked itself into.
- UI checker: opens the app in a headless browser, reproduces a report or verifies a change, and records what it saw.
Not every ticket needs the most capable model in every role. A label on the ticket picks how capable the subagent models are, and another changes the lead agent's model or reasoning effort. Labels are read when a session starts, so changing one never disturbs a session already running.
Decision 5: Test, then verify in the running app
Every code change comes with unit tests in every repo it touches. Before it opens a PR and before every push, Pawn runs the tests it added and the suites around them, and checks that the new code clears the coverage gate. Skills from our library make the backend test suite run inside the sandbox, where it can't pull Docker images.
Passing tests show the code does what the agent intended. They don't show that the intent was right, and in a planning app most mistakes show up in a grid. So when a backend or frontend PR opens, the orchestrator deploys the ticket to its own preview environment, named after the ticket. Every push updates it, and it's deleted when the ticket closes.
Once the preview is live, the UI checker runs one case per thing it was asked to verify and posts a report: whether each case passed and the URL it tested, a before/after image with the changed area outlined, and a short recording.
This catches the most expensive kind of agent mistake: a PR that passes CI but doesn't do the right thing. A reviewer can judge the intent from a screenshot in seconds, before opening the diff.
Making a long session safe and affordable
An agent with write access to our main repos has to be boring in the right places. These rules are enforced in code and in the platform. The prompt explains them; it doesn't enforce them.
- Git. Pawn acts as its own GitHub App, pushes only to branches under its own prefix and can't merge. Tokens are short-lived and rotated before each turn.
- Secrets. Credentials live in a vault and are added to outgoing requests outside the sandbox, only for their allowed hosts. The sandbox sees placeholders.
- Data. Data access is read-only and goes through the orchestrator. Results are capped and never copied into PRs, Slack, tickets or memory.
- Production. Pawn never changes anything in production. Its own changes are checked only on their preview environments.
- Cost. Each session starts with a $10 cap. When it's reached, the orchestrator raises it one step and warns in the thread, up to a ceiling where the session pauses.
Cost is the price of Decision 1, and two mechanisms keep it in check.
Keep-warm. While a ticket waits on CI or a review, the prompt cache would normally expire, and the next turn would pay to rebuild hundreds of thousands of tokens of context. With keep-warm enabled on a ticket, the orchestrator pings the idle session often enough to keep its cache warm, so the next turn starts cheap.
Handoff. When a settled ticket gets a small follow-up and its session has grown very large, rereading the whole history isn't worth it. When handoff is enabled, the orchestrator starts a fresh session from the agent's journal instead, trimmed to fit and keeping its summary of the current state. It does this only when the old session is idle, its PRs are known, and its context is past a size threshold. The old session is archived first, under a per-ticket lock, so a ticket never has two live sessions.
Safe for people who don't write code
Because the guardrails live in code and not in the prompt, Pawn doesn't depend on who is asking. People on the team who don't write code assign it tickets and ask it questions in Slack the same way engineers do. A question gets a read-only answer and changes nothing. A request that needs code ends in a PR that goes through review and CI before it's merged, or stops at an approval gate if it touches anything risky. Nobody needs to know which requests are safe to make, because the system decides that, not the person asking.
What it remembers, and what we maintain
We separate three kinds of knowledge, by who writes them and how long they live:
- Journal. Written by the agent during a ticket, and lives for that ticket. It lets a replacement session resume where the old one stopped.
- Memory. Written by the agent after every change and fix, and lives across tickets. One store per repo, holding durable lessons, never ticket details or secrets.
- Skills. Written by us, and versioned. Curated how-tos: running backend tests in the sandbox, logging in for a UI check, measuring coverage the way CI does.
Memory is what the agent learns on its own. Skills are what we maintain.
Every new session starts with what earlier sessions learned. The repo's memory store is mounted into the sandbox, and Pawn reads it alongside the repo's docs before changing anything. It writes to memory after every change and every fix, including fixes a reviewer asked for, so a correction a person makes once becomes a lesson for the next ticket.
Skills come from our internal skill library, the same one engineers install in their own Claude Code. Pawn loads a curated subset each time it starts, so new sessions get the library's current version. It leaves out anything that needs cloud credentials or makes changes outside a repo.
Memory has one limit. A lesson helps Pawn, but the repo's docs stay as they were, so engineers' own Claude Code sessions keep tripping on the same thing. We're closing that gap with a papercut loop, which is in progress. When a doc or skill confuses Pawn or an engineer's local session, it files a short report. Pawn groups the reports and opens PRs that fix the source, so the lesson ends up in the docs everyone reads, not only in the agent's memory.
How things go wrong, and what catches them
Most of the system exists to handle cases where the agent is wrong or the world gets in the way. This is the list we design against:
- The change drifts beyond the ticket: the reviewer subagent, and a stated reason per review comment.
- A check keeps failing: an attempt limit per kind of fix, then a person is asked to step in.
- CI passes but the feature is wrong: the before/after report on the preview.
- The agent is confident about a risky change: approval gates by category.
- There is nothing to fix: the No change outcome.
- A deploy restarts the orchestrator mid-turn: task state in Redis and the reconciler.
- A session grows too large or too expensive: budget caps, keep-warm and handoff.
Results so far
On the step-per-run design, the team merged 23 to 42 of Pawn's PRs a month. In November, the first month entirely on one session per ticket, they merged 115 through the 28th. We haven't separated how much of that jump comes from the architecture and how much from the team assigning Pawn more tickets, and we'd rather say so than claim the whole effect.
A merged PR count alone says little, because a reviewer may have rewritten half of the PR. So we also looked at how much a person had to change. Of the merged PRs across six repos, 80% contain no commit from a person, and in about one in ten a person wrote at least 30% of the changed lines. That share stayed the same after the redesign while the volume went up. More of what Pawn opens now gets merged, too: 146 of its 184 closed PRs since the redesign (79%), up from 197 of 284 before (69%). Both counts include PRs closed because a newer attempt replaced them.
The 20-hour median from PR opened to merged (2 hours at the 25th percentile, 93 at the 75th) says more about us than about Pawn. In our experience most of it is time a PR spends waiting for a human reviewer, though we haven't measured that split yet. That's where our next step is aimed.
The same parts, a second agent
The building blocks run a second agent with no ticket at all. Every four hours, the orchestrator looks at the last day of main-branch builds and finds test shards that failed, including ones that passed on retry. For each such build it collects the failed logs, names the failing test files and starts a session that finds the cause, proves the fix in the sandbox, has the reviewer read the diff and opens a PR.
A test file belongs to one run at a time, so the same flaky test failing in five builds starts one session, not five. A build with more than ten failing files is reported as a broken main branch, not treated as flakes. Anyone can also ask Pawn in Slack: "any flaky tests on main?" lists what it finds without writing anything, and "fix them" starts the fixer right away.
What we'd tell another team
- Keep context, not just state. Resuming a task from a database row is easy; resuming the reasoning is not. If your agent has to defend its decisions in review, give it the session that made them.
- Keep the agent away from the outside world. Let it write files and let ordinary code act, except where acting is the job itself.
- Give the agent a way to say no. An agent that can only succeed by producing code will produce code.
- Put risk decisions in code, by category. A model's confidence is not a risk signal.
- Let it see the app. Tests show the intent was implemented; a screenshot shows whether it was right.
What's next
Next, we want Pawn to approve its own PRs when the risk is low. Today a person reviews and merges everything. We plan to earn this gradually: start with documentation fixes, require a clean independent review, green CI and a passing UI check, and keep anything that touches a migration, a permission or the data model with a person.
We also have open questions that we don't think anyone has fully answered yet:
- When should a session end? Handoff is our first answer to when a long session costs more than it's worth. We don't yet have a principled threshold.
- What should count as quality? Commits by a person are a first proxy, but they miss review time and the tickets Pawn closes without code. We want a measure of how much human effort each ticket really took.
- How much autonomy, and where? Self-approval for documentation is easy to justify. Where the line sits for application code is a question we expect to answer with data, not opinion.
Conclusion
The hard part of a coding agent isn't generating code. It's the rest of an engineer's job: working out whether a ticket needs code at all, staying with it through review and CI, acting on the world safely, knowing when to stop and ask, showing that the change works, and getting better with every ticket. Pawn's design follows from treating that as the main problem. One session holds the context, a thin orchestrator holds the authority, a small set of outcomes holds the contract, a preview environment holds the evidence, and memory holds what it has learned.
Built with: Claude Managed Agents (sessions, subagents, credential vaults, memory stores and skills), a Node and TypeScript orchestrator, Redis for task state, webhooks from our issue tracker, Slack and GitHub, our CI pipelines for builds and preview environments, and an LLM observability tool for per-turn metrics.
Figures come from GitHub, for PRs by Pawn's GitHub App in our organization through November 28, 2026.




