← Building with AI

A marathon training agent

A web app that builds a periodized marathon plan, syncs with Strava, and adapts every week. Seven days before the race it writes a race-week brief.

Most training plans are a PDF. They do not know you missed Tuesday or ran Thursday too hard.

I built a web app that does know. It is a product experiment: a coach that plans, watches and adjusts.

How the marathon training agent plans and adaptsThe runner sets a goal. Claude builds a plan and stores it in Postgres. Strava sends each run by webhook. Every Monday a scheduled job compares plan and actuals and rewrites the next week, then an email check-in goes out. Seven days out, a Race Week Brief combines the plan with the Open-Meteo forecast.Runnergoal race, date, fitnessClaude builds plan16 to 20 weeks, VDOT pacesPostgresMonday adaptVercel cronNext week rewrittenEmail check-inResendStravaOAuthRace Week Brief7 days outOpen-Meteorace-day forecastwebhook
  1. Plan. The runner sets a goal race, a date and their current fitness. Claude builds a 16 to 20 week periodized plan: base, build, peak, taper. Paces come from VDOT zones.
  2. Sync. Strava connects through OAuth. A webhook sends each run to the app as soon as it uploads.
  3. Adapt. Every Monday a scheduled job compares planned and actual training and rewrites the coming week.
  4. Brief. Seven days out, the runner gets a Race Week Brief: the race-day forecast from Open-Meteo, mile-by-mile pacing, fueling and logistics.
  5. Check in. Email check-ins go out through Resend.

Stack: Next.js 16, Tailwind, Postgres with Prisma 7, NextAuth v5, Claude and Vercel cron.

Source on GitHub: github.com/abhilashme/marathon-training-agent