Skip to content

feat(resume): late-join an existing claude session into the mesh#31

Open
Lanzelot1 wants to merge 6 commits into
split/04-setupfrom
feat/resume-session
Open

feat(resume): late-join an existing claude session into the mesh#31
Lanzelot1 wants to merge 6 commits into
split/04-setupfrom
feat/resume-session

Conversation

@Lanzelot1

@Lanzelot1 Lanzelot1 commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

What

Late-join an existing Claude Code session onto the mesh. A live claude can't be hot-attached (its MCP, hooks and wake channel bind at launch), so late-join means relaunching the session's history wired to the mesh.

It's a --resume <id> pass-through on cotal spawn (and cotal start) — claude-specific, no new command:

  • fork (default)--resume <id> --fork-session: replays the transcript into a fresh, mesh-equipped process under a new id, so the original keeps its identity and runs untouched.
  • --in-place (spawn only) — plain --resume <id>: the same id/transcript continues, now mesh-wired (exit the original first — two live processes writing one transcript corrupts it).

Resume is claude-only; the other connectors ignore the flag (like prompt).

Changes

  • core: LaunchOpts.resume? + LaunchOpts.fork? (fork defaults on)
  • connector-claude-code: emit --resume <id>, add --fork-session unless fork === false; skip the greeting on resume
  • cli: --resume / --in-place on spawn
  • manager: --resume on start; threaded into buildLaunch
  • tests: resume.smoke.ts — claude argv composition + fork toggle
  • docs: claude-code-integration.md, getting-started.md, CLAUDE.md

Notes

🤖 Generated with Claude Code

Add LaunchOpts.resume; the claude connector emits --resume <id>
--fork-session (forks so the original session keeps its identity),
composing with the strict-MCP isolation and skipping the greeting
prompt. Threaded through cotal spawn --resume and the manager's
start/opStart. codex/opencode throw (resume is claude-only).

Closes #23.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Lanzelot1 and others added 4 commits June 15, 2026 14:55
Assert the claude connector folds --resume <id> --fork-session in while
keeping --strict-mcp-config and dropping the greeting on resume, and that
codex/opencode reject --resume (fail-closed). Wired as pnpm smoke:resume.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add fork?: boolean to LaunchOpts; the claude connector emits --fork-session
only when fork !== false. Default still forks, so spawn/start --resume and
the resume smoke are unchanged; cotal resume --in-place passes fork:false to
continue the same session id instead of branching a new one.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A live claude can't be hot-attached (MCP/hooks/channel are launch-bound), so
late-join means relaunching a session's history wired to the mesh. cotal resume
needs no agent file and runs from any directory: it discovers the newest session
for --cwd (~/.claude/projects/<encoded-cwd>/<id>.jsonl) and launches claude there,
with definable --space/--server. Fork by default (original untouched); --in-place
continues the same id. New lib/session.ts holds the discovery helpers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Assert fork:false drops --fork-session while keeping --resume (and the default
still forks), and that findClaudeSession returns the newest session by mtime
with the cwd→projects-dir encoding (empty for an unknown cwd).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Lanzelot1 Lanzelot1 changed the title feat(connector): resume a claude-code session into the mesh feat(resume): late-join an existing claude session into the mesh Jun 16, 2026
@davidfarah2003

davidfarah2003 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Instead of writing a new resume command, we should have a pass-through for resume with spawn. This way we can just wire it to the claude code command and be specific to claude code, so that we don't interfere with other implementations and connectors.

…eview)

Drop the standalone `cotal resume` command + session-discovery helper; resume
is now a pass-through flag on spawn (and start), claude-specific. Other
connectors ignore `--resume` like they already ignore `prompt` — no more throws.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants