OMNI
A Rust CLI tool and MCP server that intercepts terminal output and distills it into high-density signals before it reaches an AI agent — reducing token consumption by up to 90% with zero information loss.
- Author: fajarhide (Fajar Hidayat)
- Language: Rust (92.7%)
- License: MIT
- Latest release: v0.5.4-rc4
- Homepage: https://omni.weekndlabs.com
The Problem It Solves
AI agents consume everything the terminal outputs. A git diff can eat 10K tokens; a cargo test can dump 25K tokens of redundant noise. Most of it is distraction that:
- Drains your token budget and increases cost per message
- Dilutes LLM reasoning by burying it in raw logs
- Gets auto-truncated by Claude Code, potentially hiding the exact error needed
How It Works
OMNI sits between the terminal and the agent as a Semantic Signal Engine — classifying, scoring, and composing output into tiered signals. Original output is never discarded; it’s archived in the rewind-store.
Four Hook Points
| Hook | When | What it does |
|---|---|---|
PreToolUse | Before a command runs | Rewrites noisy commands to omni exec, preventing auto-truncation |
PostToolUse | After any tool runs | Distills output as a safety net for unknown commands |
SessionStart | New Claude session opens | Injects previous session state — hot files, last errors, active context |
PreCompact | Before Claude prunes history | Provides a permanent summary so long-term project memory stays sharp |
Signal Pipeline
Raw CLI Output
↓
Classifier → Scorer (context boost) → Composer (signal tiering)
↓
Distilled Signal → Agent
↓ (original archived)
RewindStore (SQLite + SHA-256)
Key Features
- RewindStore — original output archived with SHA-256 hash; retrieve via
omni_retrieve("hash")MCP call oromni rewind show <hash>CLI omni diff— side-by-side comparison of raw input vs distilled signal- Session Intelligence — tracks hot files and recurring errors across sessions
- Pattern Discovery —
omni learn --statusfinds new candidate noise filters - Custom TOML filters — define distillation rules for internal tools
- Analytics dashboard — built-in per-project token savings reporting
Quick Start
# Install (macOS/Linux)
brew install fajarhide/tap/omni
# Full setup (hooks + MCP server)
omni init --all
# Verify
omni doctor
# Universal install
curl -fsSL https://omni.weekndlabs.com/install | bashCustom Filter Example
# ~/.omni/filters/deploy.toml
schema_version = 1
[filters.deploy]
description = "Internal deployment tool"
match_command = "^deploy\\b"
[[filters.deploy.match_output]]
pattern = "Deployment successful"
message = "deploy: ✓ success"
strip_lines_matching = ["^\\[DEBUG\\]", "^Connecting"]
max_lines = 30See Also
- context-distillation — the core concept behind OMNI
- rewind-store — zero information loss archive
- llm-wiki-vs-rag — related idea of reducing token waste through better information structure