Agent skill
clear-memory
Clean up old memory files
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/productivity/clear-memory
SKILL.md
Clear Memory
Clean up old session files and optionally reset facts.
Usage
/memory-keeper:clear-memory [all|old]
Actions
Archive old files (recommended):
node "scripts/counter.js" compress
This archives session files older than 30 days into monthly archives:
sessions/2025-10-15_0300.md -> sessions/archive/2025-10.md
Clear facts only:
node "scripts/counter.js" clear-facts
Clears all facts (decisions, patterns, issues, concepts) but keeps _meta.
Clear everything (manual):
WARNING: Destructive operation
# Remove all session files
rm -rf .claude/memory/sessions/*.md
rm -rf .claude/memory/sessions/*.jsonl
# Reset facts
node "scripts/counter.js" clear-facts
# Optionally clear memory.md
rm .claude/memory/memory.md
Recommendations
- Regular maintenance: Run
compressmonthly - Before major changes: Create backup first
- Keep hierarchical files: Don't delete project.md, architecture.md, conventions.md
Notes
compressis non-destructive (archives, doesn't delete)clear-factspreserves counter state in_meta- Archived files can be manually reviewed in
sessions/archive/
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?