Agent skill
memory-optimization
Summarizing context, pruning history, and managing token budget efficiency.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/ops-andreibesleaga-gabbe-2
SKILL.md
memory-optimization Skill
This skill prevents "Context Overflow" and reduces API costs.
1. Summarization Strategies
- Rolling Summary: Keep the last 10 messages + a summary of everything before.
- Entity Extraction: Extract key facts ("User chose Redis", "App is on port 3000") and store in
semantic/.
2. Context Pruning
- Irrelevant Files: Only keep file definitions in context if actively editing. Use
grepfor others. - Old Logs: Truncate logs > 50 lines.
3. The "Forget" Protocol
- When a task is done:
- Summarize: Write outcome to
AUDIT_LOG.md. - Clear: Remove task-specific context from working memory.
- Retain: Keep only global constraints and active file list.
- Summarize: Write outcome to
4. Semantic Memory Integration
- Use Qdrant or PGVector (via MCP) to store embeddings of documentation.
- Retrieval: Retrieve only the Top-3 relevant chunks for the current query.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?