Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    TokenSaver

    1

    TokenSaver acts as a local-first compression layer that intercepts verbose shell logs, test failures, and large file reads, compacting them by up to 90% before they hit the LLM.

    Free

    Security scanned
    TokenSaver

    TokenSaver

    Example session with this skill installed

    Run the full test suite using npm test but make sure the output is compacted so we don't blow the context window. Show me the stats after.

    • Read your context and instructions
    • Compiled the tokensaver

    I have executed the test suite using compact_run. The output was automatically compacted to preserve your context window.

    Test Results

    [token-saver] shell: 850 lines/54200 B → 42 lines/2850 B. Full output: session.a1b2c3d4; use token-saver output_slice with startLine and maxLines.
    
    > project@1.0.0 test
    > jest
    
    PASS  src/auth.test.ts
    PASS  src/utils.test.ts
    FAIL  src/api/endpoints.test.ts
      ● GET /v1/users › should return 200 OK
    
        expect(received).toBe(expected) // Object.is equality
    
        Expected: 200
        Received: 500
    
        at Object.<anonymous> (src/api/endpoints.test.ts:24:29)
    
    [... 780 lines omitted ...]
    
    Test Suites: 1 failed, 2 passed, 3 total
    Tests:       1 failed, 14 passed, 15 total
    Snapshots:   0 total
    Time:        4.52 s
    [exit code: 1]
    

    Session Statistics

    [token-saver] session statistics (bytes/4 token estimates)
    compactions: 1 | duplicates avoided: 0 | retrievals: 0 | commands rewritten: 1 | sessions: 1
    original: 54,200 B | returned: 2,850 B | estimated reduction: 94.7% (~12,837 tokens)
    

    Next steps

    1. Run output_slice with artifactId: "session.a1b2c3d4" and startLine: 25 to see the full stack trace for the API failure.
    2. Fix the 500 error in src/api/endpoints.test.ts.
    3. Rerun the tests to verify the fix.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Stop wasting money on context-heavy tool outputs. TokenSaver acts as a local-first compression layer that intercepts verbose shell logs, test failures, and large file reads, compacting them by up to 90% before they hit the LLM.

    What it does

    • Deterministic compaction replaces thousands of lines of terminal output with high-signal snippets without using AI or external API calls.
    • Full-output persistence stores the original uncompressed logs in a local directory, making every omitted line recoverable by index.
    • Context preservation keeps critical metadata like exit codes, failure messages, file paths, and original line numbers visible.
    • Duplicate detection flags byte-identical repeat outputs to prevent the model from processing the same data twice.
    • Explicit MCP tools provide dedicated commands for optimized searching, reading, and command execution when automatic hooks are not desired.

    How it works

    1. Install the plugin or MCP server for your specific environment like Claude Code or Codex.
    2. Execute commands normally via built-in tools or use dedicated tools like compact_run and compact_search.
    3. Review compacted results marked with unique artifact IDs and statistics showing the compression ratio.
    4. Retrieve specific lines using the output_slice tool by providing the artifact ID and the required line range.

    Frameworks & tools

    This tool is built for Node.js 22+ and integrates with Claude Code, OpenAI Codex CLI, opencode, and Qoder. It utilizes ripgrep for optimized repository searching.

    Why this beats prompting it yourself

    Prompting an agent to be concise does not stop the tool from piping megabytes of raw terminal data into the context window first. TokenSaver intercepts this data at the plugin level, ensuring the model never sees or pays for the noise.

    Use cases

    • Debug test suites by viewing only the failures while keeping the full stack trace available for retrieval.
    • Search large codebases using ripgrep filters that prevent a single search from flooding the entire context.
    • Read massive logs or source files via head/tail previews that maintain line-number integrity.
    • Monitor long-running tasks without incurring massive token costs for repetitive progress updates.

    Known limitations

    Requires Node.js 22 or newer. Automatic file read compaction is disabled by default to prevent editing errors, requiring manual opt-in via environment variables.

    Requires Node.js 22+. Automatic read compaction is opt-in to avoid model editing errors. Codex CLI requires manual MCP tool selection instead of automatic output replacement.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 10 days ago

    • Free with an Agensi account

    Requires

    Node.js
    Git

    Permissions

    Terminal / Shell
    Network Access
    Read Files
    Write Files
    Environment Variables

    File Scopes

    ~/.token-saver/**

    Open source on GitHub (github.com/mhsenam/claude-codex-token-saver). Statistics are local-only JSONL with no command content. Full-output artifacts default to 24h retention in ~/.token-saver/outputs. Hooks fail open — a compaction error returns the original output.

    Listed10 days ago

    What's inside

    Frequently Asked Questions

    It acts as a local-first compression layer that intercepts verbose terminal outputs and file reads, stripping noise while keeping high-signal data, which prevents your LLM context window from being flooded by repetitive logs or massive files.

    Token Saver is designed for Node.js 22+ environments and features native integration with Claude Code, OpenAI Codex CLI, opencode, and Qoder via the Model Context Protocol (MCP).

    No, the compaction is deterministic and happens locally on your machine without using external AI calls, ensuring your data remains private and no additional tokens are spent to compress the logs.

    When output is compacted, Token Saver assigns it a unique artifact ID and stores the full raw log in a local directory, allowing you to use the `output_slice` tool to retrieve any specific missing lines by index.

    Yes, automatic file read compaction is disabled by default to ensure the LLM doesn't hallucinate during edits; you can easily enable this or adjust compression levels via environment variables.

    The purchase includes the full MCP server package, installation scripts for supported CLI agents, and comprehensive documentation for setting up custom hooks and tools.

    New in LLM Ops