CH

    context hygiene strategist

    1

    A context-hygiene strategist that prunes session bloat, enforces token budgets, and maintains agent reasoning accuracy.

    $29.99

    /mo

    Subscription · cancel anytime

    Secure checkout via Stripe

    • Always the latest version
    • Delivered live to your agent via MCP
    • Cancel anytime, access ends at period end
    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more
    CH

    context hygiene strategist

    Example session with this skill installed

    We are 60% through the codebase migration. The session is getting slow and I'm worried about the $0.15/msg cost. Audit the context, set a 100k token budget, and compact the state.

    • Read your context and instructions
    • Compiled the context hygiene strategist

    I have audited the current session. The context is currently saturated with 85,000 tokens, primarily driven by verbatim compiler logs and redundant file reads from the src/legacy directory. I have set a hard budget of 100,000 tokens for this task, leaving 15,000 tokens for the final verification phase.

    Context Audit & Compaction Report

    MetricValue
    Current Spend85,420 tokens
    Primary BloatVerbatim tool outputs (62% of context)
    Compaction Ratio91% reduction
    New Working State7,680 tokens

    Working-State Block (v1.0)

    • Goal: Migrate auth-service from Express to Fastify.
    • Current Phase: Execution (60% complete).
    • Decisions: Switched to pino for logging; bypassed bcrypt legacy wrapper for native argon2.
    • Hard Constraints: Must maintain Node 18 compatibility; no changes to /health endpoint signature.
    • Open Loops: JWT middleware refactoring; DB connection pool testing.
    • Artifacts: src/v2/routes/auth.ts, src/v2/plugins/db.ts.

    Next steps

    1. Proceeding with JWT middleware refactoring using the remaining 15k token budget.
    2. I will summarize all future tool outputs to under 10 lines to maintain this hygiene.
    3. Tripwire set: I will alert you if we hit 95,000 total tokens before completion.
    $29.99/mo

    Subscription · always the latest version

    • Secure checkout via Stripe
    • Cancel anytime
    • Delivered live via MCP

    About this skill

    The problem

    Long agent sessions suffer from context bloat, leading to high API costs and a documented 23 to 31 percent drop in instruction-following accuracy. When an agent loses the plot or repeats itself, it is usually because the context window is crowded with low-value tool outputs and dead-end reasoning.

    What it does

    • Audits session context to identify verbatim tool dumps, redundant facts, and abandoned reasoning branches.
    • Implements a token budget protocol with tripwires at 50, 75, and 90 percent of capacity.
    • Compacts sessions into a high-density working-state block that preserves decisions and constraints while discarding fluff.
    • Enforces retrieval discipline by requesting specific document slices rather than full-file ingests.
    • Calculates phase-based costs to identify whether research, execution, or verification is draining the budget.

    Why this beats prompting it yourself

    General prompts fail to maintain hygiene over long durations, often resulting in "memory" that is just a messy log of every interaction. This skill provides a structured economic framework and a specific compaction playbook that forces the agent to treat tokens as a finite financial resource, maintaining model reasoning quality at scale.

    Use cases

    • Managing multi-hour coding sessions where tool outputs and linter logs threaten to drown out the original requirements.
    • Running large-scale research tasks where full-document retrieval would otherwise blow the token budget.
    • Optimizing production agent costs by replacing verbose narrations with terse, state-based progress tracking.
    • Recovering "lost" agents that have become sluggish or repetitive due to context saturation.

    Known limitations

    If the LLM provider does not expose real-time token counts, the strategist relies on message size estimation. It requires the agent to have the ability to summarize and replace its own history.

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

    Requires provider token counts or relies on size estimation. Effectiveness depends on the agent's ability to rewrite its own working state.

    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 2 months ago

    Permissions

    No special permissions declared or detected

    Listed2 months ago

    What's inside

    Frequently Asked Questions

    This skill prevents 'context drift' by auditing session logs and compacting low-value data into high-density state blocks, which reduces API costs and restores instruction-following accuracy.

    It is compatible with any LLM-based agent that supports history editing or summarization, though it works most effectively with models that provide real-time token count metadata.

    Yes, the strategist includes a monitoring protocol with tripwires at 50%, 75%, and 90% of your context window to prevent performance degradation before it happens.

    You receive the complete logic framework, the compaction playbook for state management, and the cost-calculation protocol to monitor research versus execution expenses.

    Setup involves integrating the strategist's pruning rules into your agent's system instructions and defining the specific document-slicing parameters for your retrieval tasks.

    The strategist significantly reduces the noise that causes agents to repeat themselves or hallucinate, specifically by discarding redundant tool outputs and abandoned reasoning branches.