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

HookWhenWhat it does
PreToolUseBefore a command runsRewrites noisy commands to omni exec, preventing auto-truncation
PostToolUseAfter any tool runsDistills output as a safety net for unknown commands
SessionStartNew Claude session opensInjects previous session state — hot files, last errors, active context
PreCompactBefore Claude prunes historyProvides 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 or omni 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 Discoveryomni learn --status finds 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 | bash

Custom 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 = 30

See Also