EN
Spine helps coding agents track nested work
Spine: Compiling Subtask Trees into Structured Context for Long-Horizon Coding Agents · arXiv:2610.37224
In plain words
Long coding jobs contain smaller jobs, and some finish while others are still underway. A plain running history can become unwieldy, while shortening it can make it harder to see what remains to be done.
The paper introduces Spine, a way for coding agents to mark tasks as they start and finish. It keeps detailed records but gives the model a finished task’s result instead of all its work.
In one comparison, SpineCodex completed more repository milestones at lower cost than Codex under the same tested setup.
The research
When a coding agent works through a long task with nested subtasks, how can it retain the details needed for unfinished work while avoiding a growing history of completed work? Requiring a separate agent for every subtask can add coordination overhead, even when the current agent could handle it.
Spine records nested coding tasks and their completion, then builds each model input from open work and results from completed tasks.
The authors compared SpineCodex with Codex on SWE-Milestone, which tests progress on dependent repository milestones while preserving existing behavior.
With GPT-5.6 Sol, the evaluator’s score, combining tests of new functionality and regression prevention, was 42.6% versus 38.1%; SpineCodex resolved 19 of 98 milestones versus 14 and cost less.
On a random sample of 50 ProgramBench tasks, hidden tests of reconstructed program behavior also showed a higher average pass rate for SpineCodex. Together, these comparisons support the value of organizing context around task completion in the tested setups.
The evaluations cover selected tasks, models, and harnesses, and seven of FrontierSWE’s 17 tasks were unavailable and excluded. The results therefore do not establish performance on those tasks or on every long coding task.
What the evidence shows
- The context problem
Spine is an interface and runtime for coding agents that organizes model context around nested subtasks and their completion. The problem is that a growing interaction history can obscure unfinished work, while compression may discard information needed to resume it.
Requiring a child agent for every subtask boundary also adds coordination overhead, even when the current agent could do that work.
- Marking task boundaries
Spine lets an agent open a work scope for a subtask and close it by submitting a result. The same agent can handle nested scopes locally, while independent tasks can be delegated.
SpineTree records the ordered contents, nesting, completion states, and returned results, keeping task boundaries explicit in the execution record.
- Compiling model context
Before each model call, the Spine runtime keeps messages and descriptions of open tasks, while replacing a completed task’s detailed interactions with its submitted result. The detailed interactions remain in SpineTree.
This gives the model a shorter account of completed work while retaining the fuller record for reference.
- Results on repository work
On SWE-Milestone, which tests progress on dependent repository milestones while preserving existing behavior, SpineCodex scored 42.6% with GPT-5.6 Sol.
In the default setting, it was compared with four context-management baselines: its Score was comparable to Recursive Subagent’s (42.6% versus 42.4%), while it resolved more milestones (19 versus 17) at substantially lower cost ($460.77 versus $1,749.73).
- Checks beyond one setup
ProgramBench tests whether agents can reconstruct programs from documentation and an execute-only reference implementation; hidden tests check whether the reconstructed program reproduces the reference behavior. On a random sample of 50 tasks, SpineCodex had a higher average test-pass rate than Codex.
In Pi, SpinePi’s SWE-Milestone Score improved by 9.5% with Gemini 3.8 Flash and 17.5% with Qwen 3.8 27B. On ProgramBench, its average test-pass rate also improved with both models: by 8.7% with Gemini and 4.3% with Qwen.
Ablations across three SWE-Milestone projects separately tested limiting nesting to one level below the root (Depth 1) and removing boundary markers and scope states from model inputs while keeping runtime state compilation.
Both increased average input tokens per request relative to full SpineCodex: Depth 1 raised them from 59.8K–78.1K to 82.8K–99.5K; removing boundary cues raised them to 118.1K–128.6K, a 64–97% increase.
Deep
- Original paper authors
- Jiahong Xiang, Kunqiu Chen, Lingming Zhang, Yuqun Zhang
- Submitted to arXiv
- License
- arXiv non-exclusive