anosys-sdk-claude-code
AnoSys observability and analytics hook for Anthropic's Claude Code.
This package automatically captures Claude Code's telemetry, session turns, context sizes, and API costs, and sends them to your AnoSys workspace. It integrates directly into Claude Code's native Stop hook mechanism.
Installation
You can install the package via pip or your favorite Python package manager:
pip install anosys-sdk-claude-code
After installing the package, run the setup wizard to configure the hook:
anosys-claude-code install
The installer will prompt you for:
- AnoSys API Key for logs: Your ingestion API key from the AnoSys Console.
- AnoSys API Key for OTEL (optional): Your OpenTelemetry ingestion API key from the AnoSys Console.
- Content Redaction: If enabled, all conversation content (prompts, answers, thinking) will be redacted and replaced with
REDACTEDbefore being sent. Only metadata and tokens will be tracked.
Headless Installation
If you prefer to install without interactive prompts, you can pass the configuration via flags:
anosys-claude-code install \
--api-key "your_logs_api_key" \
--otel-key "your_otel_api_key" \
--redaction
CLI Commands
The package provides a unified CLI to manage your hook installation safely. It modifies ~/.claude/settings.json and creates automatic backups (~/.claude/settings.json.{TIMESTAMP}.bak) before any changes.
status
Check the current installation status of the AnoSys hook:
anosys-claude-code status
install
Installs or updates the hook in your Claude Code settings:
anosys-claude-code install
uninstall
Safely removes the AnoSys hook and related environment variables from your settings:
anosys-claude-code uninstall
run
This command is executed automatically by Claude Code when a session ends. You generally do not need to run this manually:
anosys-claude-code run
How it works
When installed, this package registers a Stop hook in ~/.claude/settings.json using the {"owner": "anosys"} tag. When a Claude Code session concludes, the hook is invoked. It scans your local Claude transcripts (~/.claude/projects/), incrementally maps any new messages or subagent events using the AnoSys schemas, calculates accurate pricing, applies optional PII redaction, and batches the results to your AnoSys workspace.
Metadata
Release files for anosys-claude-code 0.2.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| anosys_claude_code-0.2.9.tar.gz | 30.4 kB | Without provenance | Details for anosys_claude_code-0.2.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| anosys_claude_code-0.2.9-py3-none-any.whl | Python 3 | none | any | Details for anosys_claude_code-0.2.9-py3-none-any.whl |
Total release size: 62.9 kB
Release files / anosys_claude_code-0.2.9.tar.gz
| Download URL | anosys_claude_code-0.2.9.tar.gz |
|---|---|
| Size | 30.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
00d063c1692d6bdbd82604a822cf5b4cfd25337b041c92a23a8f286867e77b9d
|
|
BLAKE2b-256 checksum How to use checksums |
0f59826729482663e68910c555a3565e55952aa21e9a7c836e772ec9446339de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / anosys_claude_code-0.2.9-py3-none-any.whl
| Download URL | anosys_claude_code-0.2.9-py3-none-any.whl |
|---|---|
| Size | 32.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d178fef5b60bfaaae67424e3be40e5d4820d88b1d153e33050832a35cfb12bdf
|
|
BLAKE2b-256 checksum How to use checksums |
03f55ec9c9b67383a3751a975539a274e265e24baa56b755936cb0aebc858ca4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for anosys-claude-code 0.2.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.