- Home
- Skills
- Agents & Orchestration
- context juice
Works with the AI Agents you already use
context juice
Deterministic scripts to compact massive tool logs and squeeze conversation history to save tokens.
Free
context juice
Example session with this skill installed
The last npm install failed with a massive log. Use juice to summarize the output from /tmp/npm.log so I can see what went wrong without hitting the token limit.
- Read your context and instructions
- Compiled the context juice
I have processed the npm install logs. The raw output was reduced by 92%, successfully hoisting the specific module resolution error to the top.
Command Output Summary
exit: 1
duration: 4200ms
raw: 125400 chars → compacted: 3850 chars
lines: 142 unique (+812 duplicates trimmed)
errors: 1
warnings: 12
key errors:
error: module '@org/legacy-auth' not found in the registry
fatal: installation failed
--- head ---
npm info it worked if it ends with ok
npm info using npm@10.2.4
npm info using node@v20.10.0
npm http fetch GET 200 https://registry.npmjs.org/@org/core 150ms
[...942 middle lines trimmed...]
--- tail ---
npm ERR! A complete log of this run can be found in: /home/user/.npm/_logs/2024-05-20T10_15_00_Z-debug-0.log
[stderr] npm ERR! code E404
[stderr] npm ERR! 404 Not Found - GET https://registry.npmjs.org/@org/legacy-auth - Not found
Next steps
- Verify if
@org/legacy-authis the correct package name or if the registry configuration in.npmrcis missing. - Run the install again with
--verboseif you need to see the full network trace for the 404 error. - Use the raw log file at
/home/user/.npm/_logs/for a full audit of all 12 warnings.
Connects securely to your tools. The creator never sees your data.
About this skill
Token exhaustion and log noise kill agent performance. When tool outputs run for thousands of lines or conversation history bloats, context windows fill with duplicate logs and irrelevant prose. This skill provides a deterministic, offline solution to compress data before it reaches the model.
What it does
- Log Compaction collapses massive tool outputs by trimming middle lines while preserving the head, tail, and exit codes.
- Error Hoisting automatically extracts and promotes key errors and warnings to the top of the output for immediate visibility.
- Line Deduplication identifies and collapses exact duplicate lines with a count to save thousands of tokens on repetitive logs.
- Context Projection reduces long conversation histories using extractive sentence selection that keeps exact facts and anchors.
- ANSI Stripping removes invisible color codes and formatting that consume tokens without providing value to the model.
How it works
- Capture the raw output of a noisy command, including stdout, stderr, and the exit status.
- Juice the output using the script to shrink raw text into a summarized format with a specific character budget.
- Squeeze the message history when turns exceed limits, keeping the most recent messages verbatim while projecting older turns.
- Return the formatted result or projection to the model as the final tool output or updated context.
Frameworks & tools
This tool uses standalone Python 3.9+ scripts with zero external dependencies. It works in any CLI environment including Claude Code, Cursor, and custom agentic loops.
Why this beats prompting it yourself
Relying on a model to summarize its own context is slow, expensive, and risks losing critical details like exit codes or file paths. These scripts are deterministic, local, and preserve exact technical anchors that LLMs often hallucinate or omit during manual summarization.
Use cases
- Shrinking 50MB build logs into a 4KB summary that highlights why the build failed.
- Reducing a 50-turn conversation history to fit within a tight context window without losing project paths.
- Compacting large JSON search results into a readable head/tail format for quick analysis.
- Cleaning up noisy test suite outputs where hundreds of passing tests hide a single failure.
Known limitations
Juice only deduplicates exact line matches, so near-duplicates remain. Squeeze is extractive, not semantic, meaning nuance in old prose might be lost. Best-effort anchor preservation may clip data if the token budget is extremely low.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.
Deduplication requires exact line matches. Sentence extraction in history projection is lossy for prose. Does not perform semantic summarization or secret scanning. Requires Python 3.9+.
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 buying a skill.
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 to use
No account required to browse
Trust & safety
Security scan
Security scan passed 8 days ago
- Free with an Agensi account
- Software
Python