brain-backfill

brain-backfill is a command for coding agents from fiale-plus/fiale-claude-plugins. It costs 13 tokens per session (626 once invoked), scanned B, original, MIT.

A command that finds older Claude Code session transcripts, filters them by date, length, and processing status, and queues them for later synthesis.

In plain words
What is it for?
Use it to import sessions from the last 30 days or a chosen date range, preview what would be queued, view statistics, and limit how many are added per run.
Why use it?
It brings past sessions into the knowledge workflow without manually locating and selecting each transcript.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the brain plugin — 10 commands, 3 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/fiale-plus/fiale-claude-plugins/backfill
Clone the repo
git clone --depth 1 https://github.com/fiale-plus/fiale-claude-plugins

Or install brain, the plugin that ships this one along with the rest of its 10 commands, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for brain-backfill

README.md
[![agentmods](https://agentmods.dev/badge/commands/fiale-plus/fiale-claude-plugins/backfill.svg)](https://agentmods.dev/commands/fiale-plus/fiale-claude-plugins/backfill)
Your own site
<a href="https://agentmods.dev/commands/fiale-plus/fiale-claude-plugins/backfill"><img src="https://agentmods.dev/badge/commands/fiale-plus/fiale-claude-plugins/backfill.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 626 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00013 $0.00626
Opus 5 $0.00006 $0.00313
Sonnet 5 $0.00003 $0.00125
Haiku 4.5 $0.00001 $0.00063

Measured 3d ago against content hash 73b244ff6286, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

brain-backfill scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

cat ~/.claude/brain/config.json
plugins/brain/commands/backfill.md · 85 lines

How it starts

The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Queue historical Claude Code transcripts from this or another machine for synthesis. Runs backfill.py which scans for .jsonl files and filters by date, length, and already-processed status.

Usage

  • /brain-backfill — queue from default ~/.claude/projects/, last 30 days, max 50
  • /brain-backfill --stats — show statistics without modifying the queue
  • /brain-backfill --since 2026-01-01 --limit 50 — queue specific date range
  • /brain-backfill --dry-run — show what would be queued

Steps

1. Check config

cat ~/.claude/brain/config.json

Confirm vault_path exists.

2. Run with no arguments (default)

If no arguments were given, run stats first then prompt:

python3 ${CLAUDE_PLUGIN_ROOT}/bin/backfill.py ~/.claude/projects --stats

Show the output. Then ask:

"Queue transcripts from how many days back? Default: 30. Enter a number or 'all'."

And:

"Max transcripts to queue per run? Default: 50."

Then run:

python3 ${CLAUDE_PLUGIN_ROOT}/bin/backfill.py ~/.claude/projects --since <SINCE_DATE> --limit <LIMIT>

3. Run with explicit arguments

If arguments were provided (e.g. --since 2026-01-01 --stats), pass them directly:

python3 ${CLAUDE_PLUGIN_ROOT}/bin/backfill.py <ARGS>

Show the complete output.

4. After queuing

If transcripts were queued, report:

  • How many were queued and their date range
  • How many remain in queue total
  • "Run /synthesize to process them, or they will be auto-processed on your next session start."

Importing from another machine

To import transcripts from another machine:

On the source machine:

tar czf claude-sessions.tar.gz ~/.claude/projects/
scp claude-sessions.tar.gz thishost:~/.claude/brain/import/laptop2.tar.gz

On this machine:

mkdir -p ~/.claude/brain/import/laptop2
tar xzf ~/.claude/brain/import/laptop2.tar.gz -C ~/.claude/brain/import/laptop2

Then:

python3 ${CLAUDE_PLUGIN_ROOT}/bin/backfill.py ~/.claude/brain/import/laptop2 --stats
python3 ${CLAUDE_PLUGIN_ROOT}/bin/backfill.py ~/.claude/brain/import/laptop2 --since 2026-01-01 --limit 50

Read the full file on GitHub · 85 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 85 lines · 13 tokens per session scan B 73b244ff6286

Subscribe to this mod's changes

brain-backfill is a command published in the GitHub repository fiale-plus/fiale-claude-plugins (4 stars, last pushed 4mo ago), licensed MIT. It adds 13 tokens to every session and 626 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.