Skip to main content

Anosys.ai

anosys-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

Requires Python 3.10 or later.

You can install the package via pip or your favorite Python package manager:

pip install anosys-claude-code

After installing the package, run the setup wizard to configure the hook:

anosys-claude-code install

The installer will prompt you for:

  1. AnoSys API Key for logs: Your ingestion API key from the AnoSys Console.
  2. AnoSys API Key for OTEL (optional): Your OpenTelemetry ingestion API key from the AnoSys Console.

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"

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 turn completes. You generally do not need to run this manually:

anosys-claude-code run

Privacy

By default the hook sends metadata only: ids, timestamps, models, token and cost numbers, durations, tool names, and the project, branch and OS username. Prompts, answers, tool output, commands and file contents are sent only after you accept the data-collection policy:

anosys-claude-code privacy          # show the current level and where it comes from
anosys-claude-code privacy full     # read and accept the policy, then send full content
anosys-claude-code privacy off      # keep the hook installed but send nothing
anosys-claude-code doctor           # installed copies, the active hook and local files
anosys-claude-code purge            # delete the local queue and logs

The hook reads only the session that just ended, never earlier history, and its log holds ids and sizes only. The old --redaction flag and REDACTION=true still work and mean metadata. See content controls for the 10 MB request limit, retries and encryption.

How it works

When installed, this package registers a Stop hook in ~/.claude/settings.json using the {"owner": "anosys"} tag. When Claude Code finishes a turn, the hook is invoked. It reads the transcript of the session that just ended and its subagents, incrementally maps new messages using the AnoSys schemas, estimates cost using the package's pricing table, applies the collection level, and sends the results in requests under 10 MB to your AnoSys workspace.

Content controls

See the content-controls reference for encryption coverage, default columns, size limits, and limitations. Encryption is opt-in and applies to selected string fields; it does not encrypt the complete record.

Anosys.ai MCP server and skill

Let Claude Code read your Anosys.ai workspace (architecture, problems, evals, traces and read-only SQL) through the Anosys.ai MCP server, and install the anosys-platform-intelligence skill. Create an MCP key (ak_mcp_...) in the Console under My Profile → MCP Keys; your ingestion key does not work here.

export ANOSYS_MCP_API_KEY=ak_mcp_...

# Add it when you install the hook
anosys-claude-code install --api-key YOUR_INGESTION_KEY --with-mcp -y

# Or on its own
anosys-claude-code mcp install -y
anosys-claude-code mcp status
anosys-claude-code mcp uninstall

With --workspace the server goes in the project's .mcp.json, which refers to ANOSYS_MCP_API_KEY instead of storing the key, so it is safe to commit. Use --skill-only to install just the skill. All options and other tools: anosys-sdk-mcp.

Metadata

Release files for anosys-claude-code 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anosys-claude-code 0.4.1
File Size Uploaded Provenance Actions
anosys_claude_code-0.4.1.tar.gz 37.1 kB Without provenance Details for anosys_claude_code-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anosys-claude-code 0.4.1
File Interpreter ABI Platform Actions
anosys_claude_code-0.4.1-py3-none-any.whl Python 3 none any Details for anosys_claude_code-0.4.1-py3-none-any.whl

Total release size: 70.8 kB

Release files / anosys_claude_code-0.4.1.tar.gz

Download URL anosys_claude_code-0.4.1.tar.gz
Size 37.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dbd144a6a94a07fa5b92c6cf96baa004fdf0ee7a4ea11a4c00f2d984825a93ca
BLAKE2b-256 checksum
How to use checksums
6de0c7040936ca7a0d9a299d36b4f78c9bd5af2d55dddafe2e6c5e14248d7299
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.4.1-py3-none-any.whl

Download URL anosys_claude_code-0.4.1-py3-none-any.whl
Size 33.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94bf05390ecd0ca73beb7916356d14c2b88a0b75e2e82f5cec090f0f6b503f4b
BLAKE2b-256 checksum
How to use checksums
e0f913999520ee3b3a8267c8a1be9b11c1cdd737a942952f4f34152f415c3111
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.4.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page