Abstract
Preparing for an ultratrail race is a months-long experiment in physiological adaptation. Training decisions must account for long-term goals, fitness gains, short-term fatigue, recovery, illness, weather, and physiological data uncertainty, with significant consequences for athlete health. We present Switchback, an open-source agent system that combines a structured constitution, user-owned memory, task-specific skills, an exercise science knowledge base, and tools for accessing wearable data.
We deployed Switchback for 174 days while the author-runner prepared for three ultratrail races, covering 102 runs, 1,154 km, 34,554 m of climbing, and 180 elapsed hours, alongside more than 3,100 user and agent messages and 540 million total API tokens. Lessons from this six-month user–agent collaboration shaped UltraBench, a synthetic benchmark of 60 scenarios evaluating training agents for health safety, adaptation, constructive planning, memory stewardship, and tool orchestration.
We refined Switchback on 12 development scenarios and evaluated it on 48 held-out scenarios across six models from three providers. Against baseline CLI agents with identical access to files and tools, Switchback raised the cross-model mean score from 73.4 to 79.6 points, a paired gain of 6.2 points (+8.4%; 95% CI 4.2–8.2). Even frontier models capable of proficient advice make safer, better-grounded decisions when anchored by structured tool-use, explicit health guardrails, and an exercise science knowledge base.
COMPANION.md specification, task-specific skills, and a 20-chapter exercise-science knowledge base shape a model-agnostic CLI agent across Claude Code, Codex CLI, and Gemini CLI. Athlete-owned preferences (SOUL.md) and longitudinal memory live in a private repository, while wearable activity, health, calendar, and weather data flow through MCP servers.
Eight-Step Decision Kernel
Switchback keeps a concise decision constitution in context and defers domain literature and procedural workflows to on-demand retrieval. Rather than hard-coding coaching dogma, the kernel enforces evidence verification, health triage, and user-owned memory hygiene:
Define Decision & Goal
Frame the immediate training question in the context of the athlete's season-scale objective.
Minimum Decisive Data
Identify which wearable, calendar, weather, or memory records could change the recommendation.
Athlete Data First
Retrieve recent logs and check source, date range, recency, units, and completeness before advising.
Expose Contradictions
Surface conflicting metrics, prefer authoritative sources, and retrieve only relevant physiology chapters.
Observations vs. Hypotheses
Separate verified measurements from physiological hypotheses, decisions, and proposed edits.
Least Restrictive Safe Action
Apply a four-level health triage ladder that protects safety while preserving long-term progress.
Confirm & Verify Writes
Confirm consequential calendar edits with the athlete and verify resulting tool or file state.
Sourced Longitudinal State
Record durable, dated facts in plain Markdown while preserving uncertainty and superseded context.
UltraBench: Held-Out Multi-Turn Evaluation
UltraBench evaluates CLI agents across 60 three-turn synthetic ultrarunning scenarios (12 public development scenarios in UltraBench-Dev; 48 private held-out scenarios in UltraBench-Test) with synthetic wearable streams, athlete repositories, executable MCP tools, and realistic athlete pushback. Every trajectory is blind-scored by a three-provider judge panel (Claude Opus 5, GPT-5.6 Sol, and Gemini 4 Argon).
| Target Model | CLI Harness | Baseline (95% CI) | Switchback (95% CI) | Paired Δ (95% CI) |
|---|---|---|---|---|
| Claude Sonnet 5 | Claude Code | 69.5 [64.2, 74.5] | 73.8 [69.5, 77.6] | +4.3 [−0.5, 9.3] |
| Claude Opus 5 | Claude Code | 67.8 [62.6, 72.9] | 80.1 [76.3, 83.4] | +12.3 [7.9, 17.0] |
| GPT-5.6 Terra | Codex CLI | 71.0 [65.8, 75.8] | 79.5 [75.4, 83.3] | +8.6 [4.7, 12.6] |
| GPT-5.6 Sol | Codex CLI | 75.5 [70.2, 80.4] | 83.3 [79.2, 86.9] | +7.8 [2.9, 12.4] |
| Gemini 3.8 Flash | Antigravity CLI | 74.6 [71.6, 77.5] | 78.2 [75.2, 80.7] | +3.5 [0.8, 6.1] |
| Gemini 4 Argon | Antigravity CLI | 82.2 [80.0, 84.2] | 83.0 [81.3, 84.6] | +0.8 [−1.5, 3.3] |
| Cross-Model Mean | All 6 Models | 73.4 | 79.6 | +6.2 (+8.4%) [4.2, 8.2] |
● Largest Gains in Safety & Adaptation
- Safety & adaptation: +9.8 points across models (+16.7 on Opus 5, +15.5 on Sol), reducing capitulation when athletes push back on health guardrails.
- Constructive planning: +6.5 points across models via structured physiological reasoning and goal-preserving alternatives.
- Agent operations: +1.8 points (memory stewardship & tool orchestration), highlighting reliable retrieval and write verification as the main open frontier.
● Open Release & Evaluation Integrity
- Public release: The full Switchback specification, 20-chapter knowledge base, CLI evaluation harness, and 12 UltraBench-Dev scenarios are open-sourced on GitHub and Hugging Face.
- Held-out protection: The 48 UltraBench-Test scenarios remain private to prevent benchmark contamination, alongside all personal health and GPS logs from the field deployment.
Six-Month Field Deployment Case Study
From March 8 through August 29, 2026 (174 days), the author-runner developed and deployed Switchback daily across three ultratrail race cycles—navigating pre-race fever, post-race tendinopathy, and an alpine storm reroute on the eve of UTMB CCC.
Miwok 100K
After an April 24–28 fever during taper, Switchback shifted to symptom-gated recovery and built a conservative race plan; after a mile-48 cutoff at ~13 hours, post-race GPS analysis carried durability and descent lessons forward.
Broken Arrow Skyrace 46K
Finished at altitude with 9h 02m of moving time and 8,700 ft of gain; Switchback validated the fueling strategy, treated a brief cramp as mechanical rather than sodium-related, and guided recovery through a July Achilles flare.
UTMB Mont-Blanc CCC
When a storm forced a race-eve reroute of the Bovine Alp section, Switchback parsed the revised GPX and rebuilt pacing, fueling (~81 g/h carbs), and checkpoints; the author covered >90 km in ~23 hours to Vallorcine.
Citation
If you use Switchback or UltraBench in your research, please cite:
@inproceedings{lacombe2026switchback,
title = {Switchback: A Long-Horizon Agent System for Ultrarunning Training},
author = {Lacombe, Romain},
booktitle = {The Third Workshop on GenAI for Health at NeurIPS 2026},
year = {2026},
url = {https://switchback.run}
}