{"slug": "ask-your-coding-agent-for-a-stack-of-small-prs-not-one-big-one", "title": "Ask your coding agent for a stack of small PRs, not one big one", "summary": "Greg Foster, founder of Graphite, argues that as AI coding agents accelerate code generation, human review has become the bottleneck, and recommends instructing agents to deliver work as a stack of small pull requests rather than one large change. Graphite's data shows longer diffs draw fewer review comments per line, so Foster advises having agents draft a markdown design doc first and then split work into small, sequentially stacked changes that each get reviewed, tested and merged in order.", "body_md": "Tell your coding agent to deliver its work as a stack: a series of small pull requests, each building on the one below, instead of one 2,000-line change. [Greg Foster](https://chainofthought.show/guests/greg-foster/)'s data says longer diffs get fewer review comments per line, and he argues that faster code generation has made review the growing bottleneck.\n\nGreg Foster founded Graphite, which builds code review and stacking tools. In a September 2025 episode he laid out why the bottleneck moved and how stacking helps.\n\nBecause AI sped up the inner loop, writing code, while the outer loop stayed human: review, CI, merge queues, deploys and watching production. Foster said he thinks Facebook was quoted as doubling internal code changes per engineer over the past year, with another doubling expected soon, and that Graphite's own data shows code-change volume per engineer \"strictly up into the right.\" A team that merged 20 changes a day might now merge 50, or 100 with bots in the mix, with more merge conflicts to match.\n\nTrust dropped at the same time. Foster used to assume a teammate wrote the change he was reviewing:\n\nNow it's like, okay, Conor, I'm not sure you wrote this. I, you might've written it. You might've just like held tab down while like staring at your iPhone.\n\n*Greg Foster, founder of Graphite, on [Chain of Thought ep 40](https://chainofthought.show/podcast/40-after-code-gen-what-graphite-is-building-for-the-post-ai-dev-stack-greg-foster/)*\n\nThe reviewer may be the first human to read the code at all.\n\nReviewers stop reading long diffs. Foster pointed to a study he thinks Google ran, and said Graphite's data shows the same pattern: the longer the change, the fewer comments per line.\n\nYou put up a 10 line PR, you're going get like five comments on it.\n\nA giant PR gets an LGTM. So the goal is to keep each reviewable unit small even when the agent produces a lot of code. Stacking, a practice Foster attributes to Facebook's engineering culture, does that: each small change sits on top of the previous one, and each can be reviewed, tested and merged in order.\n\nAsk for it, and give it a plan first. Foster's observation is that agents take to it well:\n\nAI really likes it. It's actually, when you actually start getting these coding agents to stack their code changes and create many small ones, they start applying chain of thought to those stacks.\n\nHe described agents naturally splitting work into the function, then the unit test, then the endpoint on top. The engineers he sees getting the best results start with a markdown design doc worked out with the agent, then tell it to read that doc before writing code.\n\nA prompt pattern that follows from this:\n\n*A minimal sketch to adapt. `diff_stats` is a hypothetical helper returning lines added and removed for a hunk.*\n\n``` python\ndef plan_stack(hunks, dependency_order, max_lines=200):\n    \"\"\"hunks: dicts with a 'file' key; dependency_order: files, lowest layer first.\"\"\"\n    by_file = {}\n    for h in hunks:\n        by_file.setdefault(h[\"file\"], []).append(h)\n    stack, current, size = [], [], 0\n    for f in dependency_order:\n        for h in by_file.pop(f, []):\n            added, removed = diff_stats(h)\n            if added + removed > max_lines:\n                raise ValueError(f\"hunk in {f} exceeds the budget; ask the agent to split it\")\n            if current and size + added + removed > max_lines:\n                stack.append(current)\n                current, size = [], 0\n            current.append(h)\n            size += added + removed\n    if by_file:\n        raise ValueError(f\"files missing from dependency order: {sorted(by_file)}\")\n    if current:\n        stack.append(current)\n    return stack\n```\n\nThis is a batching heuristic: it keeps each PR under a size budget, but it can't tell whether a layer compiles or passes CI on its own, so run CI on every layer. Foster's examples point smaller than 200 lines: the 10-line PR that gets real feedback, versus the 2,000- or 3,000-line PRs he doesn't want agents opening.\n\n**What are the three waves of AI coding Foster describes?**\n\nTab-complete in the editor, a \"director mode\" where you send the model on small missions from a sidebar or terminal, and background agents you ping on Slack or GitHub that return a pull request later. He guessed background agents could handle maybe 10% of PRs, with that share inching up as models improve.\n\n**Is stacking only for big companies?**\n\nFoster said it's spreading, naming engineers at Datadog, Vercel, Notion and Figma. The reasoning carries to any team merging into a shared trunk: small diffs get better review and more granular CI. He saw open source as harder, since a maintainer reviewing a stranger's change wants the complete working solution.\n\n**Can AI review the stack instead of a person?**\n\nAI reviewers help catch issues, but the point of the episode is that human review got more important, not less, because nobody may have read the code before you.\n\nThe full conversation, with the transcript, is on [Chain of Thought](https://chainofthought.show/podcast/40-after-code-gen-what-graphite-is-building-for-the-post-ai-dev-stack-greg-foster/).\n\n[Subscribe to the Chain of Thought newsletter](https://newsletter.chainofthought.show/subscribe?utm_source=devto&utm_medium=referral&utm_campaign=newsletter) for new episodes and write-ups like this one.\n\n*Drafted with AI assistance from the episode transcripts.*", "url": "https://wpnews.pro/news/ask-your-coding-agent-for-a-stack-of-small-prs-not-one-big-one", "canonical_source": "https://dev.to/conorbronsdon/ask-your-coding-agent-for-a-stack-of-small-prs-not-one-big-one-3c7j", "published_at": "2026-12-04 20:30:10+00:00", "updated_at": "2026-12-04 20:44:19.807589+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-products"], "entities": ["Greg Foster", "Graphite", "Facebook", "Chain of Thought"], "also_reported_by": [], "takeaway": "Instruct coding agents to produce stacked PRs under a size budget (Foster's examples favor well under 200 lines) after agreeing on a markdown design doc, since Graphite's data shows longer diffs draw fewer review comments per line.", "recommendation": {"advice": "Have your coding agent write a markdown design doc first, then split work into stacked PRs under a line budget and run CI on every layer.", "playbook": "coding-agents", "playbook_url": "https://wpnews.pro/playbooks/coding-agents"}, "alternates": {"html": "https://wpnews.pro/news/ask-your-coding-agent-for-a-stack-of-small-prs-not-one-big-one", "markdown": "https://wpnews.pro/news/ask-your-coding-agent-for-a-stack-of-small-prs-not-one-big-one.md", "text": "https://wpnews.pro/news/ask-your-coding-agent-for-a-stack-of-small-prs-not-one-big-one.txt", "jsonld": "https://wpnews.pro/news/ask-your-coding-agent-for-a-stack-of-small-prs-not-one-big-one.jsonld"}}