From context_forge
This skill should be used when the user says "auto compact", "enable auto compact", "compact on context full", "automatic context compression", "prevent context limit errors", "set up auto compaction", or "context keeps hitting limit".
How this skill is triggered — by the user, by Claude, or both
Slash command
/context_forge:auto-compactThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Configure Claude Code to automatically compact conversation history when context approaches its limit, preventing hard stops and maintaining session continuity.
Configure Claude Code to automatically compact conversation history when context approaches its limit, preventing hard stops and maintaining session continuity.
When context window fills:
Compaction preserves:
Compaction discards:
Add to ~/.claude/settings.json (global) or .claude/settings.json (project):
{
"compactOnContextFull": true,
"compactThreshold": 0.85
}
compactThreshold: 0.85 = trigger compaction at 85% context usage.
To trigger manual compaction now:
/compact
Claude will summarize current context and continue with reduced token usage.
Configure hook to run before compaction for custom summary logic:
{
"PreCompact": [{
"hooks": [{
"type": "command",
"command": "bash $CLAUDE_PLUGIN_ROOT/hooks/scripts/pre-compact.sh",
"timeout": 15
}]
}]
}
Create hooks/scripts/pre-compact.sh with custom pre-compaction logic, for example:
#!/usr/bin/env bash
# Runs before Claude compacts context. Use to save state, log context usage, etc.
echo "Compacting context at $(date)" >> ~/.claude/compact.log
To manually compact with preserved context, use:
Compact context now.
Preserve:
- Current task: [TASK]
- Active files: [FILES]
- Current errors: [ERRORS IF ANY]
Summarize everything else. Continue where we left off.
Check current context fill level:
references/compact-strategies.md — Custom compaction strategies and PreCompact hook examplesSearches MemPalace before answering questions about past work, people, projects, or prior decisions. Returns verbatim stored content instead of guessing from model memory.
Guides Payload CMS config (payload.config.ts), collections, fields, hooks, access control, APIs. Debugs validation errors, security, relationships, queries, transactions, hook behavior.
Implements vector databases with Pinecone, Weaviate, Qdrant, Milvus, pgvector for semantic search, RAG, recommendations, and similarity systems. Optimizes embeddings, indexing, and hybrid search.
npx claudepluginhub kyuna0312/context_forge --plugin context_forge