Skip to content

feat(capture): capture host-Claude terminal conversations via transcript-tail - #415

Merged
jrothrock merged 1 commit into
mainfrom
feat/host-claude-capture
Sep 24, 2026
Merged

jrothrock merged 1 commit into
mainfrom
feat/host-claude-capture

Conversation

@jrothrock

Copy link
Copy Markdown
Collaborator

What

Branch 2 of 4 in replacing the bespoke ChatDock host chat with a real terminal (stacked on #414).

Moves conversation capture for the host Claude terminal off the (retiring) chat-stream wrap and onto the same transcript-tail path that already captures the sandbox's own Claude (sandbox_conv_tail.go).

The disambiguation problem

The host terminal's claude runs in the same workspace cwd as the sandbox's Claude, so by default both write to ~/.claude/projects/<slug>/ — indistinguishable on disk.

Fix: point the host terminal at a dedicated CLAUDE_CONFIG_DIR (~/.corral/host-claude-config) so its transcripts land in a corral-owned tree the tailer reads as host-origin. CLAUDE_CONFIG_DIR relocates the whole config dir, so the dedicated dir shares auth/settings/plugins with ~/.claude via per-entry symlinks (everything but projects/) — /login, settings, and skills behave exactly as in the user's normal claude; only the transcript stream diverges. User-placed real files are never clobbered.

(Confirmed CLAUDE_CONFIG_DIR behavior against the Claude Code sessions docs.)

Details

  • Tailer generalized over a convOriginProfile (origin kind + conv-key prefix + parent resolver). Sandbox sweep unchanged; a host sweep is added over hostClaudeProjectsDir, gated on the -claude tmux session being live.
  • tailSandboxFile/ingestSandboxLine → tailTranscriptFile/ingestTranscriptLine.
  • handleClaudeHostWS now launches claude under the dedicated config dir.

Deferred

Global (project-less) host-terminal capture lands with the global terminal itself (later branch).

Test

host_claude_config_test.go — separate projects/, shared symlinks, idempotent, no-clobber. Build/vet/tests green.

🤖 Generated with Claude Code

…ipt-tail

Branch 2 of the host-terminal-replaces-chat stack. Moves conversation
capture for the host Claude terminal off the (retiring) chat-stream wrap
and onto the same transcript-tail path that already captures the
sandbox's own Claude.

The host terminal's `claude` writes to a DEDICATED CLAUDE_CONFIG_DIR
(~/.corral/host-claude-config) so its transcripts live in a tree corral
owns and the tailer attributes unambiguously to the host origin — the
sandbox's Claude otherwise writes to the same ~/.claude/projects/<slug>
dir, indistinguishable on disk. The dedicated dir shares
auth/settings/plugins with ~/.claude via per-entry symlinks (everything
but projects/), so /login, settings and skills behave exactly as in the
user's normal claude; only the transcript stream diverges. User-placed
real files in the config dir are never clobbered.

The tailer is generalized over a convOriginProfile (origin kind +
conv-key prefix + parent resolver); the sandbox sweep is unchanged, a
host sweep is added over hostClaudeProjectsDir gated on the -claude tmux
session being live. tailSandboxFile/ingestSandboxLine become
tailTranscriptFile/ingestTranscriptLine.

Tests: config-dir seeding (separate projects/, shared symlinks, no
clobber). Global (project-less) host terminal capture deferred with the
global terminal itself.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jrothrock
jrothrock merged commit 95020ad into main Sep 24, 2026
1 check passed
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.

1 participant