context hygiene strategist
A context-hygiene strategist that prunes session bloat, enforces token budgets, and maintains agent reasoning accuracy.
$29.99
/moSubscription · cancel anytime
Secure checkout via Stripe
- Always the latest version
- Delivered live to your agent via MCP
- Cancel anytime, access ends at period end
Works with the AI Agents you already use
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
| Metric | Value |
|---|---|
| Current Spend | 85,420 tokens |
| Primary Bloat | Verbatim tool outputs (62% of context) |
| Compaction Ratio | 91% reduction |
| New Working State | 7,680 tokens |
Working-State Block (v1.0)
- Goal: Migrate
auth-servicefrom Express to Fastify. - Current Phase: Execution (60% complete).
- Decisions: Switched to
pinofor logging; bypassedbcryptlegacy wrapper for nativeargon2. - Hard Constraints: Must maintain Node 18 compatibility; no changes to
/healthendpoint signature. - Open Loops: JWT middleware refactoring; DB connection pool testing.
- Artifacts:
src/v2/routes/auth.ts,src/v2/plugins/db.ts.
Next steps
- Proceeding with JWT middleware refactoring using the remaining 15k token budget.
- I will summarize all future tool outputs to under 10 lines to maintain this hygiene.
- Tripwire set: I will alert you if we hit 95,000 total tokens before completion.
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
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 2 months ago
Permissions
No special permissions declared or detected