Skip to content

feat(claude-trace): Add support for native bun binary#56

Open
Richard-Weiss wants to merge 2 commits intobadlogic:mainfrom
Richard-Weiss:main
Open

feat(claude-trace): Add support for native bun binary#56
Richard-Weiss wants to merge 2 commits intobadlogic:mainfrom
Richard-Weiss:main

Conversation

@Richard-Weiss
Copy link

Adds support for tracing Claude when installed as a native binary (Bun-compiled) instead of Node.js. Uses a reverse proxy approach since the --require interceptor only works with Node.

  • Detect native binaries via magic bytes, use HTTP reverse proxy for interception
  • Add optional --include-sensitive-headers that logs bearer token and other credentials
  • Cross-platform support (Windows/macOS/Linux) (Only Ubuntu tested so far)

I only tested it on Ubuntu Server so would be nice if someone on Mac and Windows were to test it before any possible merge.
Should resolve #37 and #48.

Richard-Weiss-claude and others added 2 commits January 23, 2026 20:07
- Detect native binaries (ELF/Mach-O/PE) via magic bytes
- Use HTTP reverse proxy with ANTHROPIC_BASE_URL for compiled Claude
- Add optional --include-sensitive-headers flag to disable header redaction

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Use 'where' instead of 'which' on Windows
- Handle 'where' returning multiple lines
- Skip bash wrapper detection on Windows
- Add Windows paths (.local/bin/claude.exe, %APPDATA%/npm/claude.cmd)
- Add missing paths (~/.claude/bin/claude, /opt/homebrew/bin/claude)

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Richard-Weiss
Copy link
Author

I tested it on Win 10. Got some issues because of the Claude Code NPM dependency, so kicked that out. After that having to run build in Git Bash because of cp commands in the build script.
Auto open of the HTML also has issues because of start.
image

But, the reverse proxy approach worked there too, so seems "good enough" to me for the scope of this PR.
image

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.

claude-trace fails on mac os newest version

2 participants