Skip to main content

claudectx-py

Python wrapper for claudectx — reduce Claude Code token usage by up to 80%.

Install

pip install claudectx-py

This installs the claudectx command into your Python environment's PATH. The wrapper delegates to the underlying npm package, which must be installed separately:

npm install -g claudectx
# or
brew tap Horilla/claudectx && brew install claudectx

Usage

Once both are installed, use claudectx exactly as you would from npm:

claudectx analyze                    # Token breakdown per context component
claudectx optimize --apply           # Auto-fix all token waste
claudectx report                     # 7-day usage analytics
claudectx watch                      # Live token dashboard
claudectx budget "src/**/*.py"       # Estimate cost before a big task
claudectx warmup                     # Pre-warm the Anthropic prompt cache
claudectx drift                      # Find stale CLAUDE.md references
claudectx compress                   # Compress session into MEMORY.md
claudectx teams export               # Export usage for team cost reporting

Why a Python wrapper?

If your team uses Python-based tooling (pyenv, pip, Poetry, uv), this lets you add claudectx as a project dependency in pyproject.toml alongside your other dev tools — no separate npm install step in your CI.

[tool.poetry.dev-dependencies]
claudectx-py = "^1.1.2"

The wrapper is intentionally thin: it locates the claudectx binary on PATH and delegates all arguments to it. No logic is duplicated.

Requirements

  • Python 3.8+
  • Node.js 18+ with claudectx installed globally (npm install -g claudectx)

License

MIT — see claudectx LICENSE

Metadata

Release files for claudectx-py 1.1.5

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

Source distribution (sdist)

Source distribution for claudectx-py 1.1.5
File Size Uploaded
claudectx_py-1.1.5.tar.gz 3.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for claudectx-py 1.1.5
File Interpreter ABI Platform
claudectx_py-1.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 6.2 kB

Release files / claudectx_py-1.1.5.tar.gz

Download URL claudectx_py-1.1.5.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e1a61a37f8f8dba4a483aeb94bbbe38995de55524e7bbc1a54549514a3a761a6
BLAKE2b-256 checksum
How to use checksums
89351a2278294b7006c3bf581020f1f2b39b546cd2bad60fdda02da0766d0387
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.

Transparency log

Release files / claudectx_py-1.1.5-py3-none-any.whl

Download URL claudectx_py-1.1.5-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4eb77346c78b71be4fe3fbd555c5ad412422a960c195679a9ade804e012f942
BLAKE2b-256 checksum
How to use checksums
38cd3f2b50b0d6b149da789b4e263fd108cec279a4ddfbcbe7f832818068b6c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.5 This release

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

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