Skip to content

JWEB0689/DeNoiser

Repository files navigation

DeNoiser

Universal Token Compression CLI & MCP Server for LLM Agents

Stack

🛑 The Problem

When coding with AI Agents (like Claude Code, Cursor, Antigravity, etc.), running background terminal commands consumes massive amounts of context tokens. Commands like npm install, git status, or large test suites (pytest, jest) spit out thousands of lines of verbose logs, success indicators, and progress bars.

Blindly feeding this noise into the LLM context window leads to:

  • Exploding API Costs: Wasting tokens on useless boilerplate.
  • Context Degradation: The LLM "forgets" important instructions because its context is flooded with terminal noise.

💡 The Solution

DeNoiser is a high-performance Python utility that intercepts and heuristically filters command outputs before they reach your LLM.

  1. Strips Noise: Automatically drops progress bars, npm warnings, success checks, and verbose build logs.
  2. Isolates Errors: If a command fails, DeNoiser specifically hunts down the Exception/Traceback and extracts only the error lines, ensuring your agent instantly sees the problem without the bloat.
  3. Saves Tokens: Routinely reduces terminal output token consumption by 60-90%.
  Without denoiser:                               With denoiser:

  LLM Agent  --git status-->  git                 LLM Agent  --git status-->  DeNoiser  -->  git
                                |                                                       |          |
          ~2,000 tokens (raw)   |                            ~200 tokens        | filter   |
  <-----------------------------+                 <------------- (filtered) ----+----------+

🚀 Installation

You don't even need Python installed to use DeNoiser. You can download the pre-compiled, standalone executable directly from GitHub Releases!

  1. Go to the Releases page on this repository.
  2. Download the binary for your operating system:
    • Windows: denoiser-windows.exe
    • macOS: denoiser-macos
    • Linux: denoiser-linux
  3. Rename the downloaded file to just denoiser (or denoiser.exe on Windows).
  4. Move it into a directory that is in your system's PATH (e.g., C:\Program Files\DeNoiser or ~/.local/bin).

Alternatively, you can clone this repo and use the denoiser.bat wrapper if you prefer running it directly from the Python source!


🛠️ Usage (Standalone CLI)

Using DeNoiser is incredibly simple. Just prefix any noisy command with denoiser.

Example 1: Package Managers

denoiser npm install react

(DeNoiser will drop the hundreds of lines of npm WARN and added X packages lines, returning only critical failures if they occur).

Example 2: Testing Frameworks

denoiser pytest tests/

(DeNoiser strips all the test_xyz... ok lines. If a test fails, it extracts ONLY the traceback!)

🔍 Native Meta-Commands

DeNoiser includes several built-in commands to help you diagnose and verify your installation:

  • denoiser version: Display the current version.
  • denoiser list: List all currently loaded TOML filter rules (from builtin.toml).
  • denoiser test: Run a built-in diagnostic test. This artificially generates noisy terminal output and immediately filters it, allowing you to visually verify the engine is working on your machine.
  • denoiser discover: Scans your local machine for past AI agent sessions (Claude Code and Antigravity IDE) to extract past commands, calculate token coverage, and highlight which tools are frequently used but missing filters!
  • denoiser hook: Dynamically generates and installs cross-platform shell wrappers into your bash or PowerShell profile. Once installed, any AI (or human) running a command like npm install in the terminal will implicitly execute denoiser npm install behind the scenes!

🔌 Usage (MCP Server)

If you want to plug DeNoiser directly into an agent that supports the Model Context Protocol (MCP), you can attach it as a server to expose the native filter_command_output tool to the LLM.

First, install the required dependencies using uv or pip:

pip install -r requirements.txt

Then configure your agent (e.g., in Claude Desktop's claude_desktop_config.json):

{
  "mcpServers": {
    "denoiser": {
      "command": "python",
      "args": ["mcp_server.py"],
      "cwd": "/path/to/DeNoiser"
    }
  }
}

This grants the AI agent the autonomous ability to run the DeNoiser filtering algorithm on any text block it wants to compress!


Confidential Repository. Property of JWEB0689.

About

Audio/signal denoising tool

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors