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.
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.
Leave a task. Find your way back.
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.
Different files.
Shared directory.
└─ package/
├─ focus.py A
└─ other.py B
Different files.
Different directories.
├─ 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.
The cost of losing the thread
View the exact values
| Model / harness | Uninterrupted | Switched | Gap (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.
A context that knows where you left off
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.
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.
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-trajectoryThe 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.
@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.