Min passion er løb, og hver dag er en ny chance for at finde løbeskoene frem. Det er de lange distancer, der kalder på mig, med marathons som min foretrukne udfordring.
The coach behind the training plan on this site is an AI agent. It plans, reviews and adjusts long-course endurance training for one athlete, working from a repository of plain-text files. This page shows how it is built and how it works.
1. The whole picture
One AI agent, one athlete, one repository of plain text, and the training platforms.
Under the hood
Claude Code runs inside a git repository of Markdown files. CLAUDE.md is the constitution: the objective, the evidence standard, the safety rules, the decision framework and which source wins when two disagree. It is loaded in every session; everything else is read on demand.
Each recurring task is a workflow file in .claude/commands/, such as /check-in, /weekly-review, /block-plan, /block-review, /test-review and /push-plan. A workflow names exactly which files it reads.
Python scripts fetch and read the platform data: Garmin Connect through a command-line client, Stryd through its web API, TrainingPeaks through an MCP server. WKO5 has no API, so its numbers are pasted in.
Hooks at session start list what is due and start the data fetches in the background.
2. Inside the repository
Every file has one job. The last line of each entry says who writes it: ◆ waits for the athlete's yes, ● is a record.
Three files, as they look inside. The contents are invented.
coaching/evidence.md
### E-nn
Carbohydrate in races
over 2.5 hours
Used by: fueling.md § 1
Source: systematic review
Level: 1
State: Verified, <date>
Every rule that sets a number rests on a source, with its level and state.
athlete/training-response.md
Prediction ledger
Block: B-n
Predicted: if X changes,
test Y improves
Stated
confidence: Medium
Observed: ...
Verdict: partly confirmed
A prediction that could fail, and its verdict, which the athlete confirms. Enough verdicts calibrate "confidence".
athlete/current-state.md
Threshold power: ___ W
[as of <key> <date>]
— Basis: field test,
<review>
Every value carries its evidence date and basis; metrics.md says when it expires.
Each workflow reads a short list of its own. Rows are workflows; columns are files.
Under the hood
Each workflow's reading list lives in its own command file and nowhere else, so there is never a second copy to drift.
CLAUDE.md is loaded in every session, so its column is full.
/review-implementation is left out. It checks the repository itself and reads the whole vault by design: the one exception to "read only what the task needs".
The block file holds both kinds of write. The plan is a decision, changed on the athlete's yes. Mid-block notes and the change log are records.
Workflows that end in a calendar change hand it to /push-plan, which writes the platforms on one yes. The weekly review may re-sync the watch under a rule the athlete set.
3. What it aims at, and what it trusts
One target. Two ladders decide which evidence counts and which number wins.
When two sources disagree, the higher rung wins. A model never overrides a recent real performance; the gap is investigated instead.
Under the hood
Every claim from research that sets a number, a threshold or a cadence carries a marker such as [E-12]. The marker points into an evidence register, coaching/evidence.md, which holds the source, the level of evidence and whether it has been verified. A claim from memory is marked "unverified" wherever it decides something; a house convention is labelled as one.
No named method (80/20, polarized, threshold-heavy and so on) is a goal in itself. The approach comes from the athlete, the event and how the athlete has responded so far.
4. The rhythm over time
Loops inside loops: the season holds blocks, a block holds weeks, a week holds days.
BaseBuildSpecificPeakTaper
Under the hood
The season plan (plans/) works backward from the main race. Each block (plans/blocks/) usually has four weeks: build, progress, overload, and recovery with tests.
A script, due.py, runs at every session start. It lists what is owed: a week without a review, a block ending with no next block, a value whose evidence is too old, an obligation coming due. When nothing is owed, it prints nothing.
The coach reads reviews from about the last 90 days. Older reviews are history, except races, the latest block review and the latest comparable test. What must last is written into athlete/training-response.md.
Methods change only between blocks, unless safety requires otherwise.
5. How a decision is made
Every significant recommendation can be traced through nine questions. Plans are then attacked by critics, and the athlete decides.
Under the hood
Before a season plan reaches the athlete, four critic agents attack it, each from one side: rates, structure, risk and evidence. Two verifier agents then try to disprove the critics. A block plan gets a lighter version.
When the athlete chooses differently, the coach states its advice once, plans what the athlete chose, and records both in the athlete log.
6. Where the data flows
Many ways in, one way out. The block file is the plan; the calendar is a copy of it.
Under the hood
Fetch scripts: fetch-garmin.py, fetch-stryd.py and fetch-trainingpeaks.py. Each one checks that the live account is the athlete's own, and refuses if it is not.
Reader scripts: one per source (garmin.py, stryd.py, tp.py, wko.py). Anything that follows from the data by a rule is done in a tested script, not by the AI. Reading recipes written in prose proved too error-prone.
Writers: tpw.py writes the TrainingPeaks calendar. gw.py writes strength sessions to the watch, because TrainingPeaks does not sync strength to Garmin. Every write is logged with its reason, and completed sessions cannot be touched.
7. How it learns
Two lanes. What this athlete shows outranks what the literature says about athletes in general.
Under the hood
athlete/training-response.md records how this athlete responds, one entry per finding, each with a test that would prove it wrong. It also holds the prediction ledger and a calibration table: "high confidence" counts as measured only after enough verdicts at that level.
The evidence register is re-checked 1–3 questions per block, chosen by how much a wrong answer would change training. One agent finds sources; a separate agent verifies them.
At a block review the athlete's response is read first and the literature last, so the literature cannot explain away what actually happened.
The evidence a change needs grows with what it costs the athlete. A change is proposed to the athlete, never applied silently.
8. How it stays consistent
Every change takes the same path, and the rules are checked by machine, not by memory.
Under the hood
scripts/verify.py runs about thirty checks over the Markdown: links and anchors, evidence markers, one home per fact, the safety screen in place, each workflow's reading list, and more. It runs before every commit.
A unit-test suite covers the scripts, and a mutation pass checks that the tests would notice a broken line.
Every review is logged with the exact version it read. A change can land only when every commit in it was reviewed and the tests pass.
Source precedence, highest first: the athlete's instruction now, the constitution, current state and goals, this athlete's demonstrated response, the active plan, the methodology, old reviews and plans.
Each commit is tagged as generic coach or athlete-specific, so the coach can be separated from anyone's data.
A defect asks for a check: each serious defect raises the question whether a new check or test could catch its kind next time.
9. Guardrails
The coach works on its own where it records. Where it decides, it waits for the athlete.
Under the hood
Four workflows need the athlete present: onboarding, the season plan, the block plan and the block review.
Onboarding is an interview. The coach first reads what the platforms hold, then asks what no file can hold: why the athlete trains, what drains them, what they want from a coach.
The athlete log records what is not a number: motivation, life context, confidence. A sustained decline counts as a signal, just like poor recovery markers.
10. Three examples
Invented scenarios, to show the paths through the system. Each card points to the section it shows.
Heavy legs
1The athlete says the legs felt heavy on the long ride.check-in · §4
2The coach logs it. A record, so no yes is needed.§9
3The weekly review sees the same note repeat. A trend, not a bad day.§4
4The coach proposes a lighter week and says why.§5
5The athlete says yes.§9
6The block changes; the calendar and the watch follow.§6
A field test
1The block plan schedules a threshold test.§4
2The data is fetched; scripts read the result.§6
3The test review checks that the test was valid, then compares it with the last one.§3
4The coach proposes a new threshold.§9
5The athlete says yes. The state file records it with its date.§8
6The training zones on the platforms follow.§6
One block
1The block plan states a hypothesis that could fail.§7
2Critics attack the plan; the athlete approves it.§5
3Weeks of check-ins and weekly reviews.§4
4The block review proposes a verdict; the athlete confirms it.§7
5The verdict joins the ledger; the lesson joins the response file.§7
61–3 evidence questions are re-checked before the next block.§7