Context window hygiene analyzer for LLM conversations
Project description
context-hygiene
Context window hygiene analyzer for LLM conversations. Detect staleness, contradictions, deadweight, and compression opportunities in CLAUDE.md files, prompt chains, and agent configs.
Install
pip install context-hygiene
Optional extras:
pip install "context-hygiene[anthropic]" # AI-powered deep analysis
pip install "context-hygiene[watch]" # Live file monitoring
Quick Start
# Audit a CLAUDE.md file
ctx-hygiene audit CLAUDE.md
# Score staleness heuristically (no LLM needed)
ctx-hygiene score CLAUDE.md
# Auto-clean deadweight and stale segments
ctx-hygiene clean CLAUDE.md
# View audit history
ctx-hygiene history
# Check license and config
ctx-hygiene status
Free vs Pro
| Feature | Free | Pro ($8/mo) |
|---|---|---|
audit (fast mode) |
10/month | Unlimited |
score |
Unlimited | Unlimited |
clean |
Unlimited | Unlimited |
history |
Unlimited | Unlimited |
status / stats |
Unlimited | Unlimited |
audit --deep (AI analysis) |
- | Yes |
watch (live monitoring) |
- | Yes |
Subscribe Monthly ($8/mo) | Subscribe Yearly ($69/yr)
After purchase, you'll receive a license key via email. Activate it:
export CONTEXT_HYGIENE_LICENSE="CTHG-XXXX-XXXX-XXXX"
Or save to ~/.config/context-hygiene/license.
How It Works
context-hygiene parses structured context files (CLAUDE.md, YAML configs, prompt chains) into segments and runs four analysis passes:
- Staleness — Detects outdated references, stale version numbers, dead links
- Contradictions — Finds conflicting instructions or redundant rules
- Deadweight — Identifies low-signal boilerplate, excessive examples, noise
- Compression — Suggests where content can be condensed without information loss
Fast mode uses heuristics. Deep mode (--deep, Pro) uses an LLM for semantic analysis.
License
MIT
Project details
Release history Release notifications | RSS feed
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 context_hygiene-0.2.1.tar.gz.
File metadata
- Download URL: context_hygiene-0.2.1.tar.gz
- Upload date:
- Size: 36.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7077174d1a980ddf9e2ee1f0744b306d58e851e3dcb33642846959d401590a75
|
|
| MD5 |
3b9a97551205a9baa01e4b03a2fca4be
|
|
| BLAKE2b-256 |
7840108ee0478a93270f66acb77ab0ac1b042cb4c62214e31c72b7d33bfacc2e
|
Provenance
The following attestation bundles were made for context_hygiene-0.2.1.tar.gz:
Publisher:
release.yml on AreteDriver/context-hygiene
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
context_hygiene-0.2.1.tar.gz -
Subject digest:
7077174d1a980ddf9e2ee1f0744b306d58e851e3dcb33642846959d401590a75 - Sigstore transparency entry: 1097855636
- Sigstore integration time:
-
Permalink:
AreteDriver/context-hygiene@f0f78a0e18097b6dcb29577bf92d5f5e186d3eeb -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/AreteDriver
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f0f78a0e18097b6dcb29577bf92d5f5e186d3eeb -
Trigger Event:
push
-
Statement type:
File details
Details for the file context_hygiene-0.2.1-py3-none-any.whl.
File metadata
- Download URL: context_hygiene-0.2.1-py3-none-any.whl
- Upload date:
- Size: 34.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6db5076d69c0a083fb3976ec891addc9b9cbe60f8ff81cfeba4b3631730b5504
|
|
| MD5 |
43b65c4b537d2e451e895127094c806f
|
|
| BLAKE2b-256 |
7d5afdce374429b0502317d75f12cbfce4906110f5b5d22c09521d97855f0ef1
|
Provenance
The following attestation bundles were made for context_hygiene-0.2.1-py3-none-any.whl:
Publisher:
release.yml on AreteDriver/context-hygiene
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
context_hygiene-0.2.1-py3-none-any.whl -
Subject digest:
6db5076d69c0a083fb3976ec891addc9b9cbe60f8ff81cfeba4b3631730b5504 - Sigstore transparency entry: 1097855647
- Sigstore integration time:
-
Permalink:
AreteDriver/context-hygiene@f0f78a0e18097b6dcb29577bf92d5f5e186d3eeb -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/AreteDriver
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f0f78a0e18097b6dcb29577bf92d5f5e186d3eeb -
Trigger Event:
push
-
Statement type: