Skip to content

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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. Every mistake becomes a rule. When an agent gets something wrong, the fix goes into CLAUDE.md or the queue doc so the next run does not repeat it.
  6. 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

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.

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:

  1. Does it know what done looks like? A spec, a goal, or a failing test to turn green.
  2. Can it check its own work? Tests, a Stop hook, a review step.
  3. What may it touch? Permission rules, a worktree, the one branch it may push to.
  4. What stops it? A turn cap or a spend limit.
  5. Where does the result go, and who signs off? A PR, and then a person approving the merge.

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

Checked November 10, 2026. Session counts and PR totals come from secondhand write-ups and vary between them.

Find something.

Search the wiki, writing, apps, and more.

Esc to close · ⌘K / Ctrl K to search

Say hello.

Have a question, an idea, or just want to connect?

hi@masonearl.com
Gmail ↗Outlook ↗

Choose your email service, or try your default email app ↗.

X / @masonearl ↗LinkedIn ↗