Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Nav Compact

ASecurity

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.

232 stars
0 votes
0 copies
1 views
Added 2/7/2026
ai-agentsbashgitdocumentation

Works with

claude code

Security Analysis

A100/100

Scanned 2/12/2026

Install to Claude Code

$npx -y skills add alekspetrov/navigator --skill nav-compact --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Nav Compact?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Nav Compact
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/alekspetrov-nav-compact/badge)](https://www.skillsdirectory.com/skills/alekspetrov-nav-compact)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: nav-compact
description: 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.
allowed-tools: Read, Write, Bash
version: 1.0.0
---

# Navigator Compact 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.

## When to Invoke

Invoke this skill when the user:
- Says "clear context", "start fresh", "reset conversation"
- Says "I'm done with this task", "moving to next feature"
- Mentions "approaching token limit", "context getting full"
- Says "compact", "clean up context"
- After completing isolated sub-task

**DO NOT invoke** if:
- User is in middle of implementation
- Context is needed for next immediate step
- Less than 20 messages in conversation (not much to gain)

## Execution Steps

### Step 1: Check If Worth Compacting

Estimate conversation size:
- If < 20 messages: Suggest waiting
- If 20-50 messages: Safe to compact
- If > 50 messages: Highly recommended

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]:
```

### Step 2: Create Automatic Marker

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:
- Last 10-15 messages summary
- Files modified
- Technical decisions
- Current progress
- Next steps

### Step 3: Set Active Marker

Write the marker filename to `.active` file:

```bash
echo "{marker-filename}.md" > .agent/.context-markers/.active
```

This tells `nav-start` to offer restoration on next session.

### Step 4: Display Compact Instructions

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

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```

### Step 5: Confirm Marker Location

Verify marker was created:

```bash
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!
```

## Important Notes

**Why manual compact?**

Claude Code conversations cannot be programmatically cleared from within a conversation. The user must:
- Start a new conversation, OR
- Use `/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!
```

## Common Use Cases

### After Completing Feature
```
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
```

### Approaching Token Limit
```
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
```

### Switching Between Tasks
```
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
```

## Error Handling

**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]:
```

## Success Criteria

Compact is successful when:
- [ ] Context marker created successfully
- [ ] Marker contains comprehensive summary
- [ ] `.active` file created (for auto-restoration)
- [ ] User knows how to clear conversation
- [ ] User knows marker will auto-restore on next session

## Scripts

**compact.py**: Automated compact workflow
- Create marker
- Set active file
- Generate restore instructions

## Best Practices

**When to compact:**
- āœ… After completing isolated feature/sub-task
- āœ… After major documentation update
- āœ… Before switching to unrelated work
- āœ… When approaching 70%+ token usage
- āŒ In middle of implementation
- āŒ When context needed for next step
- āŒ After every few messages (wasteful)

**Compact frequency:**
- Small task (30 min): No compact needed
- Medium task (2-3 hours): Compact after completion
- Large task (full day): Compact at logical breakpoints
- Multi-day task: Compact at end of each session

## Notes

This skill automates the preparation for compacting but cannot clear the conversation itself (Claude Code limitation).

The value is in:
1. Automatic marker creation
2. Setting up auto-restoration
3. Guiding user through process
4. Preserving context seamlessly

This provides same functionality as `/nav:compact` command but with natural language invocation.

Attribution

alekspetrovalekspetrov
View sourceMore from alekspetrov →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

1066601 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

686011 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

651 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →