Skip to main content

Advanced: Claude Code + FitMetrics MCP — Skills & /loop for Autonomous Coaching

The advanced playbook: pair FitMetrics MCP with Claude Code (Anthropic's CLI). Build reusable Skills in your voice, run them on autopilot with /loop, and escalate to Telegram/Discord/Slack when a human is needed.

Written by Xenios Charalambous
Updated this week

Connecting FitMetrics to Claude Desktop via MCP already gives you a superpowered assistant. But if you pair FitMetrics MCP with Claude Code (Anthropic's official command-line client), you unlock something bigger: reusable Skills for your specific workflows, and /loop — a command that runs those Skills on a recurring schedule.

The result is an assistant that wakes up every 30 minutes, checks your whole client roster, handles routine chats in your voice, and pings you on Telegram, Discord, or Slack when something actually needs a human.

This is the workflow coaches have been calling "HOLY CRAP" once they try it. It's also the workflow you're most likely to build wrong on your first attempt — so read to the end.

Prerequisites: finish the MCP setup guide and glance at the Prompt Playbook first. MCP is exclusive to the Business package.


What this unlocks

  • An AI that replies in your voice — not a generic chatbot. You teach it once, via a Skill.

  • Recurring coverage of your client roster — every 30 minutes, every hour, once a day. Whatever cadence you want.

  • Smart escalation — the assistant handles the 80% of routine questions and pings you on your preferred channel when it hits the 20% that need a human.

  • Compounding leverage — each Skill you write is an asset. Build one for client support, one for morning briefings, one for macro recalibration. They keep running.


What is Claude Code?

Claude Code is Anthropic's official command-line client. It runs locally on your Mac or PC, uses your existing Claude Pro / Max subscription (or an API key), and can do three things Claude Desktop can't:

  • Read and write files on your computer

  • Run terminal commands and custom scripts

  • Load Skills — reusable instruction files that teach it specific jobs

It also speaks MCP, so it connects to FitMetrics the same way Claude Desktop does. You can install it from Anthropic's Claude Code page.


Step 1 — Install Claude Code

Follow the official install instructions at anthropic.com/claude-code. Once installed, open your terminal and run claude to start it. Sign in with the same account you use for Claude Desktop.

Already using it for other work? Perfect — you can keep adding Skills to the same setup.


Step 2 — Connect FitMetrics MCP to Claude Code

Generate an MCP API key in FitMetrics → Settings → Integrations → MCP if you haven't already (see the setup guide). Your key starts with fm_ and is only shown once.

Then inside Claude Code, add FitMetrics as an MCP server. The simplest way:

claude mcp add fitmetrics --transport http "https://api.fitmetrics.ai/functions/v1/business-mcp?api_key=YOUR_API_KEY"

Replace YOUR_API_KEY with your fm_ key. Restart Claude Code. You now have all 55 FitMetrics tools available in every session.

Quick check: in Claude Code, ask "list my FitMetrics MCP tools". You should see list_clients, send_message, schedule_macro_change, and the others.


Step 3 — Write your first Skill

A Skill is a markdown file that teaches Claude Code a specific job — your voice, your preferred steps, and when to escalate to you. Skills live in one of two places:

  • ~/.claude/skills/<skill-name>/SKILL.md — global, available in every session

  • .claude/skills/<skill-name>/SKILL.md — project-specific, in whichever folder you're working in

For coaching Skills, use the global path so they're available anywhere.

Here's a starter Skill called trainerize-support. Save it as ~/.claude/skills/trainerize-support/SKILL.md:

---
name: trainerize-support
description: Reply to my clients' Trainerize messages in my voice. Check for unread messages, draft replies with real data, and escalate anything complex.
---

# Trainerize client support

You are my support assistant. Your job is to check FitMetrics for clients who messaged me and haven't been replied to, then draft short, personal replies in my voice.

## Voice and tone
- Warm but direct. No fluff.
- Use the client's first name.
- Reference at least one specific data point — their last workout, their compliance, a weight change, something from a recent message.
- Keep replies to 2–3 sentences unless the topic really requires more.
- Never say "as your coach" or "remember, consistency is key" — I don't talk like that.

## What to do, each run
1. Call list_clients with message_status=needs_reply to find clients waiting.
2. For each one, use get_client_messages to read the last 5 exchanges.
3. Pull their last 7 days of compliance, nutrition, and workouts.
4. Draft a reply that references at least one specific data point.
5. If it's something I must handle personally (see below), escalate instead of replying.
6. Before sending anything, show me the client name and your drafted reply and ask me to confirm.

## When to escalate, don't reply
- Client reports pain or an injury
- Client asks to pause, cancel, or refund
- Billing or account question
- Complaint about coaching or the program
- Anything you're not 80%+ confident about

To escalate, send me a Telegram message with: client name, the message they sent, and a one-line "why I'm escalating".

Save the file. Restart Claude Code. Now you can trigger the Skill by typing /trainerize-support in any Claude Code session, and it'll run through those steps using FitMetrics MCP.

The important part: notice how the Skill contains your voice rules, not just the steps. That's what turns it from "a generic AI" into "your assistant". Paste examples of actual replies you've sent in the past — the more specific, the better the drafts sound like you.


Step 4 — Put your Skill on autopilot with /loop

/loop is a Claude Code command that runs a prompt or Skill on a recurring interval. Used with your Skill, it turns Claude Code into a background assistant that does work without you typing anything.

/loop 30m /trainerize-support

That single line re-runs your /trainerize-support Skill every 30 minutes for as long as Claude Code is open. Each tick: it checks FitMetrics for new unread messages, drafts replies in your voice, and either queues them for your approval or escalates the complex ones.

Common intervals:

  • /loop 30m /trainerize-support — client support every 30 min

  • /loop 6h /adherence-watch — compliance watchdog every 6 hours

  • /loop 24h /morning-briefing — one briefing a day

Stop the loop any time by pressing Esc or closing the Claude Code session. You can also omit the interval to let Claude decide its own cadence based on the Skill.


Step 5 — Escalate to yourself on Telegram, Discord, Slack, or email

The real magic of a background AI isn't that it handles everything — it's that it handles the routine so you can focus on the 20% of chats that need a human. Teach your Skill how to reach you on a channel you actually check.

Pick one:

  • Telegram — create a bot via @BotFather, grab the bot token, and find your chat ID. Add both to a .env file Claude Code can read.

  • Slack — create an incoming webhook URL for a channel or DM.

  • Discord — create an incoming webhook URL on a channel.

  • Email — any SMTP tool or a service like Resend / SendGrid works.

Then add a ## How to notify me section to your Skill. For Telegram, something like:

## How to notify me
Send a Telegram message by calling the Telegram Bot API:
POST https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage
with chat_id=$TELEGRAM_CHAT_ID and text=<the escalation summary>.
The token and chat ID are in ~/.env — source that file first.

Claude Code will chain the FitMetrics MCP reads with the Telegram API call in a single run. You'll get a ping like: "Sarah just reported knee pain — see her last message, I didn't reply."


Workflow recipes to steal

Five real Skills you can build this week. Each follows the same pattern: read from FitMetrics, draft or act, escalate if uncertain.

1. Morning roster sweep

Skill: morning-briefing. Runs once a day with /loop 24h /morning-briefing (or scheduled for 7am). Sends you a Telegram or Slack summary of: clients waiting for replies, clients who missed their nutrition log yesterday, clients trending down on compliance, team activity highlights.

2. Auto-drafted weekly check-ins

Skill: weekly-checkins. Every Monday morning, reads each client's last 7 days of data (compliance, nutrition averages, workouts, weight trend) and drafts a personalized check-in in your voice. Queues each via schedule_message for Tuesday at 9am client-local — you approve in the FitMetrics scheduled messages list.

3. Compliance watchdog

Skill: adherence-watch. On /loop 6h /adherence-watch. Flags any client whose compliance dropped more than 20% week-over-week and pings you with the name, the trend, and a suggested intervention. You decide whether to reach out or let the assistant draft the reach-out.

4. New lead triage

Skill: lead-triage. On /loop 1h /lead-triage. Polls unreviewed AI form submissions, summarizes each, drafts a tailored first-reply in your voice, proposes the best package, queues the reply as a scheduled message, and marks the submission reviewed. Pings you on any lead that scores "high intent".

5. Sunday macro recalibration

Skill: macro-recalibration. Runs every Sunday evening. For each active cutting client, pulls the last 4 weeks of weigh-ins and nutrition, calculates whether the loss rate is too fast, too slow, or on track, and uses schedule_macro_change to queue a calibrated adjustment for Monday at 6am local. Sends you the full decision list in one Telegram message before anything fires — you have until 6am to cancel any of them with cancel_scheduled_macro_change.


Tips for building great Skills

  • Write your voice, not just your steps. Paste 5–10 real replies you've sent. That's what makes drafts sound like you.

  • Always include a "when to escalate" section. A Skill without an escape hatch will eventually reply to something it shouldn't.

  • Start draft-only. For the first two weeks, have the Skill draft and queue replies via schedule_message, not send directly. You'll catch edge cases before they become mistakes.

  • Run it manually before you /loop it. Trigger the Skill a dozen times by hand. Fix every issue. Then wrap it in /loop.

  • Use a coach-scoped MCP key. A key scoped to one coach's clients is a safer blast radius than a business-wide key — if the Skill does something unexpected, it only touches that coach's roster.

  • Log everything to a file. Have your Skill append its actions (client, action, timestamp) to ~/.claude/logs/<skill>.log so you can review what it did overnight.

  • Pause when you're on vacation. Either stop Claude Code, or change the Skill's escalation target so it reaches whoever is covering for you.


Is this safe?

Every write action through MCP is audit-logged. You can revoke your MCP key any time at Settings → Developer → API Keys → MCP — that instantly blocks every running Claude Code session from writing to FitMetrics, no matter where it's running.

Other safety nets already in place:

  • Daily message cap per API key (default 50/day). A runaway Skill can't spam hundreds of messages.

  • Opt-in write access — create a read-only key for Skills that should only analyze, never act.

  • Idempotency on sends — if the Skill retries after a timeout, the same idempotency key returns the cached result instead of double-sending.

  • Coach-scoped keys — scope a key to one coach so the Skill can't touch anyone else's clients.

  • Client exclusion rules — excluded coaches, clients, and tags are filtered out automatically.

Combine those with a draft-only first run, a when to escalate section in every Skill, and a quick eyeball on the audit trail for the first week — and you'll ship this without surprises.


Troubleshooting

Claude Code says "MCP server not found". Restart Claude Code after running claude mcp add. If the problem persists, check that your API key is still active under Settings → Integrations → MCP.

My Skill runs but doesn't see any clients. Your MCP key might be scoped to a coach who isn't assigned any clients. Create a new key without the coach restriction (or assigned to the right coach) and update your Claude Code MCP config.

/loop keeps crashing / pauses. Make sure your computer isn't sleeping. On Mac, run caffeinate -d in another terminal to keep the display awake while the loop runs. On long unattended runs, a cloud box (small VPS) is more reliable than a laptop.

The Skill's replies still don't sound like me. Add more examples. The single biggest lever is pasting real past replies into your ## Voice and tone section.


See also

Did this answer your question?