/berth:berth-portsfrom berth
Use before starting any dev server, database or Compose stack, when a port is "already in use", when asked which port a service is on, or when a server must be reachable at a predictable URL. Gives this checkout its berth ports, checks who holds a port, and records claims. Never kills processes.
Ships in berth. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
berth gives every project a permanent block of ports and records who holds what. It is advisory: it tells you the truth and never blocks or kills. Your job is to use the ports it assigns and to report what you actually bound.
berth is on this session's PATH when the plugin is installed; the MCP tools berth_env, berth_who, berth_check, berth_ls, berth_claim and berth_release do the same jobs if you prefer tools to a shell.
PORT, WEB_PORT, API_PORT, DB_PORT, CACHE_PORT, SMTP_PORT, MAIL_UI_PORT, DOCS_PORT, WORKER_PORT, OTLP_GRPC_PORT, OTLP_HTTP_PORT, plus BERTH_BLOCK. Otherwise run:
eval "$(berth env --shell)"
If that says the directory is not a project, use the berth-onboard skill (registers the repo) or take a scratch port: berth claim --dynamic 1.vite --port "$PORT" --strictPort (or server: { port: Number(process.env.PORT), strictPort: true })next dev -p "$PORT"uvicorn app:main --port "$API_PORT"process.env.PORT; never fall back to a hardcoded numbereval "$(berth env --compose-override)" then docker compose up; it writes an !override file and sets COMPOSE_FILE, no repo editsberth claim --role api (or web, db, cache, smtp, mail-ui, docs, worker, or --extra <name> for a service with no canonical role).http://localhost:14001.Do not increment the port and do not kill anything. Ask berth:
berth who <port>
It prints the lease, the live holder (process, container or session), the evidence, and one advisory command. The states:
| State | Meaning | What to do |
|---|---|---|
ok | expected owner is bound | use a different role port; this one is taken legitimately |
idle / stale | leased, nothing bound | berth release --port N only if the lease is yours; otherwise report it (or show the plan below) |
overstay | scratch lease past its TTL, claiming process gone, server still up | not yours: report it with the advisory command; never kill it |
orphan | lease cwd is gone | report it; show the plan below for a human to apply |
unmanaged | bound, no lease, in a managed range | if you started it, berth adopt N --owner session; otherwise report |
squatter / conflict | someone else is in this block | report the holder; do not kill |
drift | config and allocation disagree | report; berth scan --write is the human's fix |
berth check lists everything that needs attention; it always exits 0.
When a scratch server is done: berth release --port <port>. Ports claimed by role stay leased for the checkout; releasing them is optional.
stale and orphan leases (nothing bound, owner gone or the lease's cwd is missing) and unmanaged listeners pile up over a session or after a migration. Show what a human could clean up in one command:
berth tidy --dry-run --json
It prints the plan: which leases it would release (any owner), and which unmanaged ports it can only suggest adopting (adoption needs a decision about the owner, so berth never does that for you). Tell the human what --dry-run showed and that the same command, without --dry-run, applies the release half; it is human-only (ADR-008), so ask them to run it themselves — do not run it yourself.
~/.claude/settings.json or an existing project number in the policy, never apply tidy yourself (only --dry-run is agent-available). Those are human decisions; the CLI refuses the corresponding commands inside an agent session, and the right move is to report and ask.berth env can tell you.What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (amiable-dev/berth) — no native marketplace selected
npx claudepluginhub p/amiable-dev-berth2 skills in this plugin