nap

Compress, prune, and archive agent histories in .squad state directories.

9|1|Updated Jul 21, 2025
One-click install
npx skills add https://github.com/usepowershell/PoshMcp --skill nap-usepowershell
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nap
Source: https://github.com/usepowershell/PoshMcp/tree/main/.squad/templates/skills/nap
Command: npx skills add https://github.com/usepowershell/PoshMcp --skill nap-usepowershell

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Agent sessions and .squad state can consume large amounts of the model context window over time, causing higher token costs, degraded performance, and reduced ability for agents to reason across long-running workflows. The nap skill reduces context bloat by compressing histories, pruning old logs, archiving stale decisions, and cleaning orphaned inbox files so active agents work with a smaller, relevant context set.

Core Features & Use Cases

  • Compress histories: Reduce token footprint by compressing or summarizing agent history files when they grow large.
  • Prune and archive: Remove or archive old logs and stale decision records to persistent storage to keep working directories lean.
  • Orphan cleanup & modes: Detect and remove orphaned inbox files and support dry-run and deep-clean modes for safe maintenance.
  • Use Case: Run before a large fan-out of agents or after prolonged sessions to ensure new agents start with a compact and relevant context window.

Quick Start

Run the nap cleanup to compress histories, prune old logs, archive stale decisions, and remove orphaned inbox files before starting a large fan-out.

Frequently Asked Questions about nap

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compress agent history files to reclaim context window budget?

Reduce context window bloat by compressing agent history files and pruning old logs. This reclaims token budget by archiving stale decisions and cleaning orphaned inbox files.

When should I prune and archive agent state directories?

Prune agent state before heavy fan-out, after long REPL sessions, or when history.md files exceed 15KB or 1MB total thresholds to maintain lean working directories.

Does context-hygiene cleanup support a dry-run mode for local CLI workflows?

Yes, context-hygiene cleanup supports a dry-run mode for local CLI workflows. This allows safe maintenance by previewing history compression and orphaned inbox file removal before execution.

What is the best way to clean orphaned inbox files and reduce context bloat?

Reduce context bloat by running deep-clean mode to detect and remove orphaned inbox files, compress histories, and archive stale decisions to persistent storage for lean working directories.

Why does agent history compression matter before a large fan-out?

Agent history compression before large fan-out ensures new agents start with a compact context window. This prevents token cost spikes and degraded reasoning performance across long-running workflows.