Agent skill

Nav Compact

by qf-studio in qf-studio/navigator

Clear conversation context while preserving knowledge via context marker.

MITAuto-check: notes

Install Nav Compact

skills CLI
$ npx skills add qf-studio/navigator --skill nav-compact -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install qf-studio/navigator nav-compact --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/qf-studio/navigator.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/nav-compact .claude/skills/nav-compact && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
nav-compact
GitHub stars
355
Token cost
~2.1k tokens
SKILL.md length
543 words
Files
1
Skills in repo
32
Repo updated
First seen
Licence
MIT

At a glance

Clear conversation context while preserving knowledge via context marker.

  • Works in 6 steps: Detect PreCompact Hook (Fast Path)… → Check If Worth Compacting → Create Automatic Marker → …
  • User says clear context
  • SKILL.md covers When to Invoke, Execution Steps, Important Notes and Common Use Cases, plus 5 more sections
  • Calls just and claude

What it does

Nav Compact is an agent skill from qf-studio/navigator. 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.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Finish What You Start — Context engineering for Claude Code. Sessions last 20+ exchanges instead of crashing at 7. The licence is MIT.

When your agent uses it

  • User says clear context
  • Done with this task
  • Approaching token limits

Example prompts

  • “clear context”
  • “start fresh”
  • “done with this task”
  • “/nav-compact”

Requirements

  • Pre-approved tools (allowed-tools): Read, Write, Bash

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Detect PreCompact Hook (Fast Path) [v6.10.0+]
  2. Check If Worth Compacting
  3. Create Automatic Marker
  4. Set Active Marker
  5. Display Compact Instructions
  6. Confirm Marker Location

What it can do on your machine

Read from SKILL.md and the folder at commit 3bb9eac. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • just
    • claude

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Nav Compact loads about 2.1k tokens when it runs. Until then it costs about 48 tokens; SKILL.md has 543 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~48
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Bash

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from qf-studio/navigator at commit 3bb9eac, republished under its MIT licence (© qf-studio). 543 words, ~2,100 tokens.

