brain:rescan

brain:rescan is a skill for Claude Code, Codex from coco-research/coco. It costs 58 tokens per session (984 once invoked), scanned A, original, Apache-2.0.

An incremental project scanner that finds changed files since the last scan and updates an existing local knowledge database with information from notes and documents.

In plain words
What is it for?
Use it to rescan a project folder after files change and add newly discovered information.
Why use it?
It keeps project knowledge current without scanning and processing every file again.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths.

Good fit Use it to rescan a project folder after files change and add newly discovered information.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/coco-research/coco/brain-rescan
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.

Any agent
npx skills add coco-research/coco --skill brain-rescan
Clone the repo
git clone --depth 1 https://github.com/coco-research/coco

Made for: Claude Code, Codex.

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:rescan

README.md
[![agentmods](https://agentmods.dev/badge/skills/coco-research/coco/brain-rescan/github.svg)](https://agentmods.dev/skills/coco-research/coco/brain-rescan)
Your own site
<a href="https://agentmods.dev/skills/coco-research/coco/brain-rescan"><img src="https://agentmods.dev/badge/skills/coco-research/coco/brain-rescan/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for brain:rescan

Your own site · 80×15
<a href="https://agentmods.dev/skills/coco-research/coco/brain-rescan"><img src="https://agentmods.dev/badge/skills/coco-research/coco/brain-rescan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 984 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00058 $0.00984
Opus 5.5 $0.00023 $0.00394
Sonnet 5.5 $0.00012 $0.00197
Haiku 4.5 $0.00006 $0.00098

Measured 2mo ago against content hash 00f1df4be097, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

brain:rescan scanned grade A with 0 findings 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 2mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

systems/brain/skills/brain-rescan/SKILL.md · 130 lines

How it starts

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

/brain:rescan --- Incremental Knowledge Rescan

Detects what changed since the last scan and updates the brain DB with new knowledge.

Prerequisites

  • project_brain.db must exist in the project folder (or parent). If not found, tell the user: "No brain DB found. Run /brain-init first."
  • At least one project must exist in the DB.

Procedure

Step 1: Run the scanner

python3 ~/.claude/skills/brain/scripts/brain/brain_cli.py scan

Check the output:

  • If is_first_scan: true → this folder was never scanned. Tell the user and proceed with full scan.
  • If new_files: 0 and changed_files: 0 → "Everything up to date. No changes since last scan ({last_scan})." → done.
  • Otherwise, show the delta:
RESCAN DELTA
============
Last scan:      {last_scan}
New files:      N
Changed files:  N
Removed files:  N
Unchanged:      N

New/changed files:
  + docs/NewDoc.html          (new)
  ~ CLAUDE.local.md           (changed)
  + emails/Latest_Thread.txt  (new)

Knowledge sources:
  CLAUDE.local.md:  found / not found (changed: yes/no)
  Memory files:     N files (N new/changed)
  Documents:        N new, N changed
  Emails:           N new, N changed

Step 2: Process only new/changed files

Follow the same extraction logic as /brain-init Step 4, but only for files in the delta:

If CLAUDE.local.md is new or changed:
  • Re-read and extract entities, decisions, events
  • Use upsert_entity so existing entities get updated rather than duplicated
  • For decisions: check existing decisions in DB, only add genuinely new ones (compare decision text)
If memory files are new or changed:
  • Read only the new/changed memory files
  • Extract project decisions, system references
For new/changed documents and emails:
  • Register as document entities via upsert_entity
  • Metadata includes path, type, size
For removed files:
  • Do NOT auto-delete entities. Just report: "N files removed since last scan. Their brain entities are preserved — delete manually if needed."

Read the full file on GitHub · 130 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. 2mo ago Changed · -4 tokens per session 00f1df4be097
  2. 2mo ago First seen · 130 lines · 62 tokens per session scan A 420165df46c3

Subscribe to this mod's changes

brain:rescan is a skill published in the GitHub repository coco-research/coco (323 stars, last pushed yesterday), licensed Apache-2.0. It adds 58 tokens to every session and 984 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

brain:rescan compared with skills from other repositories

brain:rescan next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
brain:rescancoco-research/cocoSkill323yesterdayApache-2.0A58Claude Code, Codex
session-handoffwanshuiyin/HERO-Anti-OverDefenseSkill92912d agoMITA34Claude Code, Codex
handoffChemaclass/agnostic-aiSkill31todayMITA14Claude Code, Codex
handoffdeepklarity/harness-kitSkill10820d agoMITA50Claude Code
memory-curatorChemaclass/agnostic-aiSkill31todayMITA20Claude Code, Codex
project-memoryqingye-lab/rootloomSkill10yesterdayMITA47Codex
shared-memoryChemaclass/agnostic-aiSkill31todayMITA16Claude Code, Codex