Back to stack
Dec 21, 2025
2 min read

Qompressor – The Skeletonizer

Creates lightweight structural representations of the codebase for massive token cost reduction

Qompressor

The Qompressor agent is the “Skeletonizer” for QonQrete. It creates lightweight structural representations of the codebase, mirroring qodeyard into bloq.d with implementation details stripped out.

How it works

1. Input and Output:

  • Takes source_dir (typically qodeyard) and dest_dir (typically bloq.d)
  • Expects qodeyard to be the source of full code

2. Directory Mirroring and Cleaning:

  • Aggressively cleans bloq.d by removing its entire contents
  • Recreates fresh directory structure
  • Ensures bloq.d is always an up-to-date mirror

3. File Processing Logic:

Files are categorized by filename and extension:

  • COPY_FILENAMES: Files like Dockerfile, Makefile copied as-is (critical context, low tokens)
  • COPY_EXTENSIONS: Files like .yaml, .json, .md copied as-is
  • COMPRESS_EXTENSIONS: Code files (.py, .js, .go) undergo compression

4. Compression Methods:

Python (compress_python):

  • Uses Python AST to parse code
  • Keeps: import statements, class definitions, function/method signatures, docstrings
  • Strips: Implementation bodies → replaced with # ... (body stripped by Qompressor) ...

Generic (compress_generic):

  • Regex-based approach for other languages
  • Keeps: comments, structural keywords (function, class, def), block openers
  • Less precise than AST but still effective

Benefits

  • Token Cost Reduction: Dramatically reduces context token count
  • Architectural Focus: LLMs focus on structure and interfaces, not implementation details
  • Speed: Fast and deterministic processing

What’s configurable

Internal Configuration:

  • COMPRESS_EXTENSIONS (set): File extensions for compression
  • COPY_EXTENSIONS (set): File extensions for direct copy
  • COPY_FILENAMES (set): Specific filenames for direct copy

Implicit via config.yaml:

  • options.use_qompressor (boolean): Whether Qrane runs Qompressor at all