Skip to content

CreatorTrack dev-slot teardown (script + chat.justin button)

URL: https://mkdocs.justinsforge.com/memory/general/reference_creatortrack_agent_teardown/

A CreatorTrack parallel-dev slot = a git worktree under ~/forge-suite-wt/<branch> + its own next dev server (port in the worktree's .env.local) + a ct_<branch> clone DB. Built by forge_creatortrack_agent_bootstrap.sh <branch> <port>.

Teardown script (single source of truth)

scripts/forge_creatortrack_agent_teardown.sh <branch> [--keep-db] , the inverse of bootstrap. Keyed by branch, so it derives the same server/worktree/DB the bootstrap made:

  • DB = ct_<branch> (non-alnum -> _, lowercased)
  • worktree = ~/forge-suite-wt/<branch>, port read from that worktree's .env.local

Steps: kill the dev server on that port, git worktree remove --force, drop the ct_<branch> DB (terminates lingering connections first). Idempotent (safe twice, safe if pieces already gone). Guards: refuses main/master, only ever drops a ct_* clone, never lifeos or creatortrack_dev_base. Keeps the branch (merge or delete it separately). --keep-db leaves the clone DB to inspect data later.

chat.justin "Dev slots" button (2026-07-05)

The launcher (forge_session_launcher_api.py + sites/justinsforge.com/chat/launcher.js) surfaces slots so teardown is one tap from mobile:

  • GET /api/dev-slots , lists worktrees under ~/forge-suite-wt with branch, port, DB name, and live server status (one ss -ltnH probe).
  • POST /api/dev-slots/teardown {branch, keep_db?} , runs the teardown script, but ONLY for a branch that is an actual current slot. Rejects trunk (400) and unknown branches (404). Branch is passed as an argv element (never a shell string); the script's own guards are defense in depth.
  • UI: collapsible "Dev slots (N)" section (lazy-loaded on open), each slot a card with a red Teardown button -> confirm modal ("keeps the branch") -> POST -> refresh.

Lives in chat.justin because that is Justin's mobile session/slot control surface. See also launcher claude-status sync, CreatorTrack dev testing.