CRUX

Context Reduction Using X-encoding

2,500500 tokens

80% RECOVERED

Scroll to explore

Compress AI context into semantic notation

Rules, images, code, URLs — shrink what your AI sees while preserving meaning

R AI Rules & Context ~83% reduction
Π Images ~99% reduction
Λ Code ~83% reduction
Γ URLs ~82% reduction

AI Rules & Context

CRUX extracts semantic cores. LLMs interpret it natively—no decompression, no special training.

Beyond Text: Image Compression

CRUX captures meaning, not bytes. That principle extends to images — extract the semantic visual description, discard the pixels.

How It Works

  1. 1
    Run /crux-compress @path/to/image.png in Cursor
  2. 2
    The agent uses vision to extract semantic content into a .crux.md file
  3. 3
    To “decompress”, feed the .crux.md to any LLM with image generation

Code Compression

CRUX captures the semantic structure of code — function signatures, control flow, IO patterns — while stripping syntactic verbosity. LLMs reconstruct functionally equivalent code from the notation alone.

What CRUX Preserves

Λ
Function signatures All 25+ function names preserved verbatim with parameter types and return values
Φ
Configuration & thresholds Exact threshold values, constants, and state variables maintained
Γ
Control flow & orchestration Main execution flow, section dispatch, and exit code logic
Ω
Decompression guidance emulate=shellcheck tells LLMs which linting semantics to apply

URL Compression

Compress any public webpage into CRUX notation. Fetch, extract, compress — turn verbose documentation sites into token-efficient semantic cores.

The Notation

A symbolic language LLMs interpret naturally. Click to explore.

⟦CRUX:source...⟧Block delimiters with source reference⟦CRUX:api.md ... ⟧
{k=v,k2=v2}Object / map{timeout=30,retries=3}
[a,b,c]List / array[js,ts,py]
.subNamespace (e.g., Π.core)R.style{...}
;Statement separatora=1; b=2
>Greater thansize>100
<Less thanlen<50
Greater or equalversion≥2.0
Less or equalline≤100ch
Not equalstatus≠deleted
..Rangeport=8000..9000
Preferred over / takes precedenceCONFIRMED≻DRAFT
Ranks below / lower priorityoptional≺required
Flows to / maps to / then∀changes→run_tests
Flows from / derives fromconfig←env_vars
»Then / next step / sequentialparse»validate»save
Has domain/expertiseagent⊳security
Triggered by / activated onhook⊲commit
@Located at pathconfig@/etc/app
:Has type / key-valueport:number
=Equals / defined asmax=100
Contains / includesdeps∋[react,vue]
|OR / alternativesformat=json|yaml
&AND / conjunctionvalid&complete
True / enableddebug=⊤
False / disabledcache=⊥
For all / universal∀files→lint
Exists / some∃config→load
¬Not / negation¬tabs!
ΔChange / update / deltaΔschema→migrate
+Add / include / with+tests,+docs
-Remove / exclude-node_modules
*Many / collectionfiles*→process
?Optionalconfig?
!Required / importantauth!
#Comment / note#deprecated
Optimal / target⊕performance
Critical / highest importance⊛security_check
Lowest importance / trivial◊formatting
Ρ{...}Repository/project contextΡ{api server}
E{...}Entities (agents, components)E{user,admin}
Λ{...}Commands/actionsΛ{build,test,deploy}
Π{...}Architecture (modules)Π{src/,lib/}
Κ{...}Concepts/definitionsΚ{token=JWT}
R{...}Requirements/guidelinesR{∀fn→test}
P{...}Policies/constraintsP{¬force push}
Γ{...}Orchestration (workflows)Γ{ci»cd»deploy}
M{...}Memory/stateM{session,cache}
Φ{...}ConfigurationΦ{port=3000}
Ω{...}Quality gatesΩ{cov≥80%}
View Full Specification on GitHub →

Quickstart

Installation

Prerequisites: curl, unzip, Cursor IDE

Terminal
curl -fsSL https://raw.githubusercontent.com/zotoio/CRUX-Compress/main/install.sh | bash

What Gets Installed

CRUX.mdSpecification (readonly)
AGENTS.mdAgent awareness notice
.cursor/rules/_CRUX-RULE.mdcAlways-applied rule
.cursor/agents/crux-cursor-rule-manager.mdCompression agent
.cursor/commands/crux-compress.mdCompression command
.cursor/hooks/crux-detect-changes.shChange detection hook
.cursor/hooks/crux-session-start.shSession start hook
.cursor/skills/crux-utils/Utility skill
.crux/crux.jsonVersion tracker

Usage

  1. 1
    Add crux: true to your rule file's frontmatter
  2. 2
    Run /crux-compress ALL in Cursor
  3. 3
    Watch your context breathe

Optional: add command-parameter plugins with /crux-compress ALL --plugin quality-gate.