Skip to content
Back to skills

Clear Memory

ASecurity

Clean up old memory files

  • 666 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 8, 2026
toolsbashnode

Security analysis

A93/100
  • highPerforms destructive filesystem operations

Pro shows the line behind each finding and how to fix it

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill clear-memory --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Clear Memory?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Clear Memory
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-clear-memory/badge)](https://www.skillsdirectory.com/skills/majiayu000-clear-memory)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: clear-memory
description: Clean up old memory files
---

## Script Path Resolution

**IMPORTANT:** The `scripts/` folder is in the plugin directory, NOT the current project.

From "Base directory for this skill:" above, derive the scripts path:
- Remove `/skills/clear-memory` from the end
- Add `/scripts/` to get the scripts directory

Example:
- Base: `~/.claude/plugins/cache/memory-keeper-marketplace/memory-keeper/13.8.3/skills/clear-memory`
- Scripts: `~/.claude/plugins/cache/memory-keeper-marketplace/memory-keeper/13.8.3/scripts/`

Use this full path when running node commands below.

# Clear Memory

Clean up old session files.

## Usage

```
/memory-keeper:clear-memory [all|old]
```

## Actions

### Archive old files (recommended):
Use full path from above:
```bash
node "{SCRIPTS_PATH}/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 everything (manual):

**WARNING: Destructive operation**

```bash
# Remove all session files
rm -rf .claude/memory/sessions/*.md
rm -rf .claude/memory/sessions/*.jsonl

# Optionally clear memory.md
rm .claude/memory/memory.md
```

## Recommendations

1. **Regular maintenance**: Run `compress` monthly
2. **Before major changes**: Create backup first

## Notes

- `compress` is non-destructive (archives, doesn't delete)
- Archived files can be manually reviewed in `sessions/archive/`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.