I’m training for a triathlon and I was tired of staring at dashboards trying to make sense of my own data. So I built a CLI that wraps the intervals.icu API. Now I just tell Claude Code what I need, it queries the data, and we figure out the week together.
The setup
intervals.icu is where all my training data lives — activities auto-sync from my devices, I log wellness daily, and I can see fitness and fatigue trends over time. Most of it is accessible via API.
The architecture is simple: intervals.icu holds the data → icu CLI wraps the API → Claude Code calls the CLI → I have a conversation. The key insight is that Claude Code already knows how to invoke shell commands. If you give it a CLI that returns structured JSON, it becomes a capable analyst in any domain. No MCP server, no custom integration — just a binary that prints clean JSON when piped.
The CLI auto-detects context. Run it in a terminal and you get a rich TUI with charts, sparklines, and interactive tables. Pipe it or pass --output json and you get structured data Claude can parse. That dual-mode behavior is what makes it work well for both human and AI workflows.
What a session looks like
Three real examples. Use the send button to to start the conversation — the commands Claude ran are visible inside each response.
Send the message below to start.
I want to focus on running this week — build some base mileage. Can you look at where I'm at and sketch out a plan?
icu fitness --output json icu wellness list --last 7d --output json icu activities list --last 7d --output json You're at CTL 62, ATL 71 — carrying -9 TSB from last week. HRV has been steady though. Last 7 days: Sunday long ride (210 TSS), Tuesday easy swim, Thursday threshold run.
Suggested week: Monday rest, Tuesday easy swim 40min, Wednesday zone 2 run 55min, Thursday easy ride 1h, Friday run intervals 5×5min at threshold, Saturday long run 80min, Sunday off. That brings TSB toward zero by next weekend.
Can you move the intervals to Thursday and make Friday a rest day? I've got a work thing.
icu events create --date 2026-03-20 --category WORKOUT --sport Run --name "Run intervals 5x5min"
--duration 45 icu events create --date 2026-03-21 --category REST_DAY --name "Rest" icu events create --date 2026-03-22 --category WORKOUT --sport Run --name "Long run 80min" --duration 80 Done — Thursday is now the interval session, Friday blocked as rest, Saturday long run unchanged.
Send the message below to start.
Just got back from my long run. How did it go?
icu activities list --last 1d --output json icu activities show 9187441 --output json 75 minutes, 11.2km, 280m elevation. Average HR 148 — upper zone 3, above your zone 2 target. Distribution: 36% zone 2, 38% zone 3, rest zone 1. The climbing accounts for some of that drift. Solid aerobic stimulus, but HR ran hotter than planned.
Felt totally easy though. Pretty hot out — think it was cardiac drift from the heat.
That tracks — heat-induced cardiac drift is real, especially if you were slightly under-hydrated. If RPE felt zone 2, the training effect was probably zone 2. Trust the feel over the number here. Worth noting in your log for when conditions are similar again.
Send the message below to start.
HRV is down 18% this morning and my legs feel wrecked. I've got a threshold bike session today. Do I do it?
icu wellness show --output json icu fitness --output json icu events list --oldest 2026-03-15 --newest 2026-03-21 --output json HRV is 38ms vs your 7-day average of 46ms. Readiness logged at 4/10. TSB is -14. I'd skip the threshold work. You have a zone 2 run tomorrow and easy swim Saturday — both can stay. That's two recovery days before the weekend long ride. Want me to swap today out?
Yeah. Kill the session and mark it as rest.
icu events delete 8827312 icu events create --date 2026-03-15 --category REST_DAY --name "Rest — low HRV" Done. Session removed, rest day logged. Remaining week still has solid load if you hit tomorrow and Saturday.
A few things to notice across these examples. Claude Code is pulling from three different commands in the weekly planning scenario: fitness data for CTL/ATL/TSB, wellness trends for HRV context, and the activity list for what I actually did. It reasons across all three before suggesting anything. And when I ask it to reschedule, it writes directly to the calendar via icu events create — no copy-pasting, no manual entry.
The post-workout scenario is the one I use most. Pull up the activity, look at zone distribution, compare against intent. Ten seconds versus clicking through five pages in the app.
What it gets right, and where it breaks
This is the part that matters for deciding whether to trust any of it.
It’s genuinely good at:
- Balancing load across three disciplines. It considers the full week — if I’ve done a long ride with high TSS, it naturally suggests lighter run days without me having to think about it.
- Spotting patterns I’d miss. Across several weeks of data, it can see things like “your swim sessions are consistently shorter on weeks with high bike volume” that I’d never notice in the moment.
- Remembering context within a session. If I mention my knee is sore at the start of a conversation, it factors that into every subsequent suggestion without me repeating it.
Where it breaks:
- Conservative bias. Any HRV dip and it wants to pull the plug on the day. It doesn’t know I was just dehydrated.
- No feel data. It can see my HR zones but it can’t know that the three-hour ride felt easy because it was 8°C outside. Perceived effort is invisible to it.
- Occasional physiological nonsense. It will sometimes suggest “threshold power at zone 2 HR” which isn’t a thing. It doesn’t deeply understand how zone targets interact across metrics.
Here are four recommendations it made recently. See if you can spot which ones I overrode:
Four recommendations Claude made. Which ones would I override?
Your ATL is 15 points above CTL. Take it easy today — a light 30min zone 1 spin or rest.
HRV dropped 12% this morning. Skip your scheduled zone 2 run and rest completely.
Your swim pace has been inconsistent across the last three sessions. Reduce volume and focus on technique drills.
You've already done 3 hard efforts this week. Drop the threshold segment from today's brick — make it easy.
The pattern: trust it on load management, override it on intensity and feel.
What’s next
I want to add a icu wellness update workflow that feeds subjective RPE and notes back into the calendar automatically, so there’s less re-establishing context at the start of each session. I’m also looking at persisting a short training context file that Claude can read at the start of each conversation — something like a structured summary of the current training block, goals, and any flags.
The broader pattern is simple: wrap a domain API in a CLI that returns JSON, and Claude Code becomes useful in that domain. It works for training data. It would work for anything where the data is structured and accessible.
The icu CLI is available on my GitHub if you train with intervals.icu and want to try it:
--