Skip to main content
command CX Codex

memory-gc — Claude Code command: rotate memory, install it

The memory-gc command checks the autopilot’s JSONL ledgers and rotates files that exceed a size cap. Use it when findings.jsonl or negatives.jsonl keeps growing.

MIT ★ 16,193 updated 2026-10-29

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add elementalsouls/Claude-BugHunter
/plugin install claude-bughunter@elementalsouls
Open on GitHub

What memory-gc does

memory-gc scans the ledger directory ~/.claude/bughunter/memory/, covering findings.jsonl, negatives.jsonl, and other *.jsonl files. With no options, it reports their current sizes. The --rotate flag moves files over the limit into numbered backups .1 through .3; the default cap is 10 MB and 3 backups are retained.

Use --dir <path> to inspect another ledger directory or --max-mb N to set a different cap. The --purge-backups option removes the old copies. From the repository root, the command runs python3 engine/memory.py --gc with the selected flags. Rotation also runs when a ledger entry is appended, so a session-end hook is not needed.

What it helps with

  • inspect autopilot ledger file sizes
  • rotate JSONL files above the cap
  • remove old ledger backups
  • scan a custom memory directory

Example prompts for the agent

  • Run /memory-gc and report the current ledger sizes.
  • Rotate files above the default limit with /memory-gc --rotate.
  • Purge backups in <path> using /memory-gc --purge-backups --dir <path>.

How to install memory-gc

1Plugin marketplace

/plugin marketplace add elementalsouls/Claude-BugHunter
/plugin install claude-bughunter@elementalsouls

2Manually: put the files in place

.claude/commands/memory-gc.md

Call it with /memory-gc. For all projects use ~/.claude/commands/

Questions about memory-gc

How do I install memory-gc in Claude Code?

Add the marketplace with /plugin marketplace add elementalsouls/Claude-BugHunter, then install the plugin with /plugin install claude-bughunter@elementalsouls. The command is placed at .claude/commands/memory-gc.md.

What does memory-gc do?

It reports autopilot ledger sizes, rotates files over the configured cap, and can remove retained backups.

Can I change the ledger directory and rotation limit?

Yes. Pass --dir <path> for another directory and --max-mb N for a custom cap. Add --purge-backups to remove all backups.

Source text

memory-gc.md · MIT
---
name: memory-gc
description: Inspect or rotate the autopilot ledger JSONL files (findings.jsonl, negatives.jsonl). Caps file size and keeps N rotated backups so memory does not grow unbounded.
---

# /memory-gc

Garbage-collect the autopilot ledger (`~/.claude/bughunter/memory/`). Reports current sizes, rotates oversized files past a configurable cap, or purges old backups.

## Usage

```
/memory-gc                       # report only
/memory-gc --rotate              # rotate files above 10 MB (default cap)
/memory-gc --rotate --max-mb 5   # custom cap
/memory-gc --purge-backups       # delete all .1/.2/.3 backups
/memory-gc --dir <path>          # scan a non-default ledger dir
```

## Implementation

The agent shells out to, from the repo root:

```bash
python3 engine/memory.py --gc [--rotate] [--purge-backups] [--dir PATH] [--max-mb N]
```

## Defaults

- **Rotation cap:** 10 MB per file · **Backups kept:** 3 (`<file>.1` newest → `<file>.3` oldest)
- **Scope:** every `*.jsonl` under the ledger dir (`findings.jsonl`, `negatives.jsonl`)

Rotation also fires automatically on append inside the ledger writer, so files stay bounded without any session-end hook.

© Sachin Sharma · MIT · elementalsouls/Claude-BugHunter

Similar slash commands

All slash commands for Agent setup: memory, context, orchestration →

From the same set92

The whole set →
offensive-osint The offensive-osint skill gives Claude Code technical references for external reconnaissance, from subdomain discovery to secret triage. Use it for authorized red-team or bug-bounty work. CX Codex +1 ★ 16,193repo stars remember remember — a slash command to manually add a note to a bug report or target system. The automatic capture during autopilot runs works on its own; this is for details the engine would miss. CX Codex +1 ★ 16,193repo stars pickup pickup pulls previous target recon from the Claude-BugHunter ledger to inspect tested endpoints, tech stack, and confirmed findings. CX Codex +1 ★ 16,193repo stars surface Shows a ranked attack surface for a target from its recon manifest and hunt memory. CX Codex +1 ★ 16,193repo stars intel Fetches target intelligence on demand: scans NVD and GitHub advisories, checks HackerOne reports, and flags untested endpoints from hunt memory. CX Codex +1 ★ 16,193repo stars scope scope is a Claude Code command that checks hosts and URLs before active testing. It blocks assets outside engagement rules during security work. CX Codex +1 ★ 16,193repo stars hunt-exceptional-conditions The hunt-exceptional-conditions skill reveals when an app leaks stack traces, server paths, or library versions through unhandled exceptions triggered by malformed input. Effective for testing APIs and web endpoints. CX Codex +1 ★ 16,193repo stars triage triage evaluates security findings through a 7-question gate before you write a bug report. It helps bug bounty hunters discard invalid submissions immediately. CX Codex +1 ★ 16,193repo stars

Project sponsors

Companies that keep this analytics open