context and token optimizer
A high-density token compression and context management system that reduces prompt overhead by up to 75%.
$12
Works with the AI Agents you already use
context and token optimizer
Example session with this skill installed
Activate ultra mode and fix the type error in api/handler.ts where the response object is missing the status property. Use the scratchpad for tracking.
- Read your context and instructions
- Compiled the context and token
Ultra mode active. Updating .scratchpad.md and patching api/handler.ts.
Deliverable
# Session Memory Scratchpad
## Goal
Fix missing `status` property in `api/handler.ts` response.
## Active Invariants
- Response shape must include `status: number` and `data: any`.
## Completed Steps
- [x] Identified missing property in handler return type.
## Next Action
- [ ] Verify fix with `npm run lint`.
// api/handler.ts
export const handler = async (req: Request): Promise<ApiResponse> => {
const data = await fetchData();
// Fixed: added status property
return { status: 200, data };
};
Next steps
- Run
npm run lintto verify theApiResponseinterface matches. - Update
.scratchpad.mdonce linting passes. - Run
/caveman offif you require detailed explanations for the next task.
Connects securely to your tools. The creator never sees your data.
About this skill
High context usage leads to reasoning degradation and massive token waste. This skill implements a strict context management system that slashes repetitive overhead and prevents the context cliff.
What it does
- Token compression provides three density modes to reduce conversational fluff by up to 75% while keeping technical fidelity.
- Context hierarchy structures prompts into a five-level pyramid from persistent rules to isolated error frames.
- Proactive compaction uses a zero-dependency Python script to strip whitespace and redundant prose from markdown without breaking code.
- Structured memory maintains a lightweight
.scratchpad.mdto track goals and invariants without inflating the active context window. - Noise reduction enforces rules to trim stack traces and eliminate redundant summaries before code edits.
How it works
- Use
/cavemancommands (lite, full, or ultra) to set the communication density for the current session. - Apply the Context Window Hierarchy to load only the specific files or error segments required for the current task.
- Run the compression script on project documentation to minimize the footprint of reference materials.
- Maintain a
.scratchpad.mdin the root directory to track cross-task state and completed steps.
Frameworks & tools
This skill is language-agnostic. It includes a Python utility for markdown minification and uses standard Markdown for session tracking.
Why this beats prompting it yourself
Manual instructions to "be concise" often fail as sessions get longer and the model reverts to verbose defaults. This skill provides a systematic hierarchy and specific commands that force the model to stay within high-density constraints, saving thousands of tokens per hour.
Use cases
- Debugging long stack traces by isolating single frames instead of entire log files.
- Managing large project contexts where reasoning starts to degrade due to the context cliff.
- Reducing API costs for heavy users of LLM coding agents.
- Maintaining clear project state during complex, multi-step refactors.
Known limitations
Compressed modes may be too brief for users who prefer explanatory prose. The Python compression script requires a local environment to execute.
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 local Python for the compression script. Compressed modes significantly reduce conversational explanations. Memory is persistent within the active session only.
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
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 7 days ago