nav-compact

nav-compact is a skill for Claude Code from alekspetrov/navigator. It costs 38 tokens per session (1,973 once invoked), scanned B, a copy of nav-compact, MIT.

A conversation-cleanup tool that clears the visible working context while saving a marker for important knowledge. It is intended for starting a fresh part of a task without losing the preserved context.

In plain words
What is it for?
Use it when changing tasks, finishing a task, or nearing the conversation's token limit. It also responds to requests to clear the context or start fresh.
Why use it?
Long coding conversations can become crowded or cause the agent to lose track of the current task. This helps reset the conversation when that happens.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions Claude Code.

Part of the navigator plugin — 35 skills, 6 agents shipped together

Good fit Use it when changing tasks, finishing a task, or nearing the conversation's token limit. It also responds to requests to clear the context or start fresh.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alekspetrov/navigator/nav-compact
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add alekspetrov/navigator --skill nav-compact
Clone the repo
git clone --depth 1 https://github.com/alekspetrov/navigator

Made for: Claude Code.

Or install navigator, the plugin that ships this one along with the rest of its 35 skills, 6 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nav-compact

README.md
[![agentmods](https://agentmods.dev/badge/skills/alekspetrov/navigator/nav-compact/github.svg)](https://agentmods.dev/skills/alekspetrov/navigator/nav-compact)
Your own site
<a href="https://agentmods.dev/skills/alekspetrov/navigator/nav-compact"><img src="https://agentmods.dev/badge/skills/alekspetrov/navigator/nav-compact/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nav-compact

Your own site · 80×15
<a href="https://agentmods.dev/skills/alekspetrov/navigator/nav-compact"><img src="https://agentmods.dev/badge/skills/alekspetrov/navigator/nav-compact.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,973 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00038 $0.01973
Opus 5.5 $0.00015 $0.00789
Sonnet 5.5 $0.00008 $0.00395
Haiku 4.5 $0.00004 $0.00197

Measured 2mo ago against content hash 0731e2cc29f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

nav-compact scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

HAS_HOOK=$(grep -l "nav_dispatch" .claude/settings.json .claude/settings.local.json 2>/dev/null | head -1)
Origin

This is a copy

100% identical to nav-compact — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/nav-compact/SKILL.md · 315 lines

How it starts

The opening of the file, as written. The whole thing — 315 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

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):

Read the full file on GitHub · 315 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago Changed 0731e2cc29f5
  2. 3mo ago First seen · 315 lines · 38 tokens per session scan B 2c874dcf971c

Subscribe to this mod's changes

nav-compact is a skill published in the GitHub repository alekspetrov/navigator (232 stars, last pushed 2mo ago), licensed MIT. It adds 38 tokens to every session and 1,973 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). It is 100% identical to nav-compact, differing in 0 lines, and is treated as a copy.

Related

nav-compact compared with skills from other repositories

nav-compact next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
nav-compactalekspetrov/navigatorSkill2322mo agoMITB38Claude Code
nav-compactqf-studio/navigatorSkill35814d agoMITB38Claude Code
nav-loopqf-studio/navigatorSkill35814d agoMITA43Claude Code
product-designqf-studio/navigatorSkill35814d agoMITA59Claude Code
social-media-postqf-studio/navigatorSkill35814d agoMITA46Claude Code
nav-skill-creatorqf-studio/navigatorSkill35814d agoMITA53Claude Code
nav-sopqf-studio/navigatorSkill35814d agoMITA40Claude Code