Cursor Composer 2: Training an Agent for Long-Horizon Coding Tasks
Cursor’s Composer 2 report covers continued pretraining and reinforcement learning; self-summarization helps agents preserve task state.
On this page

A coding agent can produce a plausible first patch and still fail the task. Long changes require it to remember what it inspected, what it changed, which constraints remain and what to do after a tool call. The context window is therefore not only a model limit; it is part of the agent’s working memory.
Cursor’s Composer 2 report describes training in two broad stages: continued pretraining followed by large-scale reinforcement learning. Cursor says it used its coding harness and environments designed to resemble realistic software tasks. That framing puts the agent’s training loop and execution environment alongside the model itself. [1]
Train for work that spans many steps
In a short code completion, the model predicts a small continuation from nearby text. An agent must repeatedly inspect files, make edits, run tools and react to results. If it loses the task’s state between those actions, the next answer may be locally reasonable but globally wrong.
Cursor’s self-summarization post describes a technique for this long-horizon problem. When context reaches a trigger point, the model is trained to produce a compact account of the plan, progress and remaining work, then continue from that summary. Cursor reports an average summary around 1,000 tokens in its study, compared with a prompted baseline above 5,000 tokens. Those are results from the company’s own setup. [2]
The point is not simply to shorten text. A useful summary has to retain the state that determines the next action: decisions already made, files or components involved, unresolved errors and constraints that must not be broken. If it compresses away a requirement, the agent can continue confidently in the wrong direction.
Reinforcement learning needs a realistic harness
The technical report describes Composer 2’s continued training and reinforcement-learning stages and reports results on benchmarks including CursorBench and Terminal-Bench. Cursor’s scores should be read as publisher-reported measurements under its stated harness; benchmark performance can change with prompts, tool access, scaffolding and scoring rules. [1]
That caveat matters because an agent’s quality is a property of the full system. A model that can edit code but cannot reliably inspect a repository, invoke tools or recover from an error is not a strong coding agent in practice. Training environments should expose those interactions and reward completion of the task rather than a convincing narrative about it.
What developers should inspect
When assessing a long-horizon coding agent, look beyond a single benchmark number. Ask whether it preserves requirements through compaction, whether tool results are represented faithfully, whether edits remain reviewable, and how it behaves when a build fails or the task is ambiguous. Cursor’s reports make task-state management a visible part of the design problem: the agent must carry forward enough context to keep making progress, while the developer remains able to inspect the actual changes.
Composer 2’s model is only one part of the system
Cursor’s report identifies Composer 2 as based on Kimi K2.5 and describes a mixture-of-experts model with 1.04 trillion total parameters and 32 billion active parameters. It also describes a training sequence that extends pretraining, extends context length, applies supervised fine-tuning and then uses large-scale reinforcement learning. These are details from Cursor’s technical report, not an independent model audit. [1]
The report describes a 256,000-token long-context extension and training on NVIDIA B300 hardware using MXFP8. The architecture choices matter because an agent must work over substantial repository context while returning tool calls and edits quickly enough for interactive development. A large total parameter count does not mean all parameters are active for every token, and it says little by itself about whether the agent can complete a task reliably.
Cursor also emphasizes keeping the model inside its product harness and training environments. In practice, the harness determines how the model sees a repository, invokes tools, receives errors and produces edits. That is why model comparisons need to state the surrounding system: tool definitions, prompts, environment setup and scoring all affect measured outcomes. [1]
Context compaction is a learned action
A long-running coding session can accumulate tool output, code snippets and previous reasoning until useful context is crowded out. Cursor’s self-summarization method treats compaction as part of the learned task. When a context threshold is reached, the model receives a synthetic summarization task, can use scratch space, and produces a compact state that includes a plan, completed work and remaining tasks before continuing. [2]
Cursor says its study produced summaries averaging roughly 1,000 tokens, compared with a prompted baseline exceeding 5,000. It also describes a reward that accounts for tokens used by the summaries, rather than treating them as free. Those details expose an important tradeoff: a short summary reduces context cost, but if it omits a requirement or a failed attempt, the next phase may repeat work or violate a constraint. [2]
How to evaluate a long-horizon coding agent
A useful evaluation should contain tasks that span several tools and meaningful state changes, not only isolated code-generation prompts. Record whether the agent preserved requirements after compaction, whether it interpreted build and test output correctly, whether its patch is complete, and whether the final result is easy to review. If a task can be solved in several ways, score both the outcome and whether the agent respected repository conventions.
Cursor reports benchmark results including CursorBench and Terminal-Bench, but those values are tied to the company’s evaluation setup. They should not be converted into a claim of universal superiority or directly compared with a score from a different harness. [1]
For developers, the practical test is still a real code change with inspectable diffs and an opportunity to stop or correct the agent. The source material describes training research; it does not make the model’s own summary a substitute for review. A compact plan helps the agent continue, while the human remains responsible for deciding whether the resulting change is safe to merge.
Frequently asked questions
How does Cursor describe training Composer 2?
Cursor’s technical report describes continued pretraining followed by large-scale reinforcement learning, using the Cursor harness and environments intended to resemble real coding tasks.
What is self-summarization in a coding agent?
Cursor describes training the model to summarize its current task state when context grows, then continue work from the summary. The summary is meant to preserve the plan, progress and remaining tasks.
Are Composer 2 benchmark scores independent evaluations?
The report presents Cursor’s own results using its stated harness. They should be attributed to Cursor and not treated as a neutral comparison across every model or evaluation setup.



/* Comments */
Comments are offline right now — we reconnect automatically, nothing is lost.