From for-the-record
Delete old discussion files based on retention preferences, explicit age, or interactive selection. Respects configured retention and always confirms before deleting.
How this skill is triggered — by the user, by Claude, or both
Slash command
/for-the-record:prune-discussionsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
<purpose>
<load-config>
<action>Resolve the user's home directory.</action>
<command language="bash" output="home" tool="Bash">echo $HOME</command>
<constraint>Never pass `~` to the Read tool.</constraint>
<read path="<home>/.things/config.json" output="config" />
<if condition="config-missing">Tell the user: "Run `/things:setup-things` first." Then stop.<exit /></if>
<read path="<home>/.things/for-the-record/preferences.json" output="preferences" />
<if condition="preferences-missing">Tell the user: "Run `/setup-ftr` first." Then stop.<exit /></if>
</load-config>
Determine Pruning Mode
<action>Parse `$ARGUMENTS` for:</action>
- **--older-than <days>**: Delete discussions older than N days
- **--interactive**: Show all discussions for manual selection
<if condition="--interactive">
<action>Use interactive mode (step 4).</action>
</if>
<if condition="--older-than provided">
<action>Use the explicit days value.</action>
</if>
<if condition="no flags">
<action>Use `preferences.discussion_retention_days`.</action>
<if condition="discussion_retention_days is null or missing">
<action>Tell the user: "No retention policy configured and no `--older-than` flag provided. Either run `/setup-ftr reconfigure` to set `discussion_retention_days`, or use `--older-than <days>` or `--interactive`." Then stop.</action>
<exit />
</if>
</if>
Find Deletion Candidates (age-based)
<if condition="age-based mode">
<action>List all `.md` files in `<home>/.things/for-the-record/discussions/`. Parse the date from each filename (YYYY-MM-DD prefix) or from frontmatter. Calculate age in days from today.</action>
<action>Filter to files older than the threshold.</action>
<if condition="no candidates">
<action>Tell the user: "No discussions older than <N> days found." Then stop.</action>
<exit />
</if>
<output>
Discussions older than <N> days:
1. <filename> (<date>, <age> days old)
2. <filename> (<date>, <age> days old)
...
Total: <count> files to delete
</output>
<ask-user-question>
<question>Delete these <count> discussions?</question>
<option label="Yes">Delete all listed discussions</option>
<option label="No">Cancel -- keep everything</option>
</ask-user-question>
</if>
Interactive Selection
<if condition="interactive mode">
<action>List all `.md` files in `<home>/.things/for-the-record/discussions/` with date and title from frontmatter.</action>
<if condition="no discussions">
<action>Tell the user: "No discussions found." Then stop.</action>
<exit />
</if>
<output>
Discussions:
1. <filename> -- "<title>" (<date>)
2. <filename> -- "<title>" (<date>)
...
</output>
<ask-user-question>
<question>Which discussions would you like to delete? Enter numbers (e.g., "1,3"), a range (e.g., "1-5"), or "all".</question>
</ask-user-question>
<ask-user-question>
<question>Confirm: delete <count> selected discussions?</question>
<option label="Yes">Delete selected discussions</option>
<option label="No">Cancel</option>
</ask-user-question>
</if>
Delete Files
<action>Delete each confirmed file from `<home>/.things/for-the-record/discussions/`.</action>
<command language="bash" tool="Bash">rm "<home>/.things/for-the-record/discussions/<filename>"</command>
Trigger Rebuild
<action>Read `<home>/.things/registry.json` to find the rebuild command for `for-the-record/discussions`. Execute it.</action>
<constraint>If the rebuild command is not found, fall back to: `python3 <cached-path>/scripts/rebuild-index.py <home>/.things`</constraint>
Handle Git Workflow
<git-workflow>
<action>Pull latest before committing.</action>
<command language="bash" tool="Bash">git -C <home>/.things pull --rebase 2>/dev/null || true</command>
<action>Read git workflow from `config.json` (`git.workflow`).</action>
<if condition="workflow-auto">Automatically `git add`, `git commit -m "prune: <count> discussions"`, and `git push`.</if>
<if condition="workflow-ask">
<ask-user-question>
<question>Commit and push the pruned discussions?</question>
<option>Yes -- commit and push</option>
<option>Commit only</option>
<option>No -- I'll handle git myself</option>
</ask-user-question>
</if>
<if condition="workflow-manual">Tell the user the pruning is complete.</if>
</git-workflow>
Confirm
<completion-message>
Pruned <count> discussions.
Remaining: <remaining-count> discussions in `for-the-record/discussions/`
</completion-message>
npx claudepluginhub brennacodes/brenna-plugs --plugin for-the-recordManually reviews and prunes stale project_* memory entries older than 30 days. Keeps MEMORY.md under the 200-line auto-load limit without auto-deleting.
Audits and selectively forgets stored Claude Code memories. Use when memory is large/uncurated, project state has shifted, or retrieval quality degraded.
Reviews, consolidates, and prunes Claude Code project memory files. Supports dry-run and atomic apply modes for safe batch maintenance.