Skip to content
Development
Command

/cleanup-context

Memory optimization - removes duplicates, consolidates knowledge, and cleans memory banks for better performance.

From plugin
fusengine-agents
2233 skills43 agents33 commands
Install
$ npx -y skills add fusengine/agents --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/cleanup-context

Context preview

What this command does when you run it.

Memory optimization - removes duplicates, consolidates knowledge, and cleans memory banks for better performance.

Command definition

cleanup-context.md
description: Memory optimization - removes duplicates, consolidates knowledge, and cleans memory banks for better performance.
disable-model-invocation: false

Cleanup Context

Executes the automatic cleanup script for Claude Code context.

Script Automatique

Run complete cleanup:

~/.claude/scripts/cleanup-context.sh

What Gets Cleaned (PERMANENT DELETION):

1. **file-history/** - Files >7 days deleted 2. **history.jsonl** - Deleted and reset 3. **hook-debug.log** - Deleted and reset 4. **security.log** - Deleted and reset 5. **session-env/** - Sessions >30 days deleted 6. **projects/** - Files >60 days deleted 7. **statsig/** - Completely emptied 8. **todos/** - Files >30 days deleted

⚠️ **No backup** - Permanent deletion

Cleanup Report

The script displays:

  • BEFORE state (number of files, lines, size)
  • Actions performed
  • AFTER state
  • Summary of deletions/archives

Example output:

🧹 Claude Code context cleanup

📊 BEFORE cleanup state:
  File history: 1234 files
  History.jsonl: 5678 lines
  Sessions: 89 files
  Total size: 245MB

🗑️ Cleaning file-history (>7 days)...
  ✓ 856 files deleted

🗑️ Deleting history.jsonl...
  ✓ Deleted and reset

✅ Cleanup complete!

📈 Summary:
  File history: 856 files deleted
  Sessions deleted: 34
  Logs deleted: hook-debug.log, security.log, history.jsonl

**Example Usage**:

  • `/cleanup-context` → Run complete cleanup
Read more
Ships withfusengine-agents

A plugin ecosystem that turns Claude Code into a supervised, multi-agent development environment.

Get the whole plugin, auto-invoked
Stats
22
Stars
1
Views
3
Forks
Active
Maintenance
CSS
Language
MIT
License
4d ago
Last commit
7mo ago
Created

Repo: fusengine/agents