Development and Tools
Managing Agents
The short version
I run several coding agents at once across my apps. The agents are not the hard part anymore. The hard part is keeping them pointed at the right work, trusting what they hand back, and not drowning in pull requests. This page is my playbook: the weekly loop I use, what I learned from engineers who do this at a much bigger scale, and the prompts I copy and paste.
Every source below says the same thing in different words: go deep on one agent until you trust its proof, then go wide. Parallel agents only help when each one can show that its work is correct.
My weekly loop
- Every app has a queue. A ranked list in the repo (for Cybermoon it is
docs/cybermoon-always-improving.md) with the evidence behind each item. An agent with no specific ask takes the top item. - Scheduled tasks pull from the queue. A cloud scheduled task fires overnight, ships one item as a pull request, and re-ranks the queue before it ends. I do not have to write a new prompt each time.
- A review cap keeps it honest. If three agent PRs are already open, the next run stops and tells me I have a backlog. Unreviewed PRs are wasted usage.
- I review and merge. Agents never merge, never push to
main, never turn on auto-merge. I read the diff, look at the screenshots, and click merge. - Every mistake becomes a rule. When an agent gets something wrong, the fix goes into
CLAUDE.mdor the queue doc so the next run does not repeat it. - Monday check-in. I look at what merged last week, what stalled, and whether there is unused room in my weekly plan. Unused room means a queue ran dry or the review backlog blocked the runs, so I refill or review.
Using the whole weekly plan is a pipeline problem, not a prompting problem. Keep the queues full, spread runs across the week instead of bunching them, and keep the review backlog under the cap.
Lauren Tan (poteto): go deep first
Lauren Tan is on the React Compiler core team. She came from Meta, joined Cursor to work on Cursor 3's agent window, and her AI Engineer speaker page now lists xAI, part of the SpaceX AI effort. She has shipped thousands of agent-written PRs in a few months. Her workflow is open source as pstack, a set of skills that also load in Claude Code.
What I took from it
- "If you want to go fast, go deep first." Get one agent to the point where you trust its verifiable output. Only then run many.
- Verification is the bottleneck. A green build is not proof. Run the feature, read the real value, inspect the diff. Her principle is called prove-it-works: check the real artifact, never a proxy or the agent's own report.
- Route each task to a playbook.
/poteto-modepicks a playbook (bug fix, feature, refactor, perf, investigation, shipping, babysit) and copies its steps into a task list. A skipped step stays visible with a reason. - Bug fixes reproduce first. Features design first. Refactors lock down behavior first.
- Subtract before you add. Delete code before writing more. Less code is easier to verify.
- Guard the context window. Hand big searches to subagents so the main agent keeps its focus.
- Never block on the human. An agent should leave work in a state you can pick up, not stall waiting for an answer.
- Encode lessons in structure. Turn a repeated mistake into a skill, a test, or a check, not a reminder.
- Competing attempts.
/arenaruns several attempts at the same problem and keeps the best parts./swarmsplits independent work across workers.
To try pstack in Claude Code:
/plugin marketplace add cursor/plugins
/plugin install pstack@cursor-plugins
/setup-pstack
Boris Cherny: many sessions, one CLAUDE.md
Boris Cherny created Claude Code. Write-ups of his January 2026 thread describe roughly five terminal sessions plus five to ten more on the web, some started from his phone in the morning. The exact counts vary between write-ups.
- Plan first. Agree on the plan before any code. Some runs get a second agent to review the plan like a staff engineer.
- Give it a way to check its work. He calls verification loops the biggest single quality lever.
- Update CLAUDE.md after every mistake. Keep it short. The team adds lessons from PR reviews so the knowledge stays in the repo.
- Subagents for clean-up and checking. One simplifies the code, another runs the app to test it.
Anthropic's guide: before you leave an agent alone
The Claude Code best practices page boils it down to three moves: tell Claude what it cannot see, give it a check to run, and enforce the rules that cannot have exceptions. Before an unattended run it asks five questions:
- Does it know what done looks like? A spec, a goal, or a failing test to turn green.
- Can it check its own work? Tests, a Stop hook, a review step.
- What may it touch? Permission rules, a worktree, the one branch it may push to.
- What stops it? A turn cap or a spend limit.
- Where does the result go, and who signs off? A PR, and then a person approving the merge.
- Ask for evidence, not claims. "All tests pass" means little. The command and its output, or the screenshot, is the proof.
- One checkout per agent. Parallel agents each get their own worktree so edits cannot collide.
- Review with fresh eyes.
/code-reviewruns in a subagent that never saw the reasoning behind the code. - Protect
mainwith a branch rule before leaving a scheduled task running, and watch its first few runs.
Prompt library
Copy these into a session or a scheduled task. Swap the parts in angle brackets.
Agent contract (paste into any bot: Grok, Claude, Codex)
You are one of several agents working for me. Before any work:
1. Read AGENTS.md (or CLAUDE.md) in the repo and the agent roster. If the
roster gives this job to another agent, stop and tell me.
2. Take work only from the repo's queue doc, top item first. List open
PRs; skip any item that already has one.
3. Use your branch prefix (claude loops, codex/, grok/). Never push to
main, never merge, never send, post or email. Write drafts instead.
4. Prove it: commands and output, screenshots on desktop and phone.
5. Finish by moving the item to the queue's log and adding 1-3 next
items with evidence. If you learned a rule, add it to AGENTS.md.
Nightly improvement run
You are the nightly improvement agent for <app> (repo <owner/repo>).
Ship ONE improvement per run as a pull request. Never merge, never push
to main, never enable auto-merge.
1. Read CLAUDE.md and <queue doc>. Follow its rules exactly.
2. List open PRs. If 3 or more of your PRs are open, stop and report the
review backlog. Otherwise take the highest queue item with no open PR.
3. Build it on branch <prefix>/<slug> from origin/main.
4. Verify: run <check command>, run the app, take desktop and phone
screenshots and look at them. Confirm any failure also happens on main
before dismissing it.
5. Update the queue doc: move the item to the log with what changed, and
add or re-rank 1-3 items with the evidence behind each.
6. Open a PR: what users will notice, tests run and their output, what
was not verified. If you cannot finish inside the rules, open a draft
that says exactly what is left. Do not lower the bar.
Final reply: the PR link, one or two sentences, and anything I must decide.
Start a queue for a new app
Read this repo and write docs/<app>-always-improving.md with:
- Rules: how to build, how to test (exact commands), budgets, what never
to touch.
- An improvement queue of 10 items, highest value first. Each item names
the files involved and the evidence (a failing test, a screenshot, a
TODO, a user comment). No vague items.
- An empty log.
Add one line to CLAUDE.md pointing at it. Open a PR.
Bug fix (reproduce first)
Bug: <what happens> when <steps>. Expected: <what should happen>.
First write a test or script that reproduces it and show me it fails.
Then fix the root cause, not the symptom. Show the same check passing,
plus the full test suite output. Keep the diff to what the bug needs.
Feature (design first)
Feature: <goal>. Done means: <observable result>.
Before code, give me a short plan: files you will touch, what you will
delete, how you will prove it works. Wait for my OK. Then build it, run
the real feature, and show me the evidence (command output or
screenshots on desktop and phone).
Independent review
Use a fresh subagent to review this branch's diff against <spec or
issue>. Check every requirement is implemented and has a test. Report
only gaps that affect correctness. Skip style.
Monday check-in
For each repo with an agent queue: list PRs merged last week, PRs still
open and how long they have waited, scheduled runs that stopped early
and why, and how many queue items are left. Recommend what I should
review first and which queues need refilling. Keep it to one screen.
Turn a mistake into a rule
You just <mistake>. Write a one-line rule for CLAUDE.md that would have
prevented it. If a test or check could catch it instead, add that and
skip the rule.
Sources
- pstack README by Lauren Tan, and her post How I Use Cursor
- A deep dive into pstack, Flavio Copes
- Lauren Tan, AI Engineer speaker page
- Claude Code creator's workflow, InfoQ (secondary summary)
- Best practices for Claude Code, Anthropic
Checked November 10, 2026. Session counts and PR totals come from secondhand write-ups and vary between them.