consolidate-memory

consolidate-memory is a command for Claude Code from felvieira/claude-skills-fv. It costs 35 tokens per session (2,171 once invoked), scanned A, original, Apache-2.0.

A maintenance command for a memory vault, meaning a collection of files that stores persistent project or assistant information.

In plain words
What is it for?
Use it for routine cleanup, after heavy use, before a major release, or when the vault has grown substantially.
Why use it?
It helps find duplicate entries, outdated facts, and unnecessary index entries before the vault becomes difficult to maintain.

Command for Claude Code

Written for Claude Code: SessionStart hook event. Also seen: names the AskUserQuestion tool.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node scripts/l3-persona-generator.mjs --project "<slug-do-projeto>".

Part of the dev-team-kit-fv plugin — 72 skills, 45 commands, 16 agents, 5 hooks shipped together

Good fit Use it for routine cleanup, after heavy use, before a major release, or when the vault has grown substantially.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/felvieira/claude-skills-fv
agentmods
npx agentmods add commands/felvieira/claude-skills-fv/consolidate-memory

Made for: Claude Code.

Or install dev-team-kit-fv, the plugin that ships this one along with the rest of its 72 skills, 45 commands, 16 agents, 5 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 consolidate-memory

README.md
[![agentmods](https://agentmods.dev/badge/commands/felvieira/claude-skills-fv/consolidate-memory/github.svg)](https://agentmods.dev/commands/felvieira/claude-skills-fv/consolidate-memory)
Your own site
<a href="https://agentmods.dev/commands/felvieira/claude-skills-fv/consolidate-memory"><img src="https://agentmods.dev/badge/commands/felvieira/claude-skills-fv/consolidate-memory/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 consolidate-memory

Your own site · 80×15
<a href="https://agentmods.dev/commands/felvieira/claude-skills-fv/consolidate-memory"><img src="https://agentmods.dev/badge/commands/felvieira/claude-skills-fv/consolidate-memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,171 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.00035 $0.02171
Opus 5 $0.00017 $0.01086
Sonnet 5 $0.00007 $0.00434
Haiku 4.5 $0.00003 $0.00217

Measured 12d ago against content hash 11b1ff8b328b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

consolidate-memory 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 12d 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.

commands/consolidate-memory.md · 224 lines

How it starts

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

/consolidate-memory — Manutenção do Vault de Memória

Objetivo: rotina de manutenção do vault persistente seguindo policies/memory-consolidation.md. Workflow seguro: snapshot → dry-run → confirmação → apply → verify → report.

Quando usar:

  • semanalmente (rotina)
  • após uso intenso (50+ sessions)
  • antes de release major (limpar stale)
  • vault crescer demais (> 500 arquivos)

Quando NÃO usar:

  • vault recém-criado (< 20 arquivos)
  • sem backup possível (não é repo git, não tem espaço para .bak)

Skill ativada: Context Manager (skill 08) em modo "vault janitor".

Pré-requisitos

  • vault em D:\claude-memory\ ou path explícito via --vault <path>
  • backup viável (espaço em disco para snapshot OU vault é repo git)

Processo

Passo 1 — Snapshot

VAULT="${1:-D:/claude-memory}"
TIMESTAMP=$(date +%Y-%m-%d-%H%M)

# Se é repo git: commit
if [ -d "$VAULT/.git" ]; then
  cd "$VAULT" && git add -A && git commit -m "snapshot pre-consolidate $TIMESTAMP"
else
  # Copy snapshot
  cp -r "$VAULT" "$VAULT.bak.$TIMESTAMP"
fi

Passo 2 — Dry run (auditoria sem mudança)

Para cada categoria de policies/memory-consolidation.md, listar candidatos:

2.1 Logs de sessão duplicados
  • Buscar logs do mesmo dia/projeto: ls $VAULT/logs/YYYY-MM-DD-<projeto>-*.md
  • Comparar similaridade (filename ou conteúdo > 80% similar) → marcar para merge
  • Output: lista de pares [A.md, B.md] → keep A, delete B
2.2 Logs órfãos / antigos
  • Logs > 90 dias sem ser referenciado em outro lugar → archive candidate
  • Logs de projetos inexistentes → archive candidate
2.3 Architecture decisions
  • Decisões com mesmo título em projetos iguais → merge candidate
  • Decisões status: superseded sem newer ref → flag
2.4 Working set / context packs
  • Files referenciados que não existem mais → remove entry
  • Entries duplicadas (mesmo path) → merge metadata
2.5 Learned skills
  • Score < 0.3 e idade > 30d → archive candidate
  • Score ≥ 0.8 e 5+ usos → promote candidate
  • Triggers conflitantes → resolve candidate

Read the full file on GitHub · 224 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. 12d ago First seen · 224 lines · 35 tokens per session scan A 11b1ff8b328b

Subscribe to this mod's changes

consolidate-memory is a command published in the GitHub repository felvieira/claude-skills-fv (23 stars, last pushed today), licensed Apache-2.0. It adds 35 tokens to every session and 2,171 once invoked, about $0.0002 per session on Opus 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-08-30.