Metadata-Version: 2.4
Name: tracerazor-anthropic
Version: 0.2.0
Summary: Drop-in TraceRazor-instrumented Anthropic client. Zero-friction token efficiency auditing.
Author: Zulfaqar Hafez
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/ZulfaqarHafez/tracerazor
Project-URL: Repository, https://github.com/ZulfaqarHafez/tracerazor
Keywords: ai,llm,anthropic,claude,token-efficiency,tracing,audit
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: tracerazor-sdk>=0.1.0
Requires-Dist: anthropic>=0.25.0

# 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

```bash
pip install tracerazor-anthropic
```

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

## Use

```python
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
