Claude Code tab manager. Terminal tabs as the UI, no tmux.
| Package | Source | Released by |
|---|---|---|
@generativereality/cctabs |
src/ |
the CLI. release.yml, on a v* tag. |
tabby-cctabs |
tabby-plugin/ |
the Tabby-side plugin. release-tabby-plugin.yml, on a tabby-v* tag. |
Both publish from CI with no token — trusted publishing, each gated on the release
environment. (Local tokens used to matter and the trap is worth remembering if you
ever publish by hand: tabby-cctabs is unscoped, so a token scoped to
@generativereality 403s on it.)
They version independently and are published separately. A CLI release does not require a plugin release — the CLI feature-detects what the plugin can do (see Plugin capabilities) and degrades rather than breaking.
Publishing is CI's job. Never npm publish by hand — .github/workflows/release.yml
publishes via npm OIDC trusted publishing, so there is no token to hold, and the
job is gated on the release environment. That gate is the whole release control:
pushing a tag queues a publish, it does not perform one. (It exists because on
2026-08-22 three versions went out inside forty minutes with nobody approving them
— tagging was the only control, and anything that could push a tag could publish.)
- Make changes in
src/and/orskills/ - Bump the version in both
package.jsonand.claude-plugin/plugin.json— the second is whatsync-plugin.shcopies to the marketplace, andprepack's sync check fails the publish if it lags - Fold
CHANGELOG.md's## Unreleasedinto a dated## <version> — <date>section - Run
npm run sync-plugin— pushes plugin.json + the wholeskills/cctabs/directory (SKILL.md andreferences/) to../plugins - Commit and push this repo first, then
git tag -a v<version>and push the tag — push main before the tag, or the run publishes a commit that isn't on main yet. The workflow verifies the tag matchespackage.json - Approve the run in the Actions UI. Until someone does, it sits at
waitingand nothing is published — a queued run is not a release - Users update via Claude Code:
/plugins→ Marketplaces → Update generativereality → update cctabs plugin. The CLI separately:npm i -g @generativereality/cctabs@latest. Right after a publish that can failETARGET … No matching versionfrom npm's local metadata cache while the registry already serves it — add--prefer-online.
A tarball for testing before a release (e.g. to install into the Windows guest):
npm pack --ignore-scripts. Plain npm pack runs prepack, whose marketplace sync check
fails until the release's sync-plugin — and syncing early would publish the skill to users.
A tag can be cut and its run never approved — that has happened, and the tag then sits pointing at a commit that later work lands on top of. Approving it afterwards publishes the old tree under the new number.
When a version was tagged but never published, re-point that tag rather than burning the number:
npm view @generativereality/cctabs versions # confirm the version really isn't there
gh run cancel <waiting-run-id> # the stale queued run, so nobody approves it later
git tag -f -a v<version> -m "…" <new-sha> && git push -f origin v<version>Safe only while npm has never seen the version — nothing is being rewritten under anyone. Once it is published, the number is spent: bump instead. Force-pushing a tag re-fires the workflow, so a fresh run appears for approval.
Note: Claude Code only discovers skills from directory-sourced plugins in the marketplace repo (npm source doesn't support skill discovery). The sync-plugin script keeps generativereality/plugins in sync. Requires the plugins repo checked out at ../plugins.
npm run sync-plugin pushes to generativereality/plugins. When that clone has
drifted — a sync commit made here that was never pushed, while another machine
pushed its own — the push is rejected and git pull --rebase conflicts in
SKILL.md and plugin.json.
Do not resolve those conflicts. Both sides are generated copies of files that live here; hand-merging them invents a third version matching neither source. The marketplace copy has no independent content to preserve, so:
cd ../plugins
git rebase --abort # if a rebase is in progress
git log --oneline origin/main..HEAD # confirm the only local commits are `chore: sync …`
git reset --hard origin/main
cd - && npm run sync-plugin # regenerates from source and pushesThen verify rather than assume — bash scripts/sync-plugin.sh --check, and
diff -rq skills/cctabs ../plugins/plugins/cctabs/skills/cctabs.
Check that origin/main..HEAD line before resetting: it is what makes this safe.
A local commit that is not a sync — an edit made directly in the marketplace
repo — would be destroyed, and the reset is the wrong tool for that case.
sync-plugin committed 0.5.5 on top of a stale main. The script does
not pull first, so any clone that is one release behind diverges the moment it
syncs — no unpushed work and no mistake required.
⇒ So the cheap prevention is git -C ../plugins pull --ff-only before a release,
and the conflict above is what you get for skipping it.
See also generativereality/plugins's own README, which covers the other
marketplace failure: ~/.claude/plugins/marketplaces/<name> is a git clone and
marketplace update is a pull, so a force-push to that repo leaves every existing
clone unreconcilable. That one is about consumers of the marketplace; this section
is about publishing to it.
Only needed when tabby-plugin/src/ changed. Its version is independent of the
CLI's, and npm forbids republishing a version, so if the currently published
version already exists with different contents, bump — don't reuse it.
Publishing is CI's job now — .github/workflows/release-tabby-plugin.yml, triggered by a
tabby-v* tag and gated on the release environment, same as the CLI. Bump
tabby-plugin/package.json, push tabby-v<version>, approve the run. No token anywhere.
The no-gaps rule above applies here too: a tabby-v* tag whose run was never
approved should be re-pointed, not abandoned for the next number.
Publishing a plugin release does not ship it to anyone. The CLI installs a pinned
version — TABBY_PLUGIN in src/core/tabby-plugin-dir.ts — never the latest, because
the plugin runs inside Tabby with the user's full rights and a release should be taken
on deliberately. So a plugin release is two steps: publish tabby-v<version>, then bump
TABBY_PLUGIN in the same PR as the CLI change that needs it, and cut a CLI release.
Also update the version spelled out in skills/cctabs/references/install.md;
src/core/tabby-plugin-pin.test.ts fails until you do.
To build locally (for sideload, or to check a change before tagging):
# once: Tabby at this exact path, at the ref CI pins (TABBY_REF in the workflow)
git clone --depth 1 --branch v1.0.235 https://github.com/Eugeny/tabby.git related-repos/tabby
cd related-repos/tabby && yarn install && npm run build:typings && cd -
cd tabby-plugin
npm install --legacy-peer-deps # peers come from Tabby; only `uuid` installs
../related-repos/tabby/node_modules/.bin/webpack # `npm run build` alone fails: webpack isn't a local dep
npm run sideload # copy into Tabby's plugins dir for local testingThree things that each cost a failed build to discover, so they are worth stating plainly:
-
Tabby must live at
related-repos/tabbyexactly.webpack.config.mjsadvertises aTABBY_REPOoverride, buttsconfig.jsonhardcodes../../related-repos/tabby/...in itspaths. Setting TABBY_REPO moves webpack's resolution and leaves TypeScript's behind, and you getCannot find module '@angular/core'from a webpack run that is otherwise fine. -
npm run build:typingsin Tabby is not optional. Its workspace packages pointtypesattypings/index.d.ts, absent from a fresh clone. Skip it and the build fails onCannot find module 'tabby-core'— after the Angular errors clear, so it reads as a new problem. -
--legacy-peer-depsis required. The plugin's peers are all"*", so npm resolves each independently, lands on conflicting Angular majors (seen: 20.1.8 vs 22.1.3) and fails ERESOLVE. Those peers are webpackexternals, supplied by Tabby at runtime. -
dist/is gitignored, and CI builds it from source — so a stale localdist/can no longer be published by accident, which was the old failure mode. The workflow also refuses to publish an empty bundle, sincefilesshipsdist/alone and npm would happily accept nothing. -
Keep
PLUGIN_VERSIONintabby-plugin/src/server.tsin step withtabby-plugin/package.json— it's what/api/healthreports. It has now drifted twice: once a release behind, once a release ahead (a renumbered release caughtpackage.jsonand missed the constant). Neither broke anything, because capabilities are feature-detected rather than version-compared — which is exactly why both survived review. Guarded now bysrc/core/plugin-version.test.tsand, because the plugin's release workflow never runs the test suite, by that workflow's own pre-publish check. The 0.1.4 tarball on npm announces itself as0.1.5(its bundle was built a release ahead). Resolved 2026-09-23: 0.1.5 — thestable-pidrelease — is published, and its bundle'sPLUGIN_VERSIONis0.1.5(checked by unpacking the tarball). Only an installed 0.1.4 still misreports itself, and updating the plugin fixes that. -
Six commits on
maincarry a work-identity author address instead of the canonicalMotin <motin@motin.eu>(110 commits). The address is not repeated here: this file is public too, and there is no reason to add another plaintext copy of it. Nothing new is being added: squash-merges land asmotin@motin.eu. Removing the existing six means rewriting history and force-pushing, which last time left a second machine's marketplace clone diverged and needing manual realignment. Open decision, not urgent. -
Sideloading only changes files on disk; Tabby must be restarted/reloaded to run the new plugin.
skills/cctabs/SKILL.md is synced to the marketplace and included in the npm
tarball, so a stale claim in it reaches every user. It has twice described
behavior that had already been inverted by an unreleased commit. Re-read the
sections your change touches.
Claude Code truncates a skill description at 1535 characters in the
available-skills listing and appends …. There is no warning: the skill still
loads and still works when invoked by name, so the loss is invisible unless you
go read a transcript's skill_listing attachment. Ours silently overran for
several releases and the amputated tail was the anti-substitution rule — the one
thing the description exists to say.
Rules for editing it:
- Keep it under ~1450 so there is headroom, and re-measure after any edit.
- Put the load-bearing sentences first. Order is the only truncation protection there is. The TRIGGER list is long but individually cheap to lose a tail of; the "a subagent is NOT a tab" rule is not, so it goes above it.
- Lead with the literal words a user would type (
cctab,cctabs,tab). In a project with dozens of its own skills this entry can land 75% of the way down 80+ entries, and the first clause is what registers.
Note what this can and cannot fix: the full listing is injected once per
session and is not re-injected after a compaction — only single-skill
recall deltas are. A long session that has compacted has no listing at all, and
no description wording reaches it. That is why cctab exists as a real bin
alias: probing the shell is the only discovery path left in that state.
/api/health returns {ok, version, capabilities: [...]}. The CLI probes it via
TerminalAdapter.backendCapabilities() and adapts, because a user's installed
plugin is routinely older than the CLI talking to it. Add behavior that depends
on a plugin fix as a new capability token, never as a version comparison.
-
tab-color— tabs carry a colour: reported on/api/tabs, accepted byPOST /api/tabs/new, and settable viaPUT /api/tabs/:uuid/color.--colorandcctabs colorprobe for this and degrade with one warning, because an older plugin drops the unknowncolorfield silently — indistinguishable from a colour that was applied and didn't render.The colour is assigned straight to
BaseTabComponent.color, which is literally what Tabby's own right-click → Color menu does (tabby-core/src/tabContextMenu.ts), so a cctabs-set colour is indistinguishable from a hand-set one.src/core/colors.tsmirrors Tabby'sTAB_COLORShex values, not just its names: that menu ticks its radio by comparingtab.color === color.value, so a different blue would colour the tab and still leave the menu showing no selection. Tabby persists the colour viatabRecovery.service.ts(token.tabColor) on a 30s save timer — thecolorsetter, unlikepinned, doesn't request an earlier save, so a colour set just before a hard quit can be lost. That's upstream behaviour and matching it is deliberate. -
stable-pid—/api/tabsreports each tab'sshellPid(pty.getPID(), the process the PTY spawned) and/api/tabs/identifymatches on it first. The olderpidfield is Tabby'sgetTruePID(), whichtabby-electron/src/pty.tscomputes once, two seconds after spawn, by descending through single-child chains — for azsh -c claude …tab that lands on Claude's owncaffeinate -t 300helper, dead five minutes later. Measured: 52 of 57 tabs reported a pid that no longer existed, andwhoamiansweredunknownin a tab with a clean process chain. Without the capability the CLI falls back to argv (src/core/claude-procs.ts): a Claude's--resume <id>is exact, its--nameis a spawn-time snapshot and is only trusted when unique both ways. -
screen—GET /api/tabs/:uuid/screenreturns the tab's visible rows from its xterm (tab.frontend.xterm), with dim ranges marked;attached: falsefor a tab whose frontend never attached.sendandrenameread it (src/core/input-draft.ts) to avoid typing into an unsent draft. It has to be the screen:/bufferis the PTY stream with escapes stripped, and Claude redraws its input line by diffs, so a typed draft shows up there with its spaces gone and a backspace leaves no trace. Claude's empty-box placeholder is dim, which is the only thing that tells it from a draft. To check a change here without restarting Tabby (which kills the fleet), replay a realclaudePTY capture through@xterm/headlessat Tabby's xterm version and runreadScreenon it. -
spawn-waits-for-pty—POST /api/tabs/newserialises concurrent creates and doesn't respond until the new tab's process is actually running. Restore spawns in parallel only when this is present; otherwise one at a time with a settle gap.Why it exists: a Tabby terminal tab spawns its PTY only after its xterm frontend attaches, which
BaseTerminalTabComponent.ngOnInitdefers until the tabhasFocus— andAppService.addTabRaw → selectTabblurs the outgoing tab synchronously but emits focus from asetImmediatethat reads_activeTabat callback time. Two creates in one event-loop turn means the first tab is never focused, never attaches, and never spawns a process at all. The upstream sources are readable via the sourcemaps in/Applications/Tabby.app/Contents/Resources/builtin-plugins/*/dist/index.js.map.⚠️ Not a guarantee in a Tabby that has only just started. On Windows (11 ARM64, Tabby 1.0.238, 2026-10-15) the first tab a restore spawned seconds after Tabby launched never got a process: noshellPid, empty buffer, while the next one started. In a Tabby that had been running, two concurrent creates both started (checked the same day). The plugin's wait gives up after 20s and returns the tab anyway, so the CLI cannot treat "the create returned" as "it started":restore --pendingmakes a second pass, which sees the process-less tab and recreates it. Anything else that spawns into a freshly (re)started Tabby needs the same.
src/index.ts— CLI entry pointsrc/commands/— subcommands (new,fork,close,send, etc.)src/core/— core logic (session management, Wave / Tabby adapters)src/core/restore-plan.ts— the restore planner: read-only by construction, which is what makes--dryfaithful.restore.tsbuilds entries (from a manifest, or from scanned tabs) and both feed this one planner;--drystops right after it. Don't add mutations here.src/core/config-dirs.ts— every Claude config dir on the machine (default + one per backend preset that setsenv_CLAUDE_CONFIG_DIR). Session discovery searches all of them and reports which one each session came from; that origin is the backend inference, and it must travel with a session id all the way to launch — resuming an id under the wrong config dir doesn't fail, it silently opens a fresh conversation.src/core/session-copy.ts— moving a session between Claude config dirs. Every function there encodes a failure that has actually happened, so read the comments before changing one: the sidecar (<session-id>/beside the .jsonl, holdingsubagents/+tool-results/— one session had 357 files) is lost by any copy that only takes the transcript; the copy's target slug is the last recorded cwd that still exists, not the transcript's own slug, because--resume404s on a slug whose directory is gone (observed on an older Claude Code — 2.1.280 was measured resolving--resume <id>across every project dir of its config dir, so the risk that remains is the config dir, not the slug); and a metadata-only trailer (custom-title,agent-name,permission-mode, no messages) is what a closing Claude writes back to the old path after the tab is reported closed — it carries a customTitle with a fresh mtime and therefore shadows the session that was just moved; and thebridge-sessionentries (the source account's Remote Control pointer) are left out of the copy, because Claude Code (2.1.296) treats a pointer owned by another account asrestored_owner_mismatch, permanently history-suppresses the session and registers RC under a random name instead of the customTitle. It is deliberately fs-pure and unit-tested; terminal-side waiting lives insrc/core/tab-exit.ts.src/commands/restart-tabby.ts+src/core/fleet-state.ts—restart-tabby/prepare-reboot/restore --pending. Every rule here is a failure from the first live runs (2026-10-15), so keep them: the save is checked against Tabby's own tab list after capture (a short read once produced a 0-entry manifest reported as saved); only tabs with a session are saved (a plain shell came back as a fresh Claude at the trust dialog); the worker closes the last tab itself (a tab with a running process makes Tabby's quit ask "still running. Close?") and then waits 3s (Tabby saves its recovery list 1s debounced after a change, and quitting sooner relaunches the closed tabs); Tabby is reopened with a clean environment (tabbyLaunchEnv— reopened from inside Claude it inheritedCLAUDE_CODE_CHILD_SESSIONand every Claude in it saved no transcript); andrestore --pendingmakes one extra pass (seespawn-waits-for-ptyabove). Live-tested only by actually restarting Tabby, which ends the calling session — the session resumes in the restored tab.scripts/windows-guest/— the rig that tested cctabs on Windows 11 ARM64 (staging, setup, arestart-tabbyrun). Read its README before touching the shared Windows VM: snapshot before, revert after.src/core/context-usage.ts— thectx 42%insessions/list, read from the session file's tail (Claude: the last main-thread assistantusage, input + both cache kinds + output; Codex: the lasttoken_count, which carriesmodel_context_window). Claude's window comes from its"attachment":{"type":"model"}entry (modelIdends[1m],marketingNamesays1M context), which is written at session start and after each compaction, so it can sit megabytes behind the last turn: measured 4,000 lines back in a 13 MB transcript, where reading only the tail and head showedctx ~66%for a session at 13%. Trust the attachment over the process's--model: a tab launched--model opus[1m]recorded plainclaude-opus-5-5, which is the window Claude Code then compacts at.requestedModelandmessage.modelnever carry[1m].src/core/tab-exit.ts— waits for a tab to close and its pid to disappear.adapter.deleteBlock()returning is not the process exiting, and the gap is long enough for the trailer above to be written into it.src/core/tab-match.ts— shared tab-name matching. Deciding "does this session's tab already exist?" must use{exact: true}; the prefix fallback is only for hand-typed targets.src/core/suspend.ts/src/core/suspend-ops.ts— suspended tabs.suspend.tsis pure (registry files, the placeholder script, process detection, tab matching) and unit-tested;suspend-ops.tsdrives the terminal (suspend, wake, dormant revive). The screen is never the source of truth for "suspended" — a background Tabby tab captures nothing — so the placeholder carriestrue cctabs-suspended <id>at the head of its argv and the registry keeps one file per session. The wake reads only output newer than its own nonce'd echo (scopedAfter), because the old Claude's footer is still in the buffer and would read as "ready" before anything has started.skills/cctabs/SKILL.md— Claude Code skill (must be synced togenerativereality/plugins). Kept under 500 lines — marketplace skill lints fail above that. And keep its body near 1,600 tokens (~6.5 KB): every session that uses cctabs carries the whole body for the rest of its life. It was ~8,450 tokens (475 lines) until 2026-10-29, ClaudeTTY's is ~520; the core now holds only rules that each prevent a failure that has happened, the common commands and the reference index (notes/2026-10-29-borrow-from-claudetty.md). A new gotcha goes in a reference with a one-line pointer, not in the core. Reference material lives inskills/cctabs/references/*.md, linked from SKILL.md with a line saying when to read each;sync-plugin.shsyncs the wholeskills/cctabs/directory. Add new detail there, not to SKILL.md.claude-plugin/plugin.json— plugin manifest (version must matchpackage.json)
npm run check= typecheck + test + build.npm testis scoped tosrc/on purpose — a barebun testalso globs the sibling checkouts underrelated-repos/and reports their failures as ours.- Verifying which sessions are alive: use
cctabs sessionsor the plugin's/api/tabs. Neverps aux | grep— it truncates long command lines, so a tab whose--namefalls past the cutoff reads as dead when it isn't. Code that reads the process table goes throughreadProcessTable()insrc/core/claude-procs.ts, which passes-wwfor exactly that reason. src/core/claude-procs.ts— the process table as a source of truth. Trust a Claude's--resumefor its session id; never trust its--namefor the tab's name (it doesn't follow a rename).fleet-manifest.tsandrestart-plan.tsare the pure halves ofcctabs manifest/cctabs restart, and every rule in them is a correction a hand-run fleet restart needed.