Skip to main content

A rule-based command-output optimization and context-compression layer that reduces unnecessary LLM context while preserving important information.

Project description

Quor

Your AI coding assistant is burning tokens on noise. Quor cuts it before it ever reaches the model. Runs entirely on your machine. No LLM, no cloud, no network call — just a deterministic rule pipeline that strips the boilerplate out of everything your assistant reads.

PyPI Python License

35.9% smaller, on average. Up to 89% smaller on the worst offenders.

Measured across a 127-case real-world benchmark suite, CI-gated on every single change — not a one-time demo number. See the numbers below, or run quor gain / quor dashboard to see your own project's real savings.

Local-only No LLM No cloud
No telemetry No API keys No file uploads
Deterministic Fail-open Enterprise-safe

Install — 30 seconds

pip install quor
quor init --claude
quor doctor

Requires Python 3.11+. If quor/qr isn't found on your PATH after install, run every command below as python -m quor ... instead — that's exactly what Claude Code itself already uses under the hood, so it always works.

To upgrade: pip install --upgrade quor && quor init --claude && quor doctor — hook files live outside the package, so re-running init keeps them in sync.

Why this matters

Every command your AI assistant runs — git status, a pytest run, a file read — pours straight into its context window. Most of it is boilerplate: passing tests it doesn't need to see, unchanged diff context, repeated warnings, PDF page furniture, dependency-install spam. That's tokens you're paying for, latency you're waiting on, and context-window budget your assistant isn't spending on your actual code.

The obvious fix — have the AI summarize its own output — is the wrong one: it doubles latency, doubles cost, and can silently drop the one line that mattered. Quor takes the other path: a local, rule-based pipeline that runs in milliseconds, makes the same keep/drop decision every time given the same input, and never touches the network.

command runs → Quor captures the output → rules mark each line KEEP / COMPRESS / PROTECT → noise drops → the assistant reads fewer tokens

Same command, same exit code, same side effects — only what reaches the context window changes. Failures, diffs, and tracebacks are never touched, and every compressed output links back to the full original — nothing is ever lost, just deferred until you ask for it.

The Numbers

35.9% average token reduction across Quor's own 127-case benchmark suite (CI-gated — a regression here fails the build, not just a dashboard). That average includes plenty of already-terse output with nothing left to cut; on the cases that actually have noise to remove, it goes much further:

Real command Compression
pip install -r requirements.txt (mostly-cached dependencies) 88.8% smaller
A deeply nested Java exception stack trace 88.6% smaller
pnpm install progress noise 77.1% smaller
A large JavaScript file read through Claude Code's Read tool 75.0% smaller

By ecosystem:

Content Compression
Java 55.6%
Config files (JSON/TOML/YAML/lockfiles) 53.9%
JavaScript 49.5%
Python packaging (pip/poetry) 47.4%
TypeScript 42.5%
Python 35.6%
CI/build logs 35.7%
Documents (PDF, DOCX, Markdown) 24.8%

Short, already-dense output compresses little — that's correct behavior, not underperformance; Quor never trims a line just to move the number (see ANTI_GOALS.md). Full breakdown in docs/BENCHMARKS.md, or run quor gain / quor dashboard for your own project's real, live numbers — always shown with an honest ±20% uncertainty band, never a bare number dressed up as exact.

Commands

quor init --claude Install the Claude Code hook
quor doctor Health check
quor gain Cumulative token savings summary
quor dashboard Live terminal view of savings for this session
quor explain <cmd> Show what would be removed, stage by stage
quor search <query> Semantic search across your repository
quor map / quor symbols / quor graph Repository profile, symbol index, and dependency graph
quor validate [file] Validate a filter config

Full reference: quor --help.

Supported

Full compression: Claude Code (Bash + Read hooks), Gemini CLI (command rewriting). Detected, integration pending upstream hook support: Codex CLI, Cursor, VS Code (GitHub Copilot agent mode), Windsurf (Cascade), Aider, Continue.dev — quor doctor tells you exactly which state you're in.

Commands: git, pytest, mypy/ruff, pip/poetry, the full Node/TypeScript toolchain (npm, pnpm, yarn, ESLint, tsc, Jest, Vitest, Prettier, Next.js, Turbo), and a generic fallback for everything else. Source code: Python built in; JavaScript/TypeScript, Go, Rust, Java, C# via pip install "quor[<language>]". Documents: Markdown, TXT, DOCX, PDF via quor[documents]. Config: JSON/TOML/.env/.ini built in, YAML via quor[yaml].

Trust

Compression tooling sits in the middle of every command you run — it has to earn the right to be there.

  • Local execution only — no network calls, no cloud, no telemetry, no API keys, ever
  • Rule-based, not AI — pattern match, dedup, count, budget; zero ML in the filter path, zero hallucination risk
  • Fail-open — a filter bug never blocks a command or hides output, it just returns the original untouched
  • Secret-aware — warns (never silently strips) if a credential pattern survives compression
  • Meaning-preserving by contract — a line Quor keeps is bit-for-bit identical to the original; nothing is rephrased or summarized (see ANTI_GOALS.md)
  • App-control friendly — every invocation runs through python -m quor directly, never an unsigned launcher .exe, so corporate AppLocker/Defender policies don't get in the way

Contributing

git clone https://github.com/priyanshup/Quor.git && cd Quor
pip install -e ".[dev]"
pytest tests/

CONTRIBUTING.md · SECURITY.md · CHANGELOG.md

License

Apache 2.0 — see 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

quor-0.5.0.tar.gz (831.8 kB view details)

Uploaded Source

Built Distribution

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

quor-0.5.0-py3-none-any.whl (481.5 kB view details)

Uploaded Python 3

File details

Details for the file quor-0.5.0.tar.gz.

File metadata

  • Download URL: quor-0.5.0.tar.gz
  • Upload date:
  • Size: 831.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for quor-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a614f7bc2f1ba710af23c5459dba182b89d1721222fae3c453cd02fa63522f2f
MD5 070e6c2207684917367911dd00287aca
BLAKE2b-256 425c0120c7e84763cc4c2259c046384af1fc715d96dd523be28e4c4442de2993

See more details on using hashes here.

File details

Details for the file quor-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: quor-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 481.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for quor-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d5dbe034c91ead65c68db5f3a22af981a25f275135fa6b1538cce44b546ba08
MD5 3bcb60d5dca40940c2d06a0d9843187d
BLAKE2b-256 3f31a3a306ad175fbd49256006f1e673279c1f9f5dca3a5083c4cf5d09abbef2

See more details on using hashes here.

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