Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    context juice

    1

    Deterministic scripts to compact massive tool logs and squeeze conversation history to save tokens.

    Free

    Security scanned
    context juice

    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-auth is the correct package name or if the registry configuration in .npmrc is missing.
    • Run the install again with --verbose if 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

    1. Capture the raw output of a noisy command, including stdout, stderr, and the exit status.
    2. Juice the output using the script to shrink raw text into a summarized format with a specific character budget.
    3. Squeeze the message history when turns exceed limits, keeping the most recent messages verbatim while projecting older turns.
    4. 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.

    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. 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 8 days ago

    • Free with an Agensi account

    Requires

    Python

    Permissions

    Terminal / Shell
    Network Access
    Read Files
    Write Files
    Listed8 days ago

    What's inside

    Frequently Asked Questions

    Context Juice provides deterministic Python scripts that compress massive tool logs and long conversation histories, preventing token exhaustion and reducing costs while ensuring the LLM sees the most critical technical details like exit codes and error messages.

    The scripts are written in standalone Python 3.9+ with zero external dependencies, making them compatible with any environment that supports Python, including Claude Code, Cursor, and custom-built agentic frameworks.

    Unlike LLM-based summarization, these scripts are deterministic and run locally, meaning they are faster, free to execute, and won't hallucinate or omit exact file paths and technical anchors that a model might miss.

    You will receive the full suite of Python scripts for Log Compaction, Error Hoisting, Line Deduplication, Context Projection, and ANSI Stripping, along with documentation on how to integrate them into your agent's workflow.

    While Context Juice is excellent at collapsing repetitive logs and extracting errors, it uses extractive rather than semantic summarization for history, meaning it prioritizes exact facts and anchors over stylistic nuance in older messages.

    New in Agents & Orchestration