One slot per ticket
new <branch>takes the main checkout when it is free, a slot with--slot- A new slot copies the files git doesn't carry, runs its setup and writes its
.env.local - It ends with the window to open and the session's name
git-slot gives each ticket its own long-lived git worktree, its own ports, and points the repos of the ticket at each other through .env.local. Your API on 3011, its web app on 4110 calling it, while main keeps running on 3001.
~/src/acme/server main checkout (slot 1) api on 3001
~/src/acme/web main checkout (slot 1) web on 4100, API_URL=http://localhost:3001
~/src/acme.wt/server-2 slot 2, branch 12-login api on 3011
~/src/acme.wt/web-2 slot 2, branch 12-login web on 4110, API_URL=http://localhost:3011 (linked)
Two tickets, two Claude Code sessions, the same two repos: each slot runs its own servers on its own ports, and its web app talks to its own API.
A slot's path never changes: its IDE window, Unity Hub entry and build caches stay valid from one ticket to the next. The branch carries the ticket.
Declare a service's port once; slot n adds 10 × (n − 1). A database gets its own name per slot too: {database:DATABASE_URL}.
{url:server/api} points at the sibling repo's checkout of the same ticket: git-slot link both ways, .env.local rewritten on each side.
git-slot done merges the branch (fast-forward, or --no-ff with #12: Merge branch), pushes, deletes it and frees the slot, links reset.
Name the branch after your issue (12-login): git-slot reads the number for the merge message and the session name. Issues stay GitHub's, GitLab's or yours.
It only writes a marked block in a git-ignored .env.local: a clone without git-slot runs on its default ports, exactly the same.
A real run on a made-up workspace: an "acme" project of two repos, server (an API and a database) and web.
new <branch> takes the main checkout when it is free, a slot with --slot.env.local$ pnpm git-slot new 12-login --new-slot
[git-slot] creating server-2 at ~/src/acme.wt/server-2
[git-slot] .env.local: PORT=3011
[git-slot] .env.local: WEB_URL=http://localhost:4100
[git-slot] server-2 is on 12-login
open: code "~/src/acme.wt/server-2" (then start the branch's Claude session there)
/rename: server-2 #12 login
--link server-2: the web slot calls the API slot, and back--repos server=12-login,web=12-login does both repos in one go from a workspace repo$ pnpm git-slot new 12-login --new-slot --link server-2
[git-slot] creating web-2 at ~/src/acme.wt/web-2
[git-slot] .env.local: PORT=4110
[git-slot] .env.local: API_URL=http://localhost:3011
[git-slot] server-2 links: web-2
[git-slot] .env.local: PORT=3011
[git-slot] .env.local: WEB_URL=http://localhost:4110
$ pnpm git-slot list
slot branch state links last session
web-2 12-login clean server-2
$ cat ../acme.wt/web-2/.env.local
# local services: start (generated: override a key on a line below the block)
PORT=4110
API_URL=http://localhost:3011
# local services: end
free parks a ticket instead: the branch is kept$ pnpm git-slot done web-2
[git-slot] merging 12-login into main (--ff-only)
[git-slot] server-2 links: none (main checkouts)
[git-slot] .env.local: PORT=3011
[git-slot] .env.local: WEB_URL=http://localhost:4100
[git-slot] .env.local: PORT=4110
[git-slot] .env.local: API_URL=http://localhost:3001
[git-slot] 12-login merged and pushed, web-2 is free
pnpm add -D github:lxtzfr/git-slot#v6.1.0, with "git-slot": "git-slot" in scripts and the package allowed to build ("pnpm": { "onlyBuiltDependencies": ["@lxtzfr/git-slot"] })..env.local in its package.json:
"localDev": {
"services": { "api": { "port": 3001, "run": "pnpm start:dev" } },
"env": { "PORT": "{port:api}", "WEB_URL": "{url:web/web}" },
"slot": { "setup": ["pnpm install"] }
}.env.local before .env (Vite does it already), then pnpm git-slot new <branch> --new-slot.git-slot skill (skills/git-slot/SKILL.md) to link into .claude/skills/.Every command and the library (resolveEnv, serviceHost…) are in the README. porlocal builds on it to lease free ports and give each service a local name.