nap
Compact Claude Code context state to free disk and reduce token load.
Usage
When invoked, run the nap script:
python3 ~/code/npow-dotfiles/scripts/nap.py [flags]
Flags from user args
- If the user says
--dry-runor "dry run" or "what would it do": add--dry-run - If the user says
--deepor "deep" or "aggressive": add--deep - If no flags specified: run with
--dry-runfirst, show the report, then run for real
What it does
- PRUNE — deletes sagaflow run dirs older than 7 days (3 with --deep)
- COMPACT — removes dead pointers from MEMORY.md index files
- ARCHIVE — moves memory files not touched in 30 days (14 with --deep) to
archive/subdirs - COMPRESS — archives old aimee journal entries (>7 days or >50KB; >3 days or >20KB with --deep)
Workflow
- Run with
--dry-runfirst unless the user explicitly said to just do it - Show the report output to the user
- If dry-run, ask once: "Run it for real?" — then execute without
--dry-run - Show the final report