Works with the AI Agents you already use
TokenSaver
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
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
- Run
output_slicewithartifactId: "session.a1b2c3d4"andstartLine: 25to see the full stack trace for the API failure. - Fix the 500 error in
src/api/endpoints.test.ts. - 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
- Install the plugin or MCP server for your specific environment like Claude Code or Codex.
- Execute commands normally via built-in tools or use dedicated tools like
compact_runandcompact_search. - Review compacted results marked with unique artifact IDs and statistics showing the compression ratio.
- Retrieve specific lines using the
output_slicetool 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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
Permissions
File Scopes
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.