Proposal: a session-aware segment that appears only when the current Claude Code session runs under cctrace, rendering a short clickable link to the live trace UI.
Signal (no probing needed): cctrace exports trace identity into the traced child's env, which the statusline hook inherits:
- CCTRACE_SERVER_PORT — live UI port (present on live runs only)
- CCTRACE_TRACE_FILE — the .jsonl being written
- CCTRACE_INSTANCE_ID — the run's registry id
Presence of CCTRACE_SERVER_PORT IS "this session is traced" — no registry scan, no network call.
Rendering: an OSC 8 terminal hyperlink so the visible text stays short while the full URL is the target. Preference order:
- $CCTRACE_PUBLIC_URL if set (a portless-style named route, e.g. https://trace.localhost — cctrace >= 0.34 honors env PORT, so
portless trace cctrace claude serves the UI behind a stable name; the wrapper or user exports the public URL). Visible text = the bare domain: trace.localhost — instantly distinguishable from quota/git segments by being a domain.
- Fallback: http://localhost:$CCTRACE_SERVER_PORT with visible text
:9317.
Sketch:
if [ -n "$CCTRACE_SERVER_PORT" ]; then
url="${CCTRACE_PUBLIC_URL:-http://localhost:$CCTRACE_SERVER_PORT}"
label="${CCTRACE_PUBLIC_URL:+${CCTRACE_PUBLIC_URL#*://}}"
label="${label:-:$CCTRACE_SERVER_PORT}"
printf '\e]8;;%s\e\\%s\e]8;;\e\\' "$url" "⛁ $label"
fi
Notes:
- OSC 8 works in iTerm2/kitty/WezTerm/Ghostty/recent VTE; degrade to plain text elsewhere (the label alone still tells the user the port). tmux needs allow-passthrough.
- Keep it presence-only (no liveness probe) — the statusline runs on every prompt; cctrace serves /api/self if a cached probe is ever wanted.
- The segment doubles as the "you are being traced" honesty indicator, which matters when someone else started the trace wrapper.
Happy to send a PR if the shape looks right.
🤖 Generated with Claude Code
Proposal: a session-aware segment that appears only when the current Claude Code session runs under cctrace, rendering a short clickable link to the live trace UI.
Signal (no probing needed): cctrace exports trace identity into the traced child's env, which the statusline hook inherits:
Presence of CCTRACE_SERVER_PORT IS "this session is traced" — no registry scan, no network call.
Rendering: an OSC 8 terminal hyperlink so the visible text stays short while the full URL is the target. Preference order:
portless trace cctrace claudeserves the UI behind a stable name; the wrapper or user exports the public URL). Visible text = the bare domain: trace.localhost — instantly distinguishable from quota/git segments by being a domain.:9317.Sketch:
Notes:
Happy to send a PR if the shape looks right.
🤖 Generated with Claude Code