@generativereality/cctabs 0.1.4 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@generativereality/cctabs",
3
- "version": "0.1.4",
3
+ "version": "0.3.0",
4
4
  "description": "Claude Code tab manager. Terminal tabs as the UI, no tmux.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -19,6 +19,8 @@
19
19
  "check": "npm run typecheck && npm run build",
20
20
  "release": "bumpp && npm publish",
21
21
  "sync-plugin": "bash scripts/sync-plugin.sh",
22
+ "build:tabby-plugin": "cd tabby-plugin && npm install && npm run build",
23
+ "publish:tabby-plugin": "cd tabby-plugin && npm publish --access public",
22
24
  "prepack": "bash scripts/sync-plugin.sh --check && npm run build"
23
25
  },
24
26
  "keywords": [
@@ -5,7 +5,7 @@ description: Manage Claude Code sessions across terminal tabs (NOT browser tabs)
5
5
 
6
6
  You are managing Claude Code sessions using the `cctabs` CLI.
7
7
 
8
- **Important:** "tabs" here means **terminal tabs** (e.g. Wave Terminal tabs), NOT browser tabs. Each terminal tab runs its own Claude Code session. This skill is for managing those terminal-based Claude Code sessions — not for browser automation.
8
+ **Important:** "tabs" here means **terminal tabs** (Wave Terminal or Tabby), NOT browser tabs. Each terminal tab runs its own Claude Code session. This skill is for managing those terminal-based Claude Code sessions — not for browser automation.
9
9
 
10
10
  ## Before you spawn anything: is cctabs the right tool?
11
11
 
@@ -37,6 +37,64 @@ npm install -g @generativereality/cctabs
37
37
 
38
38
  Do not modify PATH or npm configuration beyond this.
39
39
 
40
+ ### Tabby users: a one-time plugin install is needed
41
+
42
+ Wave Terminal works out of the box. **Tabby additionally needs a small companion plugin** that exposes a localhost HTTP API the cctabs CLI talks to.
43
+
44
+ You don't need to detect this proactively — every cctabs command will fail with a self-documenting error if the plugin isn't running:
45
+
46
+ ```
47
+ cctabs Tabby plugin not reachable at http://127.0.0.1:3300.
48
+ reason: …
49
+ Install + restart Tabby in one shot from inside a Tabby tab:
50
+ cctabs install-tabby-plugin
51
+
52
+ ```
53
+
54
+ When you see that error, ask the user once:
55
+
56
+ > *"You're in Tabby and the cctabs plugin isn't installed. I can `cctabs install-tabby-plugin --yes` — that npm-installs the plugin AND restarts Tabby in the background, dropping you back into a forked session. Caveat: any other Tabby tabs you have open will be killed. OK?"*
57
+
58
+ On approval, run `cctabs install-tabby-plugin --yes`. Tabby quits ~2s after the command returns, reopens automatically, and spawns a new tab with your forked claude session. **Your current turn ends when Tabby quits**; the resumed claude in the new tab is where the user will continue.
59
+
60
+ If the user wants to keep their other Tabby tabs intact, run `cctabs install-tabby-plugin --no-restart` instead and tell them to quit + reopen Tabby themselves.
61
+
62
+ `cctabs doctor` is also available for a deliberate environment check (terminal, Wave Accessibility, plugin reachability, Wave DB) — useful if something feels off, but **not required as a preflight** since every command fails loudly on its own.
63
+
64
+ #### Auto-install + auto-restart (recommended)
65
+
66
+ ```bash
67
+ cctabs install-tabby-plugin --yes
68
+ ```
69
+
70
+ What it does, in order:
71
+ 1. `npm install --legacy-peer-deps --prefix <tabby-plugins-dir> tabby-cctabs`
72
+ 2. Captures the current claude session id from `~/.claude/projects/<slug>/`
73
+ 3. Spawns a detached background worker that quits Tabby, waits for it to die, reopens it, then opens a new tab running `claude --resume <id> --fork-session` in your current cwd.
74
+
75
+ **Other Tabby tabs in the same window get killed.** Tabby's session recovery may or may not bring them back. Use `--no-restart` to skip step 3 if the user wants control.
76
+
77
+ #### Manual install (fallback)
78
+
79
+ ```bash
80
+ TABBY_PLUGINS="$HOME/Library/Application Support/tabby/plugins"
81
+ mkdir -p "$TABBY_PLUGINS"
82
+ [ -f "$TABBY_PLUGINS/package.json" ] || echo '{"private":true}' > "$TABBY_PLUGINS/package.json"
83
+ npm install --legacy-peer-deps --prefix "$TABBY_PLUGINS" tabby-cctabs
84
+ # then ask the user to quit + reopen Tabby
85
+ ```
86
+
87
+ `--legacy-peer-deps` is required: the plugin's peer deps (`tabby-core`, `@angular/*`, …) live inside Tabby itself, not on npm. Tabby's GUI plugin manager handles this internally.
88
+
89
+ Linux: replace `~/Library/Application Support/tabby` with `${XDG_CONFIG_HOME:-$HOME/.config}/tabby`.
90
+ Windows: `%APPDATA%\tabby`.
91
+
92
+ #### Alternative: install via Tabby's GUI
93
+
94
+ If the user prefers, point them at Tabby → **Settings → Plugins**, search "cctabs", click install, then quit + reopen Tabby. Same end state.
95
+
96
+ Do not assume "no Wave detected → cctabs unusable" — Tabby is fully supported.
97
+
40
98
  ---
41
99
 
42
100
  Each Claude Code session runs in its own **terminal tab**. `cctabs` lets you — and other Claude Code sessions — introspect and orchestrate the full session fleet.
@@ -70,6 +128,7 @@ cctabs new fix-api ~/Dev/myapp --worktree --prompt "checkout PR #102 and fix tes
70
128
  cctabs sessions # list all tabs with session status
71
129
  cctabs list # list all workspaces, tabs, and blocks
72
130
  cctabs new <name> [dir] [-w workspace] [-p "prompt"] [-f file] # new tab + claude
131
+ cctabs new <name> [dir] -b <preset> # new tab on a non-Anthropic backend (Ollama)
73
132
  cctabs resume <name> [dir] # resume last session (reuses tab or creates one)
74
133
  cctabs restore [dir] [--dry] # resume every dead tab (e.g. after a reboot)
75
134
  cctabs fork <tab-name> [-n new-name] # fork session into new tab (--resume <id> --fork-session)
@@ -77,9 +136,74 @@ cctabs close <name-or-id> # close a tab
77
136
  cctabs rename <name-or-id> <new-name> # rename a tab
78
137
  cctabs scrollback <tab-or-block> [n] # read terminal output (default: 50 lines)
79
138
  cctabs send <tab-or-block> [text] # send input — arg, --file, or stdin pipe
139
+ cctabs backends # list available backend presets
80
140
  cctabs config # show config and path
81
141
  ```
82
142
 
143
+ ## Backends: running Claude Code on Ollama / Kimi / Qwen / local models
144
+
145
+ By default, `cctabs new` runs `claude` against the Anthropic API. Pass `--backend <preset>` (or `-b`) to launch the tab against a different model provider — useful for cheap/free scratch sessions, privacy-sensitive work, or experimenting with frontier open-weight models.
146
+
147
+ `cctabs` does this by prepending the right env vars (`ANTHROPIC_BASE_URL`, `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, etc.) and `--model <name>` to the `claude` command in the new tab.
148
+
149
+ ### Built-in presets
150
+
151
+ Run `cctabs backends` for the live list. Common ones:
152
+
153
+ | Preset | What it is | When to use |
154
+ |---|---|---|
155
+ | `anthropic` (default) | Anthropic API | Production / coding work where capability matters |
156
+ | `kimi` | Kimi K2.6 via Ollama Cloud (Pro tier) | Cheap frontier alternative; ~5s/turn |
157
+ | `qwen-cloud` | Qwen3 Coder Next via Ollama Cloud | Fastest Pro option (~3.8s/turn) |
158
+ | `gemma-cloud` | Gemma4 31B via Ollama Cloud | Cheap general-purpose |
159
+ | `qwen-local` | Qwen3 Coder 30B local (18GB) | Offline / private; slow on M1 |
160
+ | `qwen-next-local` | Qwen3 Coder Next Q3_K_M local (38GB) | Private + most capable local; needs `ollama create` import |
161
+ | `gpt-oss` | gpt-oss 20B local (13GB) | Private; slow; ~100s/turn for 50k system prompt |
162
+ | `llama` | Llama 3.1 8B local | Fast but garbles inside Claude Code's 50k system prompt — capability gate |
163
+ | `*-tee` | Same as above but routed through `:11500` proxy | Wire-level inspection (`ollama-tee` proxy must be running) |
164
+
165
+ ### Cost × privacy framing
166
+
167
+ Two axes matter:
168
+
169
+ 1. **Cost** — Anthropic Pro $20/mo or Max ($100/$200/mo); Ollama Cloud Pro $20/mo (3 concurrent, includes Kimi/Qwen Cloud); local = free but hardware-bound
170
+ 2. **Privacy** — Anthropic API: Anthropic sees prompts. Ollama Cloud: Ollama sees prompts. Local: nothing leaves the laptop
171
+
172
+ Match the tier to the task:
173
+ - Sensitive prompts (client code, customer data) → `qwen-next-local` or `gpt-oss`
174
+ - Routine exploration / orchestration → `anthropic` (default)
175
+ - Cost-sensitive bulk work → `kimi` or `qwen-cloud`
176
+
177
+ ### Examples
178
+
179
+ ```bash
180
+ # Spin up a tab on Kimi for a side experiment
181
+ cctabs new explore-kimi ~/Dev/myapp -b kimi -p "explore alternative API designs"
182
+
183
+ # Local privacy session, slower but no data leaves the laptop
184
+ cctabs new private-refactor ~/Dev/clientwork -b qwen-next-local -W
185
+
186
+ # Compare two models on the same task in parallel
187
+ cctabs new task-anthropic ~/Dev/myapp -p "implement spec X"
188
+ cctabs new task-kimi ~/Dev/myapp -b kimi -p "implement spec X"
189
+
190
+ # Custom local Ollama tag not in built-in presets:
191
+ cctabs new x ~/Dev/myapp -b qwen-local -m my-custom-tag:latest
192
+ ```
193
+
194
+ ### Caveats
195
+
196
+ - **Local backends are slow on M1.** A Claude Code turn against the local 50k-token system prompt takes ~100s prefill + generation on M1 Max. Only worth it for non-time-sensitive private work.
197
+ - **Llama 3.1 8B garbles tool calls** under Claude Code's system prompt. Capability gate, not a bug.
198
+ - **Ollama Cloud Pro requires `ollama signin`** (one-time). Free tier denies cloud-tagged models.
199
+ - **Custom presets** can be added in `~/.config/cctabs/config.toml`:
200
+ ```toml
201
+ [backends.my-preset]
202
+ model = "qwen3-coder-next:cloud"
203
+ base_url = "http://localhost:11434"
204
+ description = "My custom preset"
205
+ ```
206
+
83
207
  ## Workflow: Checking What's Running
