arthai-marketplace

/restart

Discover, restart, and validate local dev servers. Auto-detects Docker vs native, checks health, catches crash loops.

Synopsis

/restart [service] [--preflight]

Both arguments are optional — with none, it restarts all discovered services.

When to use it

Quickstart

/restart

What you’ll see: the services discovered from CLAUDE.md (or auto-discovered from your repo), a pre-flight validation pass, restarts in dependency order, then a final status table where every service reads STABLE after an 8-second crash-loop check.

Examples

/restart                 # discover → validate → restart all services
/restart backend         # restart only the backend (plus any down dependencies)
/restart --preflight     # validate only — Docker, deps, env files, ports; restart nothing
/restart backend --preflight  # validate only the backend (and its dependencies) without restarting anything

Arguments & flags

Flag Values Default What it does
[service] a service name all services Restarts only the named service (and its dependencies if they’re down)
--preflight off Discovery and validation only — doesn’t stop or start anything

What it does

  1. Discovers services — reads the Local Dev Services table in CLAUDE.md; if missing, scans the repo (docker-compose, package.json, Makefile, pyproject.toml, .env, monorepo configs) to find each service’s type (Docker vs native), port, start command, health check, and dependencies. When discovery is ambiguous, it presents what it found and asks for confirmation — a user-confirmation checkpoint. Confirmed discoveries are written back to CLAUDE.md so future runs skip this step.
  2. Pre-flight validation — checks:
    • The Docker daemon is running
    • Dependencies are installed (node_modules / venv)
    • .env files exist
    • Ports are free

    If a port is held by an unexpected process, it warns you before killing it. With --preflight, it stops here and reports.

  3. Restarts in dependency order — stops services in reverse order, verifies ports are freed, then starts infrastructure → backends → frontends, waiting for each layer’s health check before starting the next.
  4. Validates health twice — an initial per-service health check, then a re-check 8 seconds later to catch crash loops. If a service crashes, it reads the logs, reports the actual error with a suggested fix, and does not retry automatically.

Output & artifacts

Troubleshooting

Problem Fix
Docker: NOT RUNNING Start Docker Desktop and re-run — /restart won’t proceed without the daemon
node_modules: MISSING / venv: MISSING Run npm install (or set up the venv) in the service directory, then retry
A service shows CRASHED after restart Read the error in the report — it’s pulled from the service’s logs (e.g. a missing module means installing deps); fix and re-run
WARNING: port <port> still occupied Another process is holding the port — the report identifies it; stop it or confirm the kill
A service shows SKIPPED One of its dependencies failed — fix the dependency first; dependents are never started on a broken base. Example: if postgres crashes and backend depends on it, backend shows SKIPPED — fix and re-run postgres first, then /restart backend