AI endurance coach · how it works
An endurance coach that athletes text on Signal. It reads each athlete's Intervals.icu calendar and fitness, plans cycling, running and swimming with strength around their week, and writes to their calendar only after they say yes. Claude does the reasoning. Code does the numbers, the sessions and the safety checks.
The system
The athlete writes on Signal, in French or English. The coach answers with Claude, reading and writing the athlete's calendar through an MCP server I wrote for Intervals.icu. From there, sessions sync to the athlete's Wahoo, Garmin or Zwift. Between the model and the calendar sits a layer of plain code: the workout library, the rules that can block a plan, and the approval step.
Context
A long conversation drags old plans and old numbers along, and a model ends up leaning on them. So each call is rebuilt in the same order, with only what is true today.
Zones, periodization, recovery. Never changes, so it is read from the prompt cache.
Fitness, fatigue, form, availability, recovery and the last two weeks, computed by code.
Old tool results are cleared and long threads summarized. The summary keeps no numbers and no plans.
To check it, I built fake conversations one week, one month and three months long, with traps hidden in them. At the end, seven questions check that the coach answers with today's facts.
A 276 W test result mentioned in the thread but never saved. The coach must still use the FTP actually set.
A fatigue of 71 quoted weeks ago. The coach must use today's form and fatigue.
A knee that hurt last month and has healed. The coach must stop planning around it.
Before the rework the coach got 19 of 21 right. After it, 21 of 21, and still 21 of 21 thirty prompt versions later.
Numbers
Loads, durations and projected form come from code, never from the model. The same goes for the sessions: Claude picks a format and a duration, and code writes the intervals.
The same inputs always give the same session, so re-planning a week leaves an unchanged day unchanged. Every variant was previewed on the live calendar service before release.
Writing
Every calendar change is first shown as a preview. The athlete answers, and only a clear yes writes it. Before writing, the preview runs again: if the calendar changed in between, nothing is written and the athlete sees the fresh version.
An approval, with only filler words around it.
Any other word makes it a reply the coach reads and answers.
A question mark is never a yes.
Each athlete also has a daily cap on calendar writes, and a proposal expires after 12 hours.
Safety
These run in code before the athlete is even asked. They compare the calendar with and without the plan, so a rule only blocks what the plan makes worse. The model gets the broken rule and the fix.
| Rule | Blocks |
|---|---|
| Spacing | Two hard sessions on the same day or on days running, unless the athlete allows it |
| Availability | A session on a day off, or a day longer than the athlete's limit |
| Ramp | Load rising faster per week than the athlete's own cap |
| Readiness | A moderate or hard session today when today's readiness says rest |
| Library | A session type the coach doesn't plan |
| Block | A week that breaks its role in the block, loaded or recovery |
| Workout of the day | An on-demand session longer than the time the athlete gave |
After three refused attempts in one conversation, code proposes one easy session itself, still through the approval step.
Privacy
Recovery scores and health notes reach the coach only after the athlete agrees to the privacy policy. Code sends that question and records the answer; the model can never record a yes. Each athlete's data, history and budget are kept apart, and backups are encrypted.
Testing