Download SKILL.mdSave it as .claude/skills/nav-compact/SKILL.md (or your agent's skills folder).
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 0: Detect PreCompact Hook (Fast Path) [v6.10.0+]

Before doing anything else, check whether the project has the PreCompact hook installed.

bash
HAS_HOOK=$(grep -l "nav_dispatch" .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.


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!
Show full SKILL.md (242 more words)Show less

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.

© qf-studio, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/nav-compact of qf-studio/navigator.

Open the folder on GitHubat commit 3bb9eac

Compare with similar skills

Nav Compact next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Nav Compact compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Nav Compact this skillqf-studio/navigator355—~2.1kAutomated safety check: NotesMIT
Strategic Compactaffaan-m/ECC276k1 repos~2.1kAutomated safety check: PassMIT
Conversation CompactionPrismer-AI/PrismerCloud1.6k—~1.5kAutomated safety check: PassMIT
Modeling Conversion MetricsPostHog/posthog40k—~1.4kAutomated safety check: PassCustom licence
Cost Conversationruvnet/ruflo74k—~407Automated safety check: NotesMIT
Conversation Memorydavila7/claude-code-templates32k4 repos~440Automated safety check: PassMIT

Similar skills

  • Strategic Compact

    affaan-m/ECC

    Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.

    276k GitHub starsUsed in 1 repo~2.1k tokens
    Agent WorkflowsAuto-check passed
  • Conversation Compaction

    Prismer-AI/PrismerCloud

    Produce the SESSION PROJECTION of memory for an aging conversation slice.

    1.6k GitHub stars~1.5k tokensUpdated 9 days ago
    Auto-check passed
  • Official

    Build reusable conversion models — funnel/step conversion rates, drop-off, and time-to-convert — on either PostHog data-warehouse views (HogQL) or an external dbt project.

    40k GitHub stars~1.4k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Cost Conversation

    ruvnet/ruflo

    Per-conversation cost view — list every session in cost-tracking with started-at, message count, top model, and total cost

    74k GitHub stars~407 tokensUpdated today
    AI & LLM EngineeringAuto-check: notes
  • Conversation Memory

    davila7/claude-code-templates

    Persistent memory systems for LLM conversations including short-term, long-term, and entity-based memory Use when: conversation memory, remember, memory persistence, long-term memory, chat history.

    32k GitHub starsUsed in 4 repos~440 tokens
    Agent WorkflowsAuto-check passed
  • Conversation Archive

    garrytan/gbrain

    Import AI-assistant chat exports (ChatGPT, Claude, Perplexity) and agent session transcripts into the brain as one dated page per conversation under conversations/, validate each page against the…

    31k GitHub stars~5.6k tokensUpdated today
    Productivity & AutomationAuto-check passed

More from qf-studio/navigator

All 32 skills in this repo
  • Nav Start

    qf-studio/navigator

    Load Navigator documentation navigator when starting development session, resuming work, or beginning new feature.

    355 GitHub stars~4.7k tokensUpdated yesterday
    Auto-check: notes
  • Backend Endpoint

    qf-studio/navigator

    Create REST/GraphQL API endpoint with validation, error handling, and tests.

    355 GitHub stars~4.5k tokensUpdated yesterday
    Auto-check: notes
  • Backend Test

    qf-studio/navigator

    Generate backend tests (unit, integration, mocks) for existing code.

    355 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check: notes
  • Database Migration

    qf-studio/navigator

    Create database migration with schema changes and rollback. An agent skill from qf-studio/navigator.

    355 GitHub stars~3.7k tokensUpdated yesterday
    Auto-check: notes
  • Frontend Component

    qf-studio/navigator

    Create React/Vue component with TypeScript, tests, and styles.

    355 GitHub stars~4.5k tokensUpdated yesterday
    Auto-check: notes
  • Frontend Test

    qf-studio/navigator

    Generate frontend component tests (React Testing Library, Vue Test Utils, snapshot) for existing components.

    355 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check: notes

Questions about Nav Compact

What does Nav Compact do?

Clear conversation context while preserving knowledge via context marker. Nav Compact is an agent skill from qf-studio/navigator. Clear conversation context while preserving knowledge via context marker.

When should I use Nav Compact?

Nav Compact fits situations like: user says clear context; done with this task; approaching token limits.

How do I install Nav Compact in Claude Code?

Run `npx skills add qf-studio/navigator --skill nav-compact -a claude-code`. Or copy the skill folder (skills/nav-compact in qf-studio/navigator) into .claude/skills/nav-compact in your project. Claude Code loads it when a task matches its description.

How do I install Nav Compact in Codex?

Run `npx skills add qf-studio/navigator --skill nav-compact -a codex`. Or copy the skill folder (skills/nav-compact in qf-studio/navigator) into .agents/skills/nav-compact in your project. Codex loads it when a task matches its description.

Can I use Nav Compact in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add qf-studio/navigator --skill nav-compact -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/nav-compact, .gemini/skills/nav-compact, .github/skills/nav-compact and .opencode/skills/nav-compact in your project.

What does Nav Compact need to run?

Going by SKILL.md and its folder, Nav Compact needs the command-line tools its instructions call (just and claude). Its frontmatter pre-approves these tools: Read, Write, Bash.

Does Nav Compact access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Nav Compact safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Nav Compact use?

Nav Compact is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Nav Compact use?

About 2.1k tokens (SKILL.md is roughly 8.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Nav Compact?

Skills that share tags, products or a category with Nav Compact: Strategic Compact (affaan-m/ECC, 276k stars), Conversation Compaction (Prismer-AI/PrismerCloud, 1.6k stars), Modeling Conversion Metrics (PostHog/posthog, 40k stars) and Cost Conversation (ruvnet/ruflo, 74k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Nav Compact?

qf-studio (a GitHub organization) maintains it in qf-studio/navigator, which has 355 GitHub stars. The repository holds 32 skills in this directory. The repository was last updated on October 8, 2026.

Source: qf-studio/navigator on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.