From navigator
Preserves current context as a marker before clearing conversation history to free up tokens. Useful when switching tasks or hitting token limits.
How this skill is triggered — by the user, by Claude, or both
Slash command
/navigator:nav-compactThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Clear your conversation context while preserving all knowledge in a context marker. Like git commit before switching branches - save your state, then start fresh.
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:
Before doing anything else, check whether the project has the PreCompact hook installed.
HAS_HOOK=$(grep -l "nav_pre_compact" .claude/settings.json .claude/settings.local.json 2>/dev/null | head -1)
If the hook is present:
→ Fast path activated. The PreCompact hook will write the marker automatically when the user runs /compact (or when Claude Code auto-compacts). Skip Steps 2–5 (marker creation + .active writing) — the hook owns those. Just print:
╔══════════════════════════════════════════════════════╗
║ 🗜️ Navigator Compact (hook-managed) ║
╚══════════════════════════════════════════════════════╝
✅ PreCompact hook is installed — Navigator will write the
marker automatically when you run /compact.
Auto-compact is also covered: when Claude Code compacts
silently near the context limit, the hook still fires and
writes a marker tagged with `-auto-` in the filename.
Just run: /compact
The PostCompact hook will append Claude Code's official
summary to the marker once compact finishes. On your next
session, "Start my Navigator session" picks up the marker
via .active and offers restore.
That's it. Don't create a duplicate marker — the hook handles it deterministically.
If the hook is absent (legacy project, manually disabled, or pre-v6.10 install):
→ Legacy path. Execute Steps 1–5 below as documented. Manual marker creation, then user runs /compact.
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.
npx claudepluginhub alekspetrov/navigator --plugin navigatorCreate context save points to preserve conversation state before breaks, risky changes, or compaction. Use when user says 'save my progress', 'create checkpoint', 'mark this point', or before clearing context.
Preserves critical context data before Claude Code's automatic compression. Detects when compression is imminent and runs integrity-verified snapshot protocols.
Manages long-session context to prevent drift and degradation via proactive summarization, branch isolation, and compaction strategies. Invoke when context feels heavy, accuracy slips, or after a major phase boundary.