feat: trace identity in the traced child's env (proxy modes) - #75
Merged
Conversation
The mitm and base-url modes injected only plumbing into the spawned client — HTTPS_PROXY and the CA bundle vars. A subprocess of a traced session (a statusline, a hook, a nested agent) that wanted to KNOW it was being captured had to sniff that plumbing and scan the instance registry for the live UI port: heuristics for a fact the spawning process holds in hand. Say it outright instead (traceIdentityEnv in src/capture.ts, merged at the one spawn site): CCTRACE_TRACE_FILE always, CCTRACE_SERVER_PORT + CCTRACE_INSTANCE_ID when a live server exists. Node mode has exported these names since day one; the proxy modes agree now. First consumer: claude-code-statusline's [cctrace:PORT] chip (thevibeworks/claude-code-statusline#9), which keeps the registry scan only as its fallback for older captures. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 29, 2026
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.
The mitm and base-url modes injected only plumbing into the spawned client —
HTTPS_PROXYand the CA bundle vars. A subprocess of a traced session (a statusline, a hook, a nested agent) that wanted to know it was being captured had to sniff that plumbing and scan the instance registry for the live UI port: heuristics for a fact the spawning process holds in hand.Say it outright instead —
traceIdentityEnvinsrc/capture.ts, merged at the one spawn site:CCTRACE_TRACE_FILE.jsonl)CCTRACE_SERVER_PORTCCTRACE_INSTANCE_IDNode mode has exported these names since day one; the proxy modes agree now. Static mode (
-s) has no server, so it exports the trace file only.First consumer: claude-code-statusline's
[cctrace:PORT]chip (thevibeworks/claude-code-statusline#9), which keeps the registry scan only as its fallback for pre-this-change captures.Tests: 3 new units on the pure helper; full suite 567 pass. The env passes through
docker execenv inheritance unchanged, sodeva --tracesessions get it for free.🤖 Generated with Claude Code