Skip to main content

Drop-in TraceRazor-instrumented Anthropic client. Zero-friction token efficiency auditing.

Project description

tracerazor-anthropic

Drop-in replacement for anthropic.Anthropic with automatic TraceRazor token-efficiency auditing. Change one import and every messages.create() call is captured as a reasoning step.

Install

pip install tracerazor-anthropic

You'll also need the tracerazor binary on your PATH (or a running tracerazor-server).

Use

from tracerazor_anthropic import Anthropic

client = Anthropic(agent_name="support-bot")

resp = client.messages.create(
    model="claude-haiku-4-5-20251001",
    max_tokens=512,
    messages=[{"role": "user", "content": "Refund order ORD-9182"}],
)

# ... more calls ...

report = client.audit()
print(report.summary())

Constructor accepts every kwarg the plain anthropic.Anthropic does plus:

Kwarg Default Meaning
agent_name "claude-agent" Name used in the TraceRazor report
tracer None Append to an existing Tracer instead of creating one
server None URL of a running tracerazor-server (default: local binary)

Not yet wrapped

  • Streaming (messages.stream) — fall through to the underlying client via client._inner for now.
  • Async client (anthropic.AsyncAnthropic).

Both are planned.

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tracerazor_anthropic-0.2.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tracerazor_anthropic-0.2.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file tracerazor_anthropic-0.2.0.tar.gz.

File metadata

  • Download URL: tracerazor_anthropic-0.2.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for tracerazor_anthropic-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ea2debf28cb6998442c3087fa53a5d492283472f922633a6f5c7123d2b133f4b
MD5 123d79d814aa08c7a2f1ea154dee10a9
BLAKE2b-256 d76edf6286ba5a4f6c801fbb23486186411d4ccf841de9c95703fbb2174ff459

See more details on using hashes here.

File details

Details for the file tracerazor_anthropic-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tracerazor_anthropic-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 165311723658659b6830f5ad7095878c90472efc77a1d0920c9d9261c5758c11
MD5 f3a7e848409c9f24eca873232c27f836
BLAKE2b-256 913089973f9553390e62c95f8727f33ae2e0486f29760d41240a566bab4833b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page