← ClaudeAtlas

work-isolate-environmentlisted

Give this session its own lane of local dev ports, so two or more stacks can run at once instead of fighting over :3000. Allocates a stable slot per worktree, wires each service through the env knob it already reads, sweeps whatever a dead session left behind, and tears down clean. Use for "isolate my environment", "give this session its own ports", "run two stacks at once", "EADDRINUSE", "AxiosError Network Error", or when a second dev server will not boot. Works in any repo, personal or work, containerised or not.
skowalskidev/dotclaude · ★ 2 · Data & Documents · score 78
Install: claude install-skill skowalskidev/dotclaude
# Isolate this session's environment **Why this exists:** several sessions run at once in different worktrees, every one of them wants `:3000` and `:4000`, and none of them can see the others. The second stack to boot gets `EADDRINUSE`, or worse an opaque `AxiosError: Network Error` that reads like a bug in the code rather than a neighbour holding the port. The fix is a **lane**: slot N means `base + N*10` for every base port the project uses, so slot 1 of a `{web 3000, api 4000}` project is `{3010, 4010}`. **Git worktrees give code isolation, not environment isolation.** That gap is the whole problem. ## What is already built, and what is yours to do `~/.claude/bin/port-slot.sh` owns the deterministic half and you should never re-derive it: picking a slot, arbitrating it against `port-registry.sh`, sweeping what previous sessions left, recording the run. `~/.claude/references/dev-server-hygiene.md` owns the protocol, including the liveness table the sweep implements and the preflight and teardown rules. **Yours is the judgement half:** which services in THIS project bind a host port, which env knob carries a port into each one, which ports cannot move at all, and what to do when the answer is "nothing here can be isolated without a bigger change than you were asked for". ## Phase 0 — sweep and take a lane ```bash ~/.claude/bin/port-slot.sh # sweeps, then prints the lane. Claims nothing yet. ``` Read the sweep output aloud to Simon if it did anything.