feat: --resume on new, manifest-driven restore, send --wait-for-prompt, sessions --json#2
Draft
motin wants to merge 1 commit into
Draft
feat: --resume on new, manifest-driven restore, send --wait-for-prompt, sessions --json#2motin wants to merge 1 commit into
motin wants to merge 1 commit into
Conversation
…t, sessions --json
Closes ergonomic gaps in the Wave→Tabby fleet-migration flow:
1. `cctabs new <name> <dir> --resume <session-id>` — pass-through to
`claude --resume <id> --name <name>` plus configured claude.flags.
Validates the session ID against `~/.claude/projects/`. Combines with
--worktree. Mutually exclusive with --prompt/--file.
2. `cctabs restore --manifest <file|-> [--create-missing]` — drives
restore from an explicit `{name, dir, session_id?}[]` list. Accepts
`cctabs sessions --json` output directly. Attaches to existing tabs in
the current workspace; with --create-missing also spawns new ones.
3. `cctabs send --wait-for-prompt [--wait-timeout <s>]` — polls the
buffer until a shell prompt (\$/%/>/❯) is visible before sending.
Closes a race when sending into a freshly spawned tab.
4. `cctabs sessions --json` — emits machine-readable JSON with resolved
Claude session IDs. Output is pipeable to `cctabs restore --manifest -`,
closing the Wave→Tabby migration loop.
Also: pass `renderHeader: null` to gunshi so `--json` output isn't
prefixed with the package banner and stays parseable when piped.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes four ergonomic gaps surfaced while migrating an 18-session Claude Code fleet from Wave to Tabby.
cctabs new <name> <dir> --resume <session-id>— pass-through toclaude --resume <id> --name <name>plus the configuredclaude.flagsfrom~/.config/cctabs/config.toml. Validates the session ID against~/.claude/projects/<slug>/and warns (but proceeds) if missing. Combines with--worktree. Mutually exclusive with--prompt/--file.cctabs restore --manifest <file|-> [--create-missing]— drives restore from an explicit{name, dir, session_id?}[]list (plain array,{sessions: […]}, or full{workspaces: [{sessions: […]}]}— acceptscctabs sessions --jsonoutput directly). Attaches to existing tabs in the current workspace; with--create-missingalso spawns new ones.cctabs send --wait-for-prompt [--wait-timeout <s>]— polls the buffer until a shell prompt ($/%/>/❯) is visible before sending. Closes a race observed when sending immediately after a TabbyPOST /api/tabs/new. Off by default to preserve the existing fast path.cctabs sessions --json— emits machine-readable JSON (per-workspace, per-session). Includes the resolved Claude session ID when inferable from~/.claude/projects/<slug>/. Output pipes directly intocctabs restore --manifest -, closing the Wave→Tabby migration loop.Plus a small infra fix: pass
renderHeader: nullto gunshi so--json(and any other piped) output isn't prefixed with the package banner.Design decisions
{sessions}, or full{workspaces: [{sessions}]}) so callers can roundtripsessions --jsonoutput with no transformation.name+dir(orcwd) are required;session_idis optional — when omitted, restore falls back to a name lookup in~/.claude/projects/<slug-of-dir>/.--create-missingscope: limited to the current workspace. With Tabby that's the only workspace, and on Wave you almost always want to spawn into the window you're sitting in.--wait-for-promptopt-in: existing callers don't need the latency; only freshly spawned tabs do. A--no-waitopt-out would be a wider change.--resumevalidation: warn-and-proceed rather than abort. The user may know better than we do (worktree corner cases, stale slug, etc.), so we don't block.Test plan
npm run typecheckcleannpm run buildcleancctabs sessions --json | jq '.workspaces[0].sessions | length'returns a numbercctabs sessions --json | cctabs restore --manifest - --dryround-tripscctabs sessions --json | cctabs restore --manifest - --create-missing --dryshows spawn intent for the current tabcctabs new --resume <bad-id>warns and proceedscctabs new --resume <id> --prompt fooerrors cleanlycctabs send --wait-for-promptround-trip against a slow-to-prompt tab🤖 Generated with Claude Code