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
claudectxinstalled 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfb424382339b22357eee06a833fe2cbaf339f2d6616ce6fc0534240310767ed
|
|
| MD5 |
5e134276a208ba56bae9f730fbfe469b
|
|
| BLAKE2b-256 |
0477f7e7f7723df53bb1a70783f634d7f198cd50e42d8be88196dadc1be607b6
|
Provenance
The following attestation bundles were made for claudectx_py-1.1.3.tar.gz:
Publisher:
publish.yml on Horilla/claudectx-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claudectx_py-1.1.3.tar.gz -
Subject digest:
bfb424382339b22357eee06a833fe2cbaf339f2d6616ce6fc0534240310767ed - Sigstore transparency entry: 1280584722
- Sigstore integration time:
-
Permalink:
Horilla/claudectx-py@5c81cf85da877c5e515b6918a4ef89bb050c008c -
Branch / Tag:
refs/tags/v1.1.3 - Owner: https://github.com/Horilla
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5c81cf85da877c5e515b6918a4ef89bb050c008c -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86b9d027b135c1936c6bba5c9e215f2f3b91b0a8bdb6fc4e9450a1ec505383eb
|
|
| MD5 |
449c55bb38ddcd0d5cee4712a42f420c
|
|
| BLAKE2b-256 |
9d01e335b42c1bf72a6150b32a8c2e9d56da1a7e1e18b5315b94118262574117
|
Provenance
The following attestation bundles were made for claudectx_py-1.1.3-py3-none-any.whl:
Publisher:
publish.yml on Horilla/claudectx-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claudectx_py-1.1.3-py3-none-any.whl -
Subject digest:
86b9d027b135c1936c6bba5c9e215f2f3b91b0a8bdb6fc4e9450a1ec505383eb - Sigstore transparency entry: 1280584727
- Sigstore integration time:
-
Permalink:
Horilla/claudectx-py@5c81cf85da877c5e515b6918a4ef89bb050c008c -
Branch / Tag:
refs/tags/v1.1.3 - Owner: https://github.com/Horilla
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5c81cf85da877c5e515b6918a4ef89bb050c008c -
Trigger Event:
push
-
Statement type: