backfill

backfill is a skill for Claude Code from scaccogatto/okf-skills. It costs 80 tokens per session (3,815 once invoked), scanned A, original, MIT.

A tool for rebuilding an OKF knowledge bundle from a repository’s past Git commits and Claude session records. It reconstructs decisions and project knowledge that were recorded before the OKF process was enabled.

In plain words
What is it for?
It is used to backfill an existing repository’s knowledge bundle or resume an interrupted reconstruction.
Why use it?
It helps recover project context that would otherwise be scattered across version history and conversation transcripts.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions subagents; positional $N argument.

Part of the okf plugin — 4 skills, 2 agents, 1 hook, 1 MCP server shipped together

Good fit It is used to backfill an existing repository’s knowledge bundle or resume an interrupted reconstruction.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/scaccogatto/okf-skills/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.

Any agent
npx skills add scaccogatto/okf-skills --skill backfill
Clone the repo
git clone --depth 1 https://github.com/scaccogatto/okf-skills

Made for: Claude Code.

Or install okf, the plugin that ships this one along with the rest of its 4 skills, 2 agents, 1 hook, 1 MCP server.

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 backfill

README.md
[![agentmods](https://agentmods.dev/badge/skills/scaccogatto/okf-skills/backfill/github.svg)](https://agentmods.dev/skills/scaccogatto/okf-skills/backfill)
Your own site
<a href="https://agentmods.dev/skills/scaccogatto/okf-skills/backfill"><img src="https://agentmods.dev/badge/skills/scaccogatto/okf-skills/backfill/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 backfill

Your own site · 80×15
<a href="https://agentmods.dev/skills/scaccogatto/okf-skills/backfill"><img src="https://agentmods.dev/badge/skills/scaccogatto/okf-skills/backfill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,815 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 170
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • medium Rogue Agent · line 11
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
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.00080 $0.03815
Opus 5 $0.00040 $0.01907
Sonnet 5 $0.00016 $0.00763
Haiku 4.5 $0.00008 $0.00381

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

Security

Grade A, and why

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 3d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/okf_backfill_events.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/backfill/SKILL.md · 310 lines

How it starts

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

Reconstruct an OKF bundle from history

This skill replays a repository's decision-making history (git commits and Claude session transcripts) to rebuild its OKF knowledge bundle as if the okf skill's Stop hook had been active from the start.

The extraction layer is deterministic (same repo → byte-identical events); the replay layer is an LLM loop, replayable and auditable but not byte-identical (timestamps, summaries change per run). See the event schema (§1) and skip rules (§3).

1. Event schema

Git commits and session turns become events (JSONL, one per line, sorted by timestamp then source):

{"id":"git:<sha>","source":"git","ts":"<ISO8601 Z>","sha":"...","author":"...","subject":"...","body":"...","files":[{"path":"...","add":N,"del":N}]}
{"id":"session:<file>:<lineno>","source":"session","ts":"<ISO8601 Z>","user":"...","outcome":"...","title":"...","branch":"...","skip":"..."}
  • Git events come from git log --first-parent --numstat.
  • Session events pair each user message with the last assistant text block of that turn (the wrap-up), extracted from ~/.claude/projects/<repo-slug>/*.jsonl and worktree subdirs.
  • Timestamps are normalized to UTC ISO 8601 strings ending in Z.
  • Skip field (optional, added by extraction): marks low-signal events — see §3, never overridden by replay.

2. Protocol: Preflight → Extract → Bootstrap → Replay (Map+Reduce) → Finalize

Preflight: check if bundle can be rebuilt

if [ -d <repo>/.okf ] && ! [ -f <repo>/.okf/.backfill-state.json ]; then
  echo "ERROR: .okf/ exists but is incomplete. Delete it to rebuild from scratch, or pass --resume to continue from the last checkpoint."
  exit 1
fi

If .backfill-state.json exists, resume from the cursor; otherwise, fresh bootstrap.

Extract: generate event stream

uv run "${CLAUDE_SKILL_DIR}/scripts/okf_backfill_events.py" <repo-dir> \
  --out events.jsonl \
  [--no-sessions] [--sessions-dir ~/.claude/projects] \
  [--max-text 2000] [--skip-globs "vendor/**"]

Read the full file on GitHub · 310 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 Changed · +71 lines c110b3e165e3
  2. 6d ago First seen · 239 lines · 80 tokens per session scan A 864522471185

Subscribe to this mod's changes

backfill is a skill published in the GitHub repository scaccogatto/okf-skills (380 stars, last pushed 4d ago), licensed MIT. It adds 80 tokens to every session and 3,815 once invoked, about $0.0004 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-09-03.

Related

Other skills, from other repositories

hub-cc-pr-reviewer

Checks a submitted PR against the environment's baseline assets (CLAUDE.md, memory, naming, asset classification) and attaches a review comment with a merge recommendation. 5 steps — diff read, 8-area consistency check, self-catch, comment, merge recommendation.

chrono-meta/forge-harness · 62 tokens

audit-learnings

Automatically generates a weekly audit draft by finding recurring patterns in accumulated session records. Proposes promotion and deprecation candidates and guides through commit and PR creation. Use --dry-run flag to run only through scan and draft generation (no promotion/commit/PR gates; compatible with bg…

chrono-meta/forge-harness · 61 tokens

pr-review-watcher

Monitors for incoming PR reviews and summarizes their content. Determines approval/change-request/comment verdicts and extracts action items. Triggers on "did the PR review come in?", "when will the review arrive", "PR waiting" utterances.

chrono-meta/forge-harness · 53 tokens

planning-with-scratchpad

Use when user explicitly requests planning with a scratchpad, or asks for persistent tracking of a complex task that the human can browse visually. Backs planning files with the scratch CLI so a pad's files are registered and viewable.

NikiforovAll/scratchpad · 54 tokens

scratch

Organize knowledge from an agent session into a scratchpad — a folder of files plus a scratchpad.json manifest. Use when a task generates notes, snippets, command output, diagrams, or artifacts worth keeping together for a session/activity.

NikiforovAll/scratchpad · 49 tokens

pr-sweep

Use when you want to sweep all open pull requests across all repos, triage their status, run code reviews on unreviewed PRs, merge what's ready, fix quick blockers, and produce a full status report. Trigger when the user says "check my PRs", "close out open PRs", "what's the status of my PRs", "sweep my PRs", "PR…

harnessprotocol/harness-kit · 0 tokens