run-services

A workflow for starting a project's local frontend, backend, and documentation services together.

In plain words
What is it for?
Use it to prepare Python and JavaScript dependencies, choose available port groups, stop conflicting processes when needed, launch the services, and check that each one is healthy.
Why use it?
It checks dependencies and ports before startup, diagnoses common failures, and retries after recovery steps, reducing manual setup and troubleshooting.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/reflexioai/claude-smart/run-services
Any agent
npx skills add ReflexioAI/claude-smart --skill run-services
Clone the repo
git clone --depth 1 https://github.com/ReflexioAI/claude-smart

Made for: Claude Code, Codex.

Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,353 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00038 $0.02353
Opus 5 $0.00019 $0.01177
Sonnet 5 $0.00008 $0.00471
Haiku 4.5 $0.00004 $0.00235

Measured yesterday against content hash aeaa65a8a33a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

run-services scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf reflexio/website/.next reflexio/public_docs/.next

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

Check each service individually. Use `curl --max-time 10 -s -o /dev/null -w "%{http_code}"` to get HTTP status codes.
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.claude/commands/run-services/SKILL.md · 248 lines

How it starts

The opening of the file, as written. The whole thing — 248 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Run Services

Start all local development services with pre-flight dependency checks and automatic error recovery.

Overview

This command automates the full startup workflow: 0. Smart port selection — auto-detects free port group or reuses current worktree's ports

  1. Pre-flight dependency checks (uv sync, venv, npm, worktree editable packages)
  2. Stops any existing services (only if needed)
  3. Starts all services via run_services.sh
  4. Health-checks each service
  5. Diagnoses and fixes failures, then retries (up to 2 retries)

Port Configuration

Ports are allocated in groups of 3 with a +10 offset between groups:

Group Frontend Backend Docs
Default 8080 8081 8082
+10 8090 8091 8092
+20 8100 8101 8102
+30 8110 8111 8112
+40 8120 8121 8122
Service Env Var Base Port
Frontend (Next.js) FRONTEND_PORT 8080
Backend (FastAPI) BACKEND_PORT 8081
Docs (Fumadocs) DOCS_PORT 8082
Step 0 (Smart Port Selection) determines which group to use automatically, unless ports are already set via environment variables.

Execution Steps

Step 0: Smart Port Selection

Pre-check: If BACKEND_PORT, FRONTEND_PORT, or DOCS_PORT are already set in the environment, skip auto-detection entirely and use those values directly. Report "Using pre-configured ports" and proceed to Step 1.

0.1 Get current worktree root:

WORKTREE_ROOT=$(git rev-parse --show-toplevel)

0.2 For each port group (offset 0, 10, 20, 30, 40 — max 5 attempts), check all 3 ports in the group. For each port, determine its status:

PID=$(lsof -t -i:$PORT 2>/dev/null | head -1)

If no PID → port is free.

If PID exists, get the process's working directory:

PROC_CWD=$(lsof -a -p $PID -d cwd -Fn 2>/dev/null | tail -1 | sed 's/^n//')

Then classify:

  • own$PROC_CWD starts with $WORKTREE_ROOT (use prefix match, since child processes like Next.js run from subdirectories like $WORKTREE_ROOT/reflexio/website)
  • other$PROC_CWD does NOT start with $WORKTREE_ROOT

Read the full file on GitHub · 248 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 248 lines · 38 tokens per session scan C aeaa65a8a33a

Subscribe to this mod's changes

run-services is a skill published in the GitHub repository ReflexioAI/claude-smart (774 stars, last pushed 3d ago), licensed Apache-2.0. It adds 38 tokens to every session and 2,353 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.