feat(trace): switch --trace backend from claude-trace to cctrace - #399
Conversation
claude-trace's fetch hook only sees /v1/messages and is dead on native Claude binaries. cctrace MITM-captures the full surface (messages, OAuth, usage/credits, MCP) and auto-detects npm vs native installs. Snapshots land in .cctrace/ in the workspace. - run `cctrace --no-open -- <claude args>`; entrypoint injects --dangerously-skip-permissions after the first "--" - compile the cctrace standalone binary at image build; bun's CLI eats a leading "--", the compiled binary receives argv directly - install bun system-wide via BUN_INSTALL=/usr/local; the old /root/.bun symlink was unusable by the deva user - rename pin CLAUDE_TRACE_VERSION -> CCTRACE_VERSION=0.4.0 across versions.env, Makefile, Dockerfiles, CI workflows, and registry Close #396 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- version-pins.sh and resolve-tool-versions.sh emit ccx_version; every atlas_cli_version output was empty, so ATLAS_CLI_VERSION matched no Dockerfile ARG and ccx silently pinned to the ARG default instead of versions.env Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR replaces the --trace request-tracing backend from @mariozechner/claude-trace to @thevibeworks/cctrace, updates version pinning/labels accordingly, and adjusts image/tooling build/install paths (including installing bun system-wide) so tracing works for both npm and native Claude installs.
Changes:
- Rename
CLAUDE_TRACE_VERSION→CCTRACE_VERSIONacross version pins, labels, scripts, tests, Make targets, and CI workflows. - Update Claude wrappers/entrypoint wiring so
--tracerunscctrace --no-open -- <claude args>and traces persist to.cctrace/. - Add cctrace installation via compiled standalone binary (
bun build --compile) in agent tooling install flow.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| versions.env | Replace claude-trace pin with CCTRACE_VERSION. |
| tests/version-upgrade.sh | Update expected labels, mock registry entries, and build-arg expectations for cctrace. |
| tests/test_release_utils.sh | Update tool registry expectations to include cctrace instead of claude-trace. |
| scripts/version-upgrade.sh | Switch CLI override + build-arg wiring from claude-trace to cctrace. |
| scripts/version-pins.sh | Update pinned-variable list and GitHub outputs to include CCTRACE_VERSION. |
| scripts/update-version-pins.sh | Update pin refresh to fetch cctrace from npm instead of claude-trace. |
| scripts/toolchain-report.sh | Report CCTRACE_VERSION in toolchain report output. |
| scripts/test-version-targets.sh | Update version-target tests for CCTRACE_VERSION. |
| scripts/test-install-agent-tooling.sh | Extend installer test harness to fake bun + cctrace pack/build/install. |
| scripts/release-utils.sh | Replace tool registry entry for claude-trace with cctrace. |
| scripts/install-agent-tooling.sh | Remove claude-trace install; add cctrace compile+install step via bun. |
| Makefile | Rename build args/overrides to CCTRACE_VERSION; exclude .cctrace/ in context sizing. |
| docs/custom-images.md | Update build-arg examples for cctrace (and still contains outdated atlas arg name). |
| docs/advanced-usage.md | Add Request Tracing section documenting .cctrace/ behavior and invocation. |
| Dockerfile.rust | Rename build arg and image label from claude-trace to cctrace. |
| Dockerfile | Install bun system-wide; rename build arg + image label from claude-trace to cctrace. |
| docker-entrypoint.sh | Update tracing wrapper handling from claude-trace to cctrace and inject DSP after --. |
| deva.sh | Update help/example comment to reference cctrace tracing. |
| DEV-LOGS.md | Add devlog entry documenting the switch and new tracing behavior. |
| claude.sh | Switch local + docker trace wrapper from claude-trace to cctrace invocation. |
| CHANGELOG.md | Document the switch to cctrace and bun install behavior. |
| agents/claude.sh | Switch agent wrapper behavior to cctrace --no-open -- ... model. |
| .github/workflows/release.yml | Rename outputs/build args from claude-trace/atlas to cctrace/ccx. |
| .github/workflows/nightly-images.yml | Rename outputs/build args from claude-trace/atlas to cctrace/ccx. |
| .github/workflows/ci.yml | Update smoke build args/env wiring for cctrace/ccx. |
| .dockerignore | Ignore .cctrace/ artifacts. |
Comments suppressed due to low confidence (2)
docs/custom-images.md:78
- This doc still instructs passing
ATLAS_CLI_VERSIONas a build arg, but the codebase (Makefile, workflows, version pins) usesCCX_VERSIONnow. Keeping the old arg name here will lead users to pass a build-arg that the Dockerfiles no longer consume.
--build-arg CLAUDE_CODE_VERSION="$CLAUDE_CODE_VERSION" \
--build-arg CCTRACE_VERSION="$CCTRACE_VERSION" \
--build-arg CODEX_VERSION="$CODEX_VERSION" \
--build-arg GEMINI_CLI_VERSION="$GEMINI_CLI_VERSION" \
--build-arg ATLAS_CLI_VERSION="$ATLAS_CLI_VERSION" \
--build-arg COPILOT_API_VERSION="$COPILOT_API_VERSION" \
docs/custom-images.md:97
- Same issue as above: the Rust image build example still uses
ATLAS_CLI_VERSION, but the build arg isCCX_VERSION.
--build-arg BASE_IMAGE=deva-local:core \
--build-arg CLAUDE_CODE_VERSION="$CLAUDE_CODE_VERSION" \
--build-arg CCTRACE_VERSION="$CCTRACE_VERSION" \
--build-arg CODEX_VERSION="$CODEX_VERSION" \
--build-arg GEMINI_CLI_VERSION="$GEMINI_CLI_VERSION" \
--build-arg ATLAS_CLI_VERSION="$ATLAS_CLI_VERSION" \
--build-arg PLAYWRIGHT_VERSION="$PLAYWRIGHT_VERSION" \
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| FINAL_ARGS=("--include-all-requests" "--run-with" "${CLAUDE_ARGS[@]}") | ||
| if command -v "$CCTRACE_PATH" >/dev/null 2>&1; then | ||
| CLAUDE_CMD="$CCTRACE_PATH" | ||
| FINAL_ARGS=("--" "${CLAUDE_ARGS[@]}") |
| local has_dsp=false has_sep=false | ||
| for arg in "$@"; do | ||
| if [ "$arg" = "--dangerously-skip-permissions" ]; then | ||
| has_dsp=true | ||
| break | ||
| elif [ "$arg" = "--" ]; then |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9fc499e60
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| AGENT_COMMAND+=("--run-with") | ||
| # Use cctrace wrapper: captures everything by default, | ||
| # claude args go after "--" | ||
| AGENT_COMMAND=("cctrace" "--no-open" "--") |
There was a problem hiding this comment.
Force base-url tracing for Copilot auth
When this wrapper is used with --auth-with copilot, setup_claude_auth below exports ANTHROPIC_BASE_URL to the HTTP Copilot proxy, but this unconditional cctrace --no-open -- ... lets cctrace auto-select its default MITM mode for native Claude. That mode only routes HTTPS traffic via the proxy, so Claude's HTTP Copilot requests bypass cctrace and deva.sh claude --auth-with copilot -- --trace runs without capturing the LLM calls. Please force cctrace's base-url mode (before the --) for the Copilot/custom-base-url path.
Useful? React with 👍 / 👎.
Close #396
claude-trace's fetch hook only sees /v1/messages and is dead on native Claude binaries. cctrace MITM-captures the full surface (messages, OAuth, usage/credits, MCP) and auto-detects npm vs native installs. Snapshots land in .cctrace/ in the workspace mount.
cctrace --no-open -- <claude args>; entrypoint injects --dangerously-skip-permissions after the first----, the compiled binary receives argv directly🤖 Generated with Claude Code