| name | dev-server |
| description | Manage the frontend dev server idempotently. Use instead of npm run dev to prevent port conflicts. |
IMPORTANT: Use this instead of directly running npm run dev to prevent multiple dev servers from spawning on different ports.
Commands
Start Dev Server (Idempotent)
Use this to start a dev server. It will:
- Check if a server is already running on port 5173
- Kill any stray servers on other ports
- Start a new server only if needed
cd /workspaces/tracked/frontend && npm run dev:ensure
Check Status
cd /workspaces/tracked/frontend && npm run dev:status
Stop Dev Server
cd /workspaces/tracked/frontend && npm run dev:stop
Kill All Orphaned Servers
If things get messy with multiple servers:
cd /workspaces/tracked/frontend && npm run dev:cleanup
Or the nuclear option:
pkill -f 'vite'
For Claude Agents
Before Starting a Dev Server
Always check first:
curl -s http://localhost:5173 > /dev/null && echo "Running" || echo "Not running"
If not running, use:
cd /workspaces/tracked/frontend && npm run dev:ensure
Never use:
npm run dev