compact
1
总安装量
1
周安装量
#44081
全站排名
安装命令
npx skills add https://github.com/duc01226/easyplatform --skill compact
Agent 安装分布
antigravity
1
gemini-cli
1
Skill 文档
Compact Context
Proactively compress the current conversation context to optimize token usage.
When to Use
- Before starting a new task in a long session
- When working on multiple unrelated features
- At natural workflow checkpoints (after commits, PR creation)
- When context indicator shows high usage
Actions
- Summarize completed work – What was done, key decisions made
- Preserve essential context – Active file paths, current task, blockers
- Clear redundant history – Old exploration, superseded plans
- Update memory – Save important patterns to
.claude/memory/
Best Practices
- Use
/compactat natural breakpoints, not mid-task - After compacting, briefly restate the current objective
- Check that critical file paths are still accessible
- If working on a bug, preserve error messages and stack traces
Context Preservation Checklist
Before compacting, ensure you’ve saved:
- Current branch and uncommitted changes status
- Active file paths being modified
- Any error messages or stack traces
- Key decisions and their rationale
- Pending items from todo list
Example Usage
User: /compact
Claude: Compacting context...
## Session Summary
- Implemented employee export feature
- Fixed validation bug in SaveEmployeeCommand
- Created unit tests for EmployeeHelper
## Active Context
- Branch: feature/employee-export
- Files: Employee.Application/Commands/ExportEmployees/
- Current task: Add pagination to export
## Cleared
- Exploration of unrelated notification code
- Superseded implementation approaches
Ready to continue with pagination implementation.
IMPORTANT Task Planning Notes
- Always plan and break many small todo tasks
- Always add a final review todo task to review the works done at the end to find any fix or enhancement needed