history-backfill

history-backfill is a cursor rule for Cursor from robotaitai/project-bedrock. It costs 17 tokens per session (632 once invoked), scanned A, original, MIT.

A rule for rebuilding project memory from an existing project’s history. The process uses documentation, configuration, tests, workflows, and Git history as evidence.

In plain words
What is it for?
Use it when onboarding a project with substantial history, existing documentation, task files, or work done by other developers or agents.
Why use it?
It helps an AI agent understand an established codebase before maintaining its long-term memory, instead of starting with incomplete assumptions.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: mentions CLAUDE.md; mentions AGENTS.md.

Good fit Use it when onboarding a project with substantial history, existing documentation, task files, or work done by other developers or agents.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/robotaitai/project-bedrock/history-backfill
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.

Clone the repo
git clone --depth 1 https://github.com/robotaitai/project-bedrock

Made for: Cursor.

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 history-backfill

README.md
[![agentmods](https://agentmods.dev/badge/rules/robotaitai/project-bedrock/history-backfill.svg)](https://agentmods.dev/rules/robotaitai/project-bedrock/history-backfill)
Your own site
<a href="https://agentmods.dev/rules/robotaitai/project-bedrock/history-backfill"><img src="https://agentmods.dev/badge/rules/robotaitai/project-bedrock/history-backfill.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 632 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.00017 $0.00632
Opus 5 $0.00009 $0.00316
Sonnet 5 $0.00003 $0.00126
Haiku 4.5 $0.00002 $0.00063

Measured 8d ago against content hash 465e7de2d9cf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

history-backfill 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 8d 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.

assets/rules/history-backfill.mdc · 68 lines

How it starts

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

History Backfill

After bootstrapping memory on a project with existing history, backfill the memory tree from evidence before proceeding with steady-state work.

Apply this rule once per project. It is not needed on every session.


When to apply

Apply after memory-bootstrap when the project:

  • Has a git history with more than ~10 commits
  • Has existing documentation (README, CLAUDE.md, AGENTS.md, .agent-project.yaml, agent-knowledge/)
  • Has existing task files (tasks/todo.md, tasks/lessons.md)
  • Was previously worked on by another agent or developer

Do NOT apply on every session — only when onboarding or when memory is newly empty.


Steps (summary — full detail in skill)

  1. Read the history-backfill skill.
  2. Run scripts/import-agent-history.sh . to collect raw evidence.
  3. Read evidence files in priority order (docs first, then manifests/configs/tests/workflows, then git and sessions).
  4. Distill stable facts into memory branch notes (Current State section).
  5. Record any architectural decisions found in decisions/.
  6. Update Memory/MEMORY.md branch summaries to reflect real content.
  7. Leave Open Questions for anything evidence hints at but doesn't resolve.

Evidence sources (priority order)

  1. agent-knowledge/Evidence/imports/existing-docs.txt — README, CLAUDE.md, AGENTS.md, .agent-project.yaml
  2. agent-knowledge/Evidence/raw/manifests.txt — authoritative for stack
  3. agent-knowledge/Evidence/raw/config-files.txt — strong signal for conventions
  4. agent-knowledge/Evidence/raw/tests.txt and raw/ci-workflows.txt — verification and deploy signal
  5. agent-knowledge/Evidence/raw/structure.txt — actual architecture shape
  6. agent-knowledge/Evidence/imports/tasks.txt and imports/session-files.txt — context and recurring work areas
  7. agent-knowledge/Evidence/raw/git-log-detail.txt and raw/git-log.txt — why and what changed over time
  8. agent-knowledge/Evidence/imports/trace-index.txt — supporting traces only, never canonical truth

Read the full file on GitHub · 68 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. 8d ago First seen · 68 lines · 17 tokens per session scan A 465e7de2d9cf

Subscribe to this mod's changes

history-backfill is a cursor rule published in the GitHub repository robotaitai/project-bedrock (45 stars, last pushed 18d ago), licensed MIT. It adds 17 tokens to every session and 632 once invoked, about $0.0001 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.