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.5.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.5-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: claudectx_py-1.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 e1a61a37f8f8dba4a483aeb94bbbe38995de55524e7bbc1a54549514a3a761a6
MD5 b0e291153668e55c0591a146a37463b4
BLAKE2b-256 89351a2278294b7006c3bf581020f1f2b39b546cd2bad60fdda02da0766d0387

See more details on using hashes here.

Provenance

The following attestation bundles were made for claudectx_py-1.1.5.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.5-py3-none-any.whl.

File metadata

  • Download URL: claudectx_py-1.1.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b4eb77346c78b71be4fe3fbd555c5ad412422a960c195679a9ade804e012f942
MD5 a40c49feb98ccc53aaef462ff012204a
BLAKE2b-256 38cd3f2b50b0d6b149da789b4e263fd108cec279a4ddfbcbe7f832818068b6c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for claudectx_py-1.1.5-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