Sitemap
Nate Tang

Nate Tang

Building My Own AI Fitness Coach Using Claude Code

5 min readNov 21, 2025

--

As a product manager with a passion for endurance sports, I set out to build an AI-powered running coach — not as a commercial venture, but as a personal challenge. The result: a fully functioning AI Fitness Coaching app that generates personalized training plans, syncs with your workout data, and chats like a real coach. This article breaks down what I built, how I built it, and why it matters.

The Problem I Wanted to Solve

Most recreational runners either:

  • Don’t have access to a coach
  • Follow generic online plans that don’t adapt to them
  • Abandon training due to confusion or lack of support

What if AI could fill that gap?

What the App Does

Press enter or click to view image in full size

Custom Training Plans via LLMs

The app uses a large language model (Claude from Anthropic) to create goal-specific plans based on a user’s fitness level, race target, and workout history. The plans follow standard endurance training phases — base, build, peak, taper — and include specific workouts like long runs, intervals, and rest days.

Press enter or click to view image in full size

How the Plan Generation Works

The training plan generation isn’t just a templated response — it’s based on structured analysis of the user’s recent training data. Here’s how it works:

  1. Ingest historical workout data from Strava: I pull in the last 6–12 weeks of activities including pace, distance, duration, elevation gain, and heart rate (if available).
  2. Calculate fitness metrics: I use standard models to estimate:
    - Fitness: A rolling average of the last 6 weeks of effort.
    - Fatigue: The past week’s effort to determine the fatigue level of the athlete.
    - Form: Fitness minus fatigue. Determines the readiness for workouts at any given time.
  3. Determine baseline training capacity: These metrics help the AI understand what kind of workload the user can handle. A runner with high fitness but low form may need a short recovery phase before building again.
  4. Dynamic prompt injection: These metrics are fed into Claude via a LangChain prompt template. The prompt includes not just the user’s goals (e.g., a half marathon in 10 weeks) but also their training profile (e.g., “Avg 25 miles/week, recent long run: 9 miles, good base fitness, minor fatigue”).
  5. Generate phased plan: Claude outputs a structured week-by-week plan with increasing long run mileage, intensity intervals, cutback weeks, and tapering — while ensuring that no week exceeds safe progressions (e.g., the 10% rule).
  6. Inject adaptability: The plan is not static. It’s tied to the user’s real-time progress, and the app can re-generate or modify weeks dynamically when workouts are missed or fatigue trends shift.

Interactive AI Coach

Using Claude’s native tool calling feature, I created a chatbot that acts as your virtual coach. It responds to natural-language questions like “Can I move my long run to Friday?” or “How should I adjust after missing a workout?” by retrieving your workout history and reasoning through the best response.

How the Chatbot Reasoning Works

One of the most interesting technical patterns here was separating the logic into a two-step reasoning chain:

  • Native tool call for SQL generation: When a user asks a question, Claude natively calls a tool function to generate a SQL query targeting the workout database. For example, a question like “Did I improve my long run pace over the last month?” causes Claude to trigger SQL generation that pulls long runs in the last 30 days with distance and pace stats.
  • Follow-up reasoning with retrieved data: Once the workout history is fetched, that data is passed back into Claude for the next step — answering the original question. Because the LLM is reasoning over real structured data, it can deliver nuanced and accurate advice far beyond what static memory or embeddings would offer.

This is a practical implementation of Retrieval-Augmented Generation (RAG). Instead of relying on embeddings or general memory, the chatbot retrieves relevant real-time training data and structured plan information, and augments Claude’s reasoning with that context. This includes:

  • Past workouts, recent paces, skipped sessions, and training load trends
  • The current week’s prescribed workouts from the AI-generated plan
  • Metadata like fatigue score, form, and planned vs actual performance

By combining this data-driven retrieval layer with Claude’s language capabilities, the chatbot can provide:

  • Specific schedule adjustments (e.g., “If I run Thursday instead of Saturday, will I be overtraining?”)
  • Context-aware feedback (e.g., “How did I do compared to the plan this week?”)
  • Motivational coaching based on actual progress (e.g., “You nailed your intervals, let’s maintain this intensity next week.”)

This architecture keeps the coach’s responses both personalized and grounded, ensuring they are not just plausible — but actually useful.

Strava Integration & Data-Driven Adjustments

I integrated Strava’s API to pull in real workout data. This lets the app:

  • Track Fitness, Fatigue, and Form
  • Adapt upcoming workouts based on actual performance
  • Evaluate whether you hit your training targets

The Tech Stack

This was a solo project, entirely built using Claude Code. Highlights include:

  • Backend: FastAPI + PostgreSQL
  • Frontend: React (responsive UI for both mobile and desktop)
  • AI: Claude (Anthropic) with native tool calling
  • Data Sources: OAuth integration with Strava API
  • Infra: Deployed on a simple containerized cloud setup

Claude’s tool calling helped drive accurate multi-step workflows, and LangChain was used for supporting context orchestration where needed. Everything — from plan generation to the coach chat — is driven by generative AI.

Product Philosophy: PM-Led, AI-Augmented

This project wasn’t just about coding. It was about solving a real user problem through product thinking:

  • I mapped out user journeys and friction points.
  • Built feedback loops: users can “like” or “disagree” with generated advice, which tweaks future responses.
  • I prioritized tone: the coach sounds friendly and supportive, not robotic.

The goal was to show how AI can actually enhance user experience — not just demo capabilities.

What’s Next?

I plan to experiment with:

  • Daily auto-updates based on your training data
  • Plan re-generation after major changes (e.g. injury, illness)
  • Better visualizations for training load and readiness

Try the App

🔗 Live App: https://fitnesscoach.n8labs.app
You can create an account and explore the AI-generated training plans and coach chatbot.

Final Thoughts

This project is a personal case study in what happens when you combine product management, AI, and a bit of obsession with running. It highlights how a solo PM can prototype meaningful, user-centric AI tools with modern LLM infrastructure.

Get Nate Tang’s stories in your inbox

Join Medium for free to get updates from this writer.

If you’re interested in AI, product-led development, or fitness tech — I’d love to connect.

Thanks for reading.

#GenerativeAI #Claude #LangChain #ProductManagement #FitnessTech

--

--