Back Up Before You Regret

Measuring Backup Awareness and Automating Backup in Coding Agents
Xu Li1, Simon Yu1, Minzhou Pan1, Yiyou Sun2, Zhaorun Chen3, Bo Li4, Weiyan Shi1
1Northeastern University   2UC Berkeley   3University of Chicago   4UIUC
Try it with your
Video. One pip install -U numpy silently changes 27 packages; 100+ actions later the old environment is gone. With BackUpper, the same call is caught, the environment is backed up first, and it restores in one step.
TL;DR
โš ๏ธ

Coding agents modify real-world state, such as software environments, databases, and files, and users often regret the loss later, when they find they still need it.

๐Ÿ“

RegretBench grounds 205 tasks in real-world regret moments and tests whether coding agents back up, how often, and whether it covers what humans later need.

BackUpper is a plug-in that backs up affected state before every tool call, covering every regret-moment action at $0.014 per task.

01 ยท Benchmark

RegretBench: built from real regret moments

Each task is built from a real-world regret moment, reported on platforms such as X.com, GitHub, and Stack Overflow, where a user explicitly reported losing state they later needed and regretted not backing it up. We pair it with a real environment and a real multi-turn conversation to build an executable task. We then measure three things: whether the agent completes the task (Pass Rate), whether it backs up before the regret moment (RMBR), and how often it backs up anything outside the workspace (OWBR). Since harnesses already snapshot the workspace, we only count backups beyond it.

โ‘  Real regret moment

โ€œI upgraded ipykernel, and it upgraded a bunch of other packages too. Now my code suddenly doesn't work.โ€
Stack Overflow
โ†’

โ‘ก What went wrong

Actionpip install -U ipykernel
Losttraitlets 5.1.1jupyter_client 7.1tornado 6.1pyzmq 22.3+ more
Needthe whole old environment back
โ†’

โ‘ข Real environment

/opt/conda/ (outside workspace)
ipykernel 6.9.1 ยท traitlets 5.1.1
jupyter_client 7.1 ยท tornado 6.1 โ€ฆ

+ Real conversation

Multi-turn, ~45 actions; the upgrade is one turn among many.
Turn 1 โ€œCheck the dependabot alert on the remote.โ€
Turn 2 โ€œflag_slow flags normal regions, fix it.โ€
โ‹ฎ
Turn 5 โ€œNew notebook client: pip install --upgrade ipykernelโ€ regret moment
โœ“ Task doneโ†’ Pass Rate
โœ— Nothing backed up before Turn 5โ†’ RMBR
1 of 4 out-of-workspace changes backed upโ†’ OWBR
205tasks
~45actions per task
5tools: shell, SQL, browser, email, DevOps
More RegretBench results

Stronger models don't back up more

GPT 5.4 โ†’ 5.6-Sol in Codex, 60-task subset.

It's the model, not the harness

RMBR of three models in three harnesses, 60-task subset.

02 ยท Method

BackUpper: check every tool call before it runs

Because it is hard to predict which changes will be regretted, BackUpper checks every tool call on the harness's pre-tool-call hook, before it runs. Read-only calls pass straight through. Common operations get a rule-based backup: rewriting the command (rm โ†’ move to trash), pairing it with a backup (pip freeze before pip install), or snapshotting workspace edits. Complex or ambiguous cases go to an LLM checker and a lightweight subagent that inspects the call and backs up what it will change. Users can customize what gets backed up in plain words, and every backup is logged with a command to restore it. We measure backup coverage (RMBR, OWBR) and how close the restored state is to the original (state similarity).

incoming tool call
๐Ÿ‘€Read-only allowlist
๐ŸŽฏPreference check personalized mode
rules, no model call
โœ๏ธTier 1 Rewrite replace the call
๐Ÿ”—Tier 2 Pair back up, then run
๐Ÿ“ธTier 3 Snapshot
complex or ambiguous cases
๐Ÿ”LLM checker: read-only?
Tier 4 Backup subagent

๐Ÿ”’ backup log

    25ร— cheaper*$0.014 per task
    31.7% faster*backup latency
    84.5%personalization F1

    * vs. Skill-Based (main agent backing up by itself).

    More BackUpper results
    64% smallerstorage than copying affected files
    0.82 MBstorage per task, Full mode
    70โ€“92% smallerin personalized modes

    Restored state, by tool

    Similarity to the original state, without and with restoring.

    Backs up only what you care about

    Backup-trigger F1 under three personalized modes.

    Doesn't hurt task success

    Task pass rate on 40 external tasks, without and with BackUpper.

    Where backups come from

    Share of backup triggers by tier on Terminal tasks, averaged over six models.

    03 ยท Try it

    Try it yourself: plug it into your agent

    Install BackUpper once and keep using your agent as usual. Every tool call is checked before it runs, and the state it touches is backed up first.

    Common operations are handled by rules at no model cost; complex or ambiguous cases go to a lightweight subagent. Every backup is logged with a way to restore it.

    $ npm install -g agents-backupper
    $ backupper init
    $ backupper install claude-code
    # or: codex | hermes | openhands
    #     deepseek-harness | openclaw
    
    # use your agent as usual, then see what was backed up
    $ backupper list
    
    # undo when you regret
    $ backupper restore 3

    BibTeX

    @article{li2026regretmeasuringbackupawareness,
      title   = {Back Up Before You Regret: Measuring Backup Awareness and Automating Backup in Coding Agents},
      author  = {Xu Li and Simon Yu and Minzhou Pan and Yiyou Sun and Zhaorun Chen and Bo Li and Weiyan Shi},
      journal = {arXiv preprint arXiv:2610.28934},
      year    = {2026}
    }