Skip to content

feat(connector): resume a prior claude-code session into the mesh#24

Closed
caffeinum wants to merge 1 commit into
Cotal-AI:mainfrom
caffeinum:feat/resume-claude-session
Closed

feat(connector): resume a prior claude-code session into the mesh#24
caffeinum wants to merge 1 commit into
Cotal-AI:mainfrom
caffeinum:feat/resume-claude-session

Conversation

@caffeinum

Copy link
Copy Markdown
Contributor

What

Adds an optional resume to the connector LaunchOpts so a cotal spawn/start can reattach a prior claude-code conversation instead of always starting a fresh session.

When set, the claude-code connector pushes --resume <id> --fork-session into the launch args (fork so the original session id isn't hijacked — we adopt its context, not its identity). All existing args (dev-channels, MCP config, persona, model) are preserved, so the resumed process still joins the mesh normally.

Why

Today every spawn is a cold session — an operator doing real work in a claude session can't pull that context into the mesh. This is the minimal change to allow it. claude --resume, --fork-session, and --strict-mcp-config compose cleanly (verified against claude --help).

Closes #23.

Changes

  • core: LaunchOpts.resume? (connector-specific session id)
  • connector-claude-code: emit --resume <id> --fork-session when set
  • manager: opStart threads args.resume into buildLaunch; --resume flag on start
  • cli: --resume <id> flag on spawn
  • codex/opencode connectors ignore resume (claude-specific no-op)

Test

Build + typecheck clean (pnpm -r build, pnpm -r typecheck).

🤖 Generated with Claude Code

Add an optional `resume` to the connector LaunchOpts so a spawn/start can
reattach a prior claude-code conversation instead of always starting fresh.

- core: `LaunchOpts.resume?` (connector-specific session id)
- claude-code connector: when set, push `--resume <id> --fork-session` (fork so
  the original session id isn't hijacked — we adopt its context, not its identity);
  all existing args (dev-channels, mcp config, persona, model) are preserved
- manager opStart threads `args.resume` into buildLaunch
- `cotal start` and `cotal spawn` gain a `--resume <id>` flag
- codex/opencode ignore `resume` (claude-specific)

Closes Cotal-AI#23

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@caffeinum
caffeinum marked this pull request as ready for review June 15, 2026 19:06
@Lanzelot1

Copy link
Copy Markdown
Collaborator

Superseded by #30 (resume on the guided-setup stack: composes with the --strict-mcp isolation, skips the greeting on resume, fail-closed codex/opencode guard, + docs). Thanks @caffeinum — same shape, built on the setup stack. Closing in favor of that.

@Lanzelot1

Copy link
Copy Markdown
Collaborator

Correction: superseded by #31 (not #30).

@caffeinum
caffeinum deleted the feat/resume-claude-session branch June 15, 2026 20:05
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.

Feature: resume an existing claude-code session into the mesh instead of always spawning fresh

2 participants