Skip to main content

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:

  1. Staleness — Detects outdated references, stale version numbers, dead links
  2. Contradictions — Finds conflicting instructions or redundant rules
  3. Deadweight — Identifies low-signal boilerplate, excessive examples, noise
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

context_hygiene-0.2.1.tar.gz (36.8 kB view details)

Uploaded Source

Built Distribution

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

context_hygiene-0.2.1-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

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

Hashes for context_hygiene-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7077174d1a980ddf9e2ee1f0744b306d58e851e3dcb33642846959d401590a75
MD5 3b9a97551205a9baa01e4b03a2fca4be
BLAKE2b-256 7840108ee0478a93270f66acb77ab0ac1b042cb4c62214e31c72b7d33bfacc2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for context_hygiene-0.2.1.tar.gz:

Publisher: release.yml on AreteDriver/context-hygiene

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

File details

Details for the file context_hygiene-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for context_hygiene-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6db5076d69c0a083fb3976ec891addc9b9cbe60f8ff81cfeba4b3631730b5504
MD5 43b65c4b537d2e451e895127094c806f
BLAKE2b-256 7d5afdce374429b0502317d75f12cbfce4906110f5b5d22c09521d97855f0ef1

See more details on using hashes here.

Provenance

The following attestation bundles were made for context_hygiene-0.2.1-py3-none-any.whl:

Publisher: release.yml on AreteDriver/context-hygiene

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