Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    DSH Token Optimizer

    1

    Audit DSH agent logs to identify redundant tool calls, retry loops, and quantified token waste.

    Free

    Security scanned
    DSH Token Optimizer

    DSH Token Optimizer

    Example session with this skill installed

    Analyze the logs in logs/production_run_042.txt and tell me why the cost spiked.

    • Read your context and instructions
    • Compiled the dsh token optimizer

    I have analyzed logs/production_run_042.txt. The audit identified a significant retry loop in the get_user_metadata tool and redundant reasoning steps during the final synthesis phase.

    DSH Token Optimization Report

    CategoryOccurrencesEstimated Waste (Tokens)Estimated Cost (USD)
    Redundant Tool Calls1428,400$0.42
    Retry Loops8112,000$1.68
    Duplicate Reasoning315,500$0.23
    Total25155,900$2.33

    Detected Patterns

    Tool Loop: The web_search tool was called 5 times with the exact same query "current stock price of AAPL" because the agent failed to parse the JSON response correctly.

    Context Bloat: The agent repeated its internal scratchpad logic regarding "user authentication status" in every turn of the 12-turn conversation, adding ~1,200 tokens per turn.

    Error Cycle: A 401 Unauthorized error from the database_query tool triggered a retry loop that persisted for 8 cycles before the agent gave up.

    Next steps

    1. Update the web_search parser to handle the specific JSON schema returned by the API.
    2. Refactor the system prompt to prevent the agent from re-stating authentication logic once verified.
    3. Implement a hard cap of 3 retries for the database_query tool to prevent runaway costs on auth failures.

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

    About this skill

    Debugging high agent costs often feels like hunting for ghosts in thousands of log lines. This skill audits local DSH agent logs to pinpoint exactly where redundant tool calls and retry loops are burning your budget.

    What it does

    • Waste identification scans logs for redundant tool calls that return identical data.
    • Loop detection flags recurring retry cycles where the agent fails to progress.
    • Reasoning analysis spots duplicate logic steps that inflate context window usage.
    • Cost estimation calculates the specific dollar amount wasted based on token counts.

    How it works

    1. Supply log path by pointing the script to your local DSH log file.
    2. Pattern matching identifies sequences of identical inputs or repeating error states.
    3. Quantification aggregates the total tokens consumed by these inefficient patterns.
    4. Reporting delivers a breakdown of waste categories and potential savings.

    Frameworks & tools

    This skill targets the DSH agent framework and requires a Python environment to execute the log analysis script.

    Why this beats prompting it yourself

    Manual log inspection is slow and prone to missing subtle repetition patterns across large files. This tool automates the pattern matching and math, providing an objective dollar value for the inefficiencies found.

    Use cases

    • Audit expensive agent runs to justify refactoring specific tools.
    • Identify brittle tool interfaces that trigger frequent retry loops.
    • Optimize prompt context by removing repetitive reasoning cycles.
    • Monitor token efficiency during agent development and testing.

    Known limitations

    Requires log files to be in the standard DSH text format. Does not perform real-time monitoring or live intervention.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.

    Requires logs in standard DSH text format. Analysis is performed on local files only, not via real-time streams or API connections.

    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 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 3 days ago

    • Free with an Agensi account

    Requires Python 3.9+. No external packages needed. Runs locally on your machine; no network calls or API keys required.

    Permissions

    Terminal / Shell
    Read Files

    File Scopes

    *.txt
    *.log

    The tool analyzes the file you provide locally. Nothing is uploaded.

    Listed3 days ago

    What's inside

    Frequently Asked Questions

    This skill is specifically designed to analyze logs generated by the DSH (Digital System Host) agent framework and requires the standard DSH text log format for accurate parsing.

    The skill identifies 'token waste' by scanning for redundant tool calls that return the same data, infinite retry loops caused by brittle tool interfaces, and repetitive reasoning cycles that unnecessarily inflate the context window.

    No, this is a post-run diagnostic tool that analyzes local log files after an agent execution to provide an objective breakdown of inefficiencies and cost-saving opportunities.

    You will receive the specialized Python analysis script, documentation on how to point it to your local log directories, and a guide on interpreting the generated cost-efficiency reports.

    By identifying the exact tool calls and logic loops that burn budget, developers can refactor specific tools or prompt structures to significantly reduce the dollar-per-run cost of their agents.

    New in LLM Ops

    Free