84
208
 
85
209
  Before starting new sessions, always check what's already active:
@@ -251,17 +375,19 @@ cctabs new feature ~/Dev/myapp --worktree
251
375
 
252
376
  ## Handling `cctabs new` Timeout Errors
253
377
 
254
- `cctabs new` may occasionally fail with "Timed out waiting for new terminal block". This does **NOT** mean you have too many tabs or that Wave Terminal has hit a limit.
378
+ `cctabs new` may occasionally fail with "Timed out waiting for new terminal block" (or, on Tabby, "Shell prompt never appeared in new tab"). This does **NOT** mean you have too many tabs or that the terminal has hit a limit.
255
379
 
256
- **Possible causes** (root cause not yet confirmed):
257
- - Wave Terminal may need to be in focus / foreground for tab creation to register
258
- - The internal timeout may be slightly too short for the current system load
259
- - Transient IPC timing issue between cctabs and Wave
380
+ **Possible causes:**
381
+ - The terminal app may need to be in focus / foreground for tab creation to register (true for both Wave and Tabby).
382
+ - The internal timeout may be slightly too short for the current system load.
383
+ - Transient IPC timing issue between cctabs and the terminal.
384
+ - **Tabby only:** the cctabs plugin must be installed and running (`curl http://127.0.0.1:3300/api/health` to verify).
260
385
 
261
386
  **What to do:**
262
387
  1. **Retry the same command** — it often works on the second attempt
263
388
  2. If it fails again, wait a few seconds and retry once more
264
- 3. If it keeps failing, ask the user to bring Wave Terminal to the foreground and try again
389
+ 3. If it keeps failing, ask the user to bring the terminal app to the foreground and try again
390
+ 4. On Tabby, also confirm the plugin is reachable (see health check above)
265
391
 
266
392
  **What NOT to do:**
267
393
  - ❌ Do NOT assume there is a "tab limit" — there isn't one