Skip to content

codeSplitter: agent budgets per path, hand off to fresh eyes with a caveman-terse note #1077

Closed

Description

@QuinnsCode

Agents get worse per dollar as their context grows. Every turn re-reads the whole session, and long sessions also drift. codeSplitter already runs agents (conflict agent, self-heal fix tasks, agent sandbox) and has a per-path policy table (#1050, #1051). Give that table a budget, and have agents hand off to fresh eyes instead of grinding on.

What to build

  1. Budget columns in the per-path policy table: a context or spend threshold per task, plus what happens when it's crossed: handoff (fresh agent), escalate (person), or downshift (a cheaper model for mechanical work such as merges, renames and retitles).
  2. Triggers that cut a run short before the budget runs out:
    • context past the threshold (transcript size; for Claude Code harnesses, a hook can read it)
    • the same failure twice (the same test, or the same error text)
    • a third conflict round on one branch
  3. A handoff note, written caveman-terse. The next agent reads it cold, so it should be short and blunt:
    DONE: x, y
    NEXT: z (file:line)
    BROKE: test foo, why
    DONT: tried a, failed because b
    
    It lands on the branch (or as a review comment), and the relay starts a fresh agent from it with nothing else.
  4. Shown on the review page: each agent run's spend, plus "handed off at N tokens because …".

Why

On 2026-10-12, the slow and costly parts of a ~90-PR day were long-lived agents and rework rounds (conflicts, refixes), not task size. Fresh agents with a short note beat one agent grinding through round three. Prior art: Claude Code's auto-compact and /compact do this within one session; this does it across agents, with a budget.

Related: #938, #1050, #1051, #1015 (self-healing CI).

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions