Clear conversation context while preserving knowledge via context marker. Use when user says "clear context", "start fresh", "done with this task", or when approaching token limits.
Creates a context marker and guides you through clearing conversation history to free up tokens. Automatically sets up restoration for your next session.
/plugin marketplace add alekspetrov/navigator/plugin install navigator@navigator-marketplaceThis skill is limited to using the following tools:
Clear your conversation context while preserving all knowledge in a context marker. Like git commit before switching branches - save your state, then start fresh.
Invoke this skill when the user:
DO NOT invoke if:
Estimate conversation size:
Show message:
š Current session: ~[N] messages
Compacting will:
- Create marker with current state
- Clear conversation history
- Free up ~[X]k tokens for new work
Continue? [Y/n]:
Invoke nav-marker skill (or create marker directly) with auto-generated name:
Marker name: before-compact-{YYYY-MM-DD}-{HHmm}
Note: "Auto-created before compact"
This marker should capture:
Write the marker filename to .active file:
echo "{marker-filename}.md" > .agent/.context-markers/.active
This tells nav-start to offer restoration on next session.
Show user how to compact:
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā
ā šļø Navigator Compact ā
ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā
Context marker created:
.agent/.context-markers/{marker-filename}.md
š Marker contains:
- Conversation summary (last 15 messages)
- Files you modified
- Technical decisions made
- Current progress & next steps
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š¹ TO COMPACT:
Claude Code doesn't allow me to clear the conversation
programmatically. You need to do it manually:
**Method 1: New conversation**
1. Start a new conversation
2. Say "load my context" or "start my session"
3. I'll detect the active marker and restore your state
**Method 2: /clear command** (if available)
1. Type /clear
2. Say "load my context"
3. Active marker will be restored
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š” Your progress is saved. You won't lose any context.
Next session:
1. Say "start my session" or run /nav:start
2. I'll detect the marker: "{marker-filename}"
3. Confirm to restore, and you'll be back where you left off
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Verify marker was created:
ls -lh .agent/.context-markers/{marker-filename}.md
Show file size and confirm success:
ā
Marker saved successfully
File: {marker-filename}.md
Size: {X} KB (~{Y} tokens)
Your context is preserved!
Why manual compact?
Claude Code conversations cannot be programmatically cleared from within a conversation. The user must:
/clear command (if available)This skill creates the marker and sets up auto-restoration, but the actual clearing must be done by the user.
Auto-restoration workflow:
Session 1:
User: "Clear context"
ā nav-compact creates marker
ā Sets .active file
ā Instructs user how to clear
Session 2 (new conversation):
User: "Start my session"
ā nav-start detects .active file
ā Offers to restore marker
ā User confirms
ā Context restored!
User: "Feature complete, clear context for next task"
ā Creates marker: "before-compact-2025-10-16-1430"
ā Captures: Feature implementation details
ā User starts new conversation
ā Restores marker, begins next feature
User: "Context getting full, let's compact"
ā Creates marker: "before-compact-2025-10-16-1500"
ā Preserves: All current work
ā User clears conversation
ā Continues with fresh context
User: "Done with auth, moving to payments"
ā Creates marker: "auth-feature-complete"
ā Clear context
ā New session: Fresh start for payments
ā Can restore auth marker later if needed
Marker creation fails:
ā Failed to create marker
Cannot compact without preserving context.
Fix marker creation first.
Not enough context to preserve:
ā ļø Very little context (< 10 messages)
Compacting now won't save much. Consider:
- Continue working
- Compact after more progress
Continue anyway? [y/N]:
Active marker already exists:
ā ļø Active marker already exists:
.agent/.context-markers/.active
This means you have an unrestored marker from previous compact.
Options:
1. Load that marker first (recommended)
2. Overwrite with new marker
3. Cancel compact
Your choice [1-3]:
Compact is successful when:
.active file created (for auto-restoration)compact.py: Automated compact workflow
When to compact:
Compact frequency:
This skill automates the preparation for compacting but cannot clear the conversation itself (Claude Code limitation).
The value is in:
This provides same functionality as /nav:compact command but with natural language invocation.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.