Automatically summarizes conversation context and cleans up old messages to prevent context overflow and save tokens.
Description
This skill periodically summarizes the conversation into 10-20 bullet points plus facts to remember, saves them to memory, then clears the old context while keeping only the summary.
Triggers
Manual activation: "optimize context", "clean context", "summarize and clear"
Scheduled: Can be run periodically via cron to maintain optimal context size
Process
Analyze current conversation context
Extract key points into 10-20 bullet points
Identify important facts to remember
Save summary to memory files
Clear old context while preserving essential information
memory/context-history.json - Tracks context optimization history
Configuration
Summary frequency (manual or scheduled)
Number of bullet points to generate
Retention period for context
1---2name: context-optimizer-23description: Context Optimizer Skill4---5# Context Optimizer Skill67Automatically summarizes conversation context and cleans up old messages to prevent context overflow and save tokens.89## Description10This skill periodically summarizes the conversation into 10-20 bullet points plus facts to remember, saves them to memory, then clears the old context while keeping only the summary.1112## Triggers13- Manual activation: "optimize context", "clean context", "summarize and clear"14- Scheduled: Can be run periodically via cron to maintain optimal context size1516## Process171. Analyze current conversation context182. Extract key points into 10-20 bullet points193. Identify important facts to remember204. Save summary to memory files215. Clear old context while preserving essential information2223## Files Used24- memory/context-summary-YYYY-MM-DD.md - Stores conversation summaries25- MEMORY.md - Updates with important facts26- memory/context-history.json - Tracks context optimization history2728## Configuration29- Summary frequency (manual or scheduled)30- Number of bullet points to generate31- Retention period for context
Run npx skillmds@latest add kernel8901/context-optimizer-2 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Context Optimizer Skill It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
kernel8901 (@kernel8901) published this skill. Their other Agent Skills are listed on their SkillMD profile.