/matts-second-brain:maintenance [install|status|run|dry-run|uninstall|test]from matts-second-brain
Manage the unattended nightly brain maintenance job (scan recent transcripts, persist durable knowledge, dedupe, reindex). Use when the user says 'set up brain maintenance', 'schedule brain consolidation', 'run brain maintenance now', or wants to check/disable it. Subcommands: install, status, run, dry-run, uninstall, test.
Ships in matts-second-brain. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A local cron runs maintenance/run.mjs, a tested harness that launches a headless
claude -p constrained to the mcp__second-brain__* tools to: scan recent transcripts,
recall + persist genuinely durable knowledge (deduping, not duplicating), and reindex
for semantic search. It is local because the brain backend (e.g. Trilium) is local —
a cloud /schedule routine could not reach it.
${CLAUDE_PLUGIN_ROOT} if set, else the repo root containing this skill.<plugin>/maintenance.userConfig from ~/.claude.json (pluginConfigs[*matts-second-brain*].options),
falling back to the manifest defaults:
scheduledMaintenance (default false), maintenanceSchedule (0 4 * * *),
maintenanceModel (claude-sonnet-4-6), scanSinceDays (2), maintenanceTimeoutMin (10).If scheduledMaintenance is false, tell the user to enable it (/config or the plugin
config) first — or confirm they want to install anyway. Then run, from the maintenance dir:
BRAIN_MAINT_CRON="<maintenanceSchedule>" \
BRAIN_MAINT_MODEL="<maintenanceModel>" \
BRAIN_MAINT_SINCE_DAYS="<scanSinceDays>" \
BRAIN_MAINT_TIMEOUT_MS="$(( <maintenanceTimeoutMin> * 60000 ))" \
bash install.sh
Then show crontab -l | grep matts-second-brain-maintenance to confirm. Remind the user
the cron runs as them, so the brain backend must be reachable from their account.
Show the installed entry (crontab -l | grep matts-second-brain-maintenance) and the last
few structured runs (tail -n 5 maintenance/logs/maintenance.log). Each line is JSON with a
status (ok / locked / unhealthy / failed / timeout) and, for completed runs, an
agent-summary of what was persisted/updated/skipped.
node maintenance/run.mjs — a real run. Warn first: it scans recent transcripts and may
persist a few notes. Afterwards show the new agent-summary log line.
node maintenance/run.mjs --dry-run — health-check + print the prompt, no agent invoked. Safe.
bash maintenance/install.sh --uninstall — removes the cron entry. Leaves logs in place.
cd maintenance && node --test — runs the harness test suite (lock/health/timeout/exit
semantics). Dependency-free; no build step.
What SKILL.md sets; muted values are Claude Code's defaults
6 skills in this plugin
/_disciplineThe behavioural rules Claude follows when matts-second-brain is installed. Loaded automatically — defines how to consult and write back to the brain. Always invoked at session start. Skip only if the user has explicitly disabled second-brain./hygienePeriodic brain hygiene: dedupe near-duplicate notes, flag stale file citations and contradictions, archive long-unused notes, and reindex. Use when the user says 'brain hygiene', 'consolidate the brain', 'clean up duplicate notes', 'find stale notes', or after a long burst of writing. Opt-in and dry-run by default./installSet up matts-second-brain end-to-end on this Claude instance: detect or install Trilium, prompt for an ETAPI token, register the MCP server, seed the brain taxonomy, optionally scan existing transcripts for inferable standards. Use when the user says things like 'set up second brain', 'install matts-second-brain', 'wire up Trilium memory', 'connect Claude to my notes'.Other plugins' skills for the same job
matts-second-brain@wrxck-claude-plugins is listed by wrxck/claude-plugins — review the source before installing
npx claudepluginhub wrxck/claude-plugins --plugin matts-second-brain