Skip to content

aspens doc sync

Keep generated context from drifting. doc sync reads recent git changes, maps them to affected skills and instructions, and updates only what changed.

Terminal window
npx aspens doc sync [path]
$ aspens doc sync
◆ aspens doc sync
◇ 4 files changed
src/services/billing/stripe.ts
src/services/billing/usage.ts
src/components/billing/PricingPage.tsx
package.json
ℹ Skills that may need updates: billing, base
◇ Analyzing changes and updating skills...
◇ 1 file(s) to update
~ .claude/skills/billing/skill.md
1 file(s) updated

Install a post-commit hook to sync automatically:

Terminal window
npx aspens doc sync --install-hook

The hook:

  • Runs after every commit
  • Has a 5-minute cooldown to avoid excessive runs
  • Skips commits that only change aspens-generated files
  • Rotates log files to prevent bloat
  • Works with all configured targets

Remove it with:

Terminal window
npx aspens doc sync --remove-hook

Review all skills against the current codebase state, without needing a git diff:

Terminal window
npx aspens doc sync --refresh

Useful after major refactors or when skills have drifted significantly.

OptionDescription
--commits <n>Number of commits to analyze (default: 1)
--refreshReview all skills against current codebase (no git diff needed)
--no-graphSkip import graph analysis
--install-hookInstall git post-commit auto-sync hook
--remove-hookRemove the git post-commit hook
--dry-runPreview without writing files
--timeout <seconds>Backend timeout (default: 300)
--model <model>Model for the selected backend
--verboseShow backend reads/activity in real time

If your repo is configured for multiple targets, doc sync updates all configured outputs from one run:

Terminal window
# Syncs both Claude and Codex docs
npx aspens doc sync