Skip to main content

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

Project description

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

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

claudectx_py-1.1.3.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

claudectx_py-1.1.3-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file claudectx_py-1.1.3.tar.gz.

File metadata

  • Download URL: claudectx_py-1.1.3.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for claudectx_py-1.1.3.tar.gz
Algorithm Hash digest
SHA256 bfb424382339b22357eee06a833fe2cbaf339f2d6616ce6fc0534240310767ed
MD5 5e134276a208ba56bae9f730fbfe469b
BLAKE2b-256 0477f7e7f7723df53bb1a70783f634d7f198cd50e42d8be88196dadc1be607b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for claudectx_py-1.1.3.tar.gz:

Publisher: publish.yml on Horilla/claudectx-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file claudectx_py-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: claudectx_py-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for claudectx_py-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 86b9d027b135c1936c6bba5c9e215f2f3b91b0a8bdb6fc4e9450a1ec505383eb
MD5 449c55bb38ddcd0d5cee4712a42f420c
BLAKE2b-256 9d01e335b42c1bf72a6150b32a8c2e9d56da1a7e1e18b5315b94118262574117

See more details on using hashes here.

Provenance

The following attestation bundles were made for claudectx_py-1.1.3-py3-none-any.whl:

Publisher: publish.yml on Horilla/claudectx-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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