Agent skill
ac-context-compactor
Manage and compact context for long sessions. Use when context is filling up, creating handoff summaries, optimizing context usage, or preparing for session continuation.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/ac-context-compactor
SKILL.md
AC Context Compactor
Manage context usage and create compact summaries for session continuation.
Purpose
Monitors context usage and creates compact summaries when approaching limits, enabling seamless session continuation without losing critical information.
Quick Start
from scripts.context_compactor import ContextCompactor
compactor = ContextCompactor(project_dir)
if await compactor.should_compact():
summary = await compactor.create_compact_summary()
Context Management
Context threshold: 85%
│
├── Below 85%: Continue normally
├── At 85%: Create compact summary
└── Above 90%: Force handoff
Compaction Strategy
- Preserve: Critical state and progress
- Summarize: Completed features
- Extract: Key decisions and context
- Compress: Verbose information
Summary Structure
{
"session_summary": {
"features_completed": ["auth-001", "auth-002"],
"current_feature": "api-001",
"progress_percentage": 45.5
},
"key_decisions": [
"Using JWT for auth",
"PostgreSQL for database"
],
"active_context": {
"current_file": "src/api/routes.py",
"current_task": "Implementing user endpoint"
},
"next_actions": [
"Complete user endpoint",
"Add authentication middleware"
]
}
Integration
- Used by:
ac-session-managerfor auto-continuation - Triggers:
ac-handoff-creatorwhen compacting
API Reference
See scripts/context_compactor.py for full implementation.
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?