A benchmark for returning to unfinished work / November 2026

Do coding agents
hold focus?

Switching between unfinished tasks with Switch-SWE

Shuochen Chang1,*, Qianli Ma1,*, Yibo Miao1, Qingyang Liu1, Bingjie Gao1,
Haonan Zhao1, Siyu Sun1, Yulin Sun1, Han Zhao1, Jiangtong Li2,†

1 Shanghai Jiao Tong University2 Tongji University

* Equal contribution   † Corresponding author

Five unfinished tasks, one shared conversationFive colored bundles of threads cross and separate, illustrating interleaved task histories. The orange focus task returns to the foreground.
ONE CONVERSATION. FIVE UNFINISHED TASKS.Follow the orange thread back to the focus task.

01 / THE QUESTION

Code persists.
Does the task state?

Software development rarely follows a straight line. A feature is half finished when a bug arrives. A review needs attention. Then comes the request: “Let’s get back to the earlier task.”

The code is still there. But can an agent recover the right requirements, remember its progress, and keep other tasks’ assumptions out of the solution?

Switch-SWE measures this ability to resume unfinished work. We compare the same focus task with and without intervening work, keeping its requirements, persistent checkout, and executable verifier fixed. Across seven model–agent configurations, switching reduces focus-task resolution in every case.

200focus tasks
19Python repositories
11.5 ppaverage resolution gap

Reported in the paper, §3–4. The resolution gap is uninterrupted minus switched completion, averaged across seven configurations.

02 / THE BENCHMARK

Same task. Same tests.
A different path back.

Each focus task is reconstructed from real issue, pull-request, and review histories. Requirements arrive in ordered stages. In the switched session, four other unfinished tasks from the same repository are interleaved between those stages.

All five tasks keep their own persistent checkouts. The agent works through one continuous conversation, and only the final focus-task patch is scored.

ANATOMY OF A SESSION

Leave a task. Find your way back.

Persistent checkoutsOne shared conversation ↓

Click a request to follow the active task. This illustrative three-stage schedule follows Eq. 2 in the paper; actual sessions contain different numbers of requests. B–E never enter the primary score.

How close is the interruption?

Near and far interruptions both modify source files distinct from the focus task. They differ in the immediate parent directories those files belong to.

NEAR / 100 FOCUS TASKS

Different files.
Shared directory.

repository/
└─ package/
  ├─ focus.py A
  └─ other.py B
FAR / 100 FOCUS TASKS

Different files.
Different directories.

repository/
├─ core/focus.py A
└─ utils/other.py B

Schematic file paths. The paper defines locality using the immediate parent directories of source files changed by the reference fixes (§3.3).

03 / WHAT CHANGES?

Every agent loses ground.

All seven configurations resolve fewer focus tasks after switching. The overall gap ranges from 6.0 to 15.0 percentage points. Performance on uninterrupted work does not tell the whole story: Claude Opus 5 leads without switching, while GLM-5.3 leads when work is interleaved.

FOCUS-TASK RESOLUTION

The cost of losing the thread

200 matched focus tasks
UninterruptedSwitched
Resolution rate (%)
015304560
Gap (pp)
Table 1, arXiv v1. Each bar pair compares identical focus requirements and verification. “Medium” is the reported reasoning effort for both GPT models and Claude Opus 5. Gaps are percentage points, not relative percentages.
View the exact values
Overall resolution, Table 1
Model / harnessUninterruptedSwitchedGap (pp)

Farther interruptions, larger gaps.

The mean gap is 8.1 points for near interruptions and 14.9 points for far interruptions. All seven configurations follow this pattern. Because the two groups contain different focus tasks, this is an association with source locality, rather than an isolated causal effect.

Resumed focus stages also process 1.41–2.95× the tokens of a full uninterrupted session. This excludes execution of interruption tasks, but their history can still be processed when the agent returns. These are cumulative token totals, not a direct measurement of isolated recovery overhead.

Keeping the code is only part of remembering the work.

04 / RECOVERING CONTEXT

Bring back the right history.
Carry forward the task state.

Trajectory inspection reveals two recurrent problems: cross-task requirement confusion and loss of accumulated task state. The Resumption Context Manager (RCM) addresses both through an OpenCode plug-in.

A Task History Router selects interactions relevant to the active task. Task State Memory records its goals, constraints, progress, pending work, and uncertainties. RCM assembles these for the next model request while preserving the stored conversation and task checkouts.

RESUMING TASK A

A context that knows where you left off

SHARED HISTORY
CONTEXT FOR THE NEXT REQUEST

Switched resolution on 200 focus tasks per model (Table 3). The context illustration is schematic, not a token-size comparison. Shared and unassigned interactions remain available; low-confidence routing keeps the full available history.

Full RCM improves switched completion by 15.5 points on DeepSeek-V4.1-Flash and 5.5 points on GLM-5.3 over native OpenCode. State memory adds 4.5 and 2.0 points beyond routing alone. These results are evaluated on two models with OpenCode; they do not establish a benefit from task switching itself.

Explore the context manager ↗

05 / EXPLORE & EVALUATE

Put resumption to the test.

The paper evaluates 400 matched session specifications: an uninterrupted and a switched session for each of 200 focus tasks. The current code release includes the 200 switched sessions in Harbor’s native multi-step format, split evenly into near and far.

FROM THE RELEASED BENCHMARK

Real repositories. Unfinished work.

First-request excerpts from the released task files. Request counts include finalization. Open a session to inspect its complete instructions, environment, and verifier.

Run with Harbor

Use Python 3.12+ and Docker, configure your model provider’s API key, then run the pinned Harbor version from the repository. Native session resume keeps one continuous agent conversation across requests.

TERMINAL
git clone https://github.com/Miraclecsc/Switch-SWE.git
cd Switch-SWE
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt

# Replace <provider/model> with your configured model.
harbor run -c harbor.yaml -a opencode \
  -m <provider/model> --resume-trajectory

The release uses a 900-second agent budget per step and grades the final focus checkout with held-out F2P/P2P tests. See the repository for environment setup and release validation status.

06 / CITATION

Build on this work.

If you use Switch-SWE in your research, please cite the paper.

BIBTEX
@misc{chang2026switchswe,
  title = {Switch-SWE: Do Coding Agents Hold Focus When
           Switching Between Unfinished Tasks?},
  author = {Shuochen Chang and Qianli Ma and Yibo Miao and
            Qingyang Liu and Bingjie Gao and Haonan Zhao and
            Siyu Sun and Yulin Sun and Han Zhao and Jiangtong Li},
  year = {2026},
  eprint = {2611.02017},
  archivePrefix = {arXiv},
  primaryClass = {cs.CL},
  url = {https://arxiv.org/abs/2611.02017}
}

All reported experiment values are from arXiv:2611.02017v1 (1 November 2026), Tables 1–3. Benchmark descriptions are grounded in the paper and the public code release.