Skip to content
OKF Claude OKF repo kit

How it works · installed behavior, not aspiration

How Claude Code works with your repo.

What actually happens when you open a kit-installed repo and talk to Claude Code — Anthropic’s agentic coding tool — with the kit shaping its agent loop through project memory, skills, and hooks. It is all written into the kit’s CLAUDE.md, loaded at the start of every session.

Session start

Context without re-reading the repo.

Claude Code never holds your whole repo in its context window, and it doesn’t need to.

The installed CLAUDE.md imports three small files at load time — docs/GOAL.md and the spec and ADR indexes — so every session begins already knowing the goal, which milestones are done, and what knowledge exists.

Full specs, ADRs, and code stay on disk until a task needs them; the indexes and the source-to-doc map tell Claude exactly which file to read for the task at hand. The conversation is a scratchpad; the docs bundle is the memory.

The first session

A goal interview, not a blank form.

If the goal file still contains template placeholders, Claude Code doesn’t start working — it interviews you first, a few questions at a time, and drafts the goal from your answers for your confirmation.

  1. What are you building, and for whom?
  2. What exists when it’s done — concretely?
  3. What will users actually give it — realistic example inputs, including a messy or wrong one?
  4. How is that verified mechanically? What’s the test command?
  5. What should this repo deliberately not do?
  6. Which stack and dependency choices are fixed, and which may Claude decide later through proposed ADRs?
  7. What’s the first shippable slice, and how do we check it?

It pushes back on answers it can’t verify — “migrate the API to GraphQL” is a direction, not a done state — and in an existing codebase it proposes answers from the code first and lets you correct them.

Saying “continue”

The agent loop.

Once the goal exists, you don’t have to write tasks. Ask Claude Code to continue and its agent loop runs over the backlog — Claude directing its own tools and reading the test results as ground truth for whether a milestone is done.

  1. Take the first unchecked milestone from docs/GOAL.md.
  2. Impact analysis — name the specs and ADRs that govern the files about to change, and read them.
  3. Implement the smallest change that satisfies the milestone.
  4. Run the test command and make it pass.
  5. Knowledge alignment — update the governing spec or ADR if behavior changed, and add a dated docs/log.md entry. The stale-map check catches anything missed.
  6. Check the milestone off only when its stated verification passes, then take the next one.

The loop stops on its own in exactly three cases: the backlog is empty, a decision reserved for you comes up, or you say stop. An empty backlog isn’t a dead end — Claude first runs an acceptance pass, exercising the deliverable the way a first-time user would, then reports the goal met with any still-proposed ADRs listed, and proposes candidate next milestones for you to choose from.

Division of labor

Scripts for what must never vary. Hooks for what must never be skipped.

Claude Code doesn’t recalculate the bookkeeping each session — the kit puts each kind of work where it is cheapest and most reliable, and reserves judgment for the parts that need thinking.

Hooks

Never skipped

The session-start inbox and the stop-time docs gate run as fixed code paths in the harness. Claude doesn’t choose to run them, and can’t forget them at the end of a long session.

Helper

Never varies

The playbook binds Claude to bash scripts/okf for the mechanics — the next ADR number, index entries, staleness from the source map. Computed in code: zero model tokens, identical every session, no improvised numbering on a bad day.

Preloads

Always known

CLAUDE.md imports the goal and the spec and ADR indexes at load time, so every fresh context window starts with the map and reads individual documents from disk only on demand.

Judgment

For the content

What a spec commits to, what an ADR argues, what code satisfies a milestone — the work that needs thinking stays with Claude, and stays reviewable.

Misfires are harvested, not hidden. When a helper meets a shape it doesn’t recognize — an index kept as a table, a naming convention it hasn’t seen — it declines visibly rather than guessing, and Claude works around it in the open. That friction is carried back into the kit as a proposed change. A silent workaround would hide the defect and re-pay its cost in every session; harvesting it pays once, in the kit.

Decisions

You own the goal; Claude drives the decisions that reach it — on the record.

The division of labor is explicit, and every decision-shaped change leaves a reviewable trail.

Claude decides

Inside the guardrails

Implementation choices inside existing specs, accepted ADRs, and the guardrails are Claude’s to make without asking.

Proposed ADR

Decision-shaped changes

A new dependency, persistence model, auth approach, API contract, or deployment shape starts with an ADR Claude writes itself — marked status: proposed with context, decision, alternatives, consequences, and a rollback trigger — implemented against and flagged for you.

You review

Asynchronously

Scan the ADR folder (docs/adr/ by default) for proposed entries (or run bash scripts/okf pending) and accept, request changes, or revert — frontmatter status and body-style - Status: conventions both count. Accepting flips the status to accepted and binds every future session; a session-start note counts what still awaits you.

You alone

Reserved decisions

Changing the goal, superseding an accepted ADR, and every action the guardrails gate.

Guardrails

Standing in every session.

The same rules hold across every session, whoever is driving.

Tests

Gate milestones

Tests run after every change; a milestone with failing tests is not done.

Integrity

Tests aren’t weakened

Failing tests are never deleted, skipped, or weakened to force a green run.

Secrets

Stay untracked

Env and credential files are confirmed git-ignored before they’re created, and the shipped settings deny reading local .env files outright.

Security

Gets a check

Auth, input parsing, crypto, network exposure, and permission changes get an ADR check.

Destructive

Actions wait

Force pushes, data deletion, publishing, deploying, and side-effecting external calls wait for your explicit go-ahead, every time.

Reporting

Honest by default

Failures, partial progress, and skipped steps stay visible; outcomes are reported as they are.

Know the limit. These guardrails are instructions, not mechanical enforcement. The kit’s mechanical gates are docs sync (hooks) and a settings rule denying reads of local .env files — nothing else. When a rule must be guaranteed rather than followed — tests green before merge, no secrets in commits — put it in your repo’s own CI and branch protection, on top of this kit.

Interruptions

Minutes, not state.

Sessions end: context windows fill, limits hit, laptops close. The loop is built for it.

Milestone checkboxes, the dated log, ADRs, and git commits are the durable record — a fresh session reads them, with the goal preloaded, and knows exactly where the loop stands.

If a session was cut off mid-milestone, the next one treats uncommitted changes as in-flight work: it reconciles them against the first unchecked milestone and the newest log entry, then finishes or backs them out before taking anything new.

In practice

Anatomy of a conversation.

The pattern an installed repo produces, request by request.

Capability

“Make sure this repo supports X.”

Claude reads the goal and the governing specs and ADRs first, reports the gap between what exists and what you asked for, then makes the smallest change that closes it — behavior changes landing with their spec updates, an ADR if decision-shaped, a log entry, and a full verification run.

Question

“How does this part work?”

You get an assessment grounded in the repo’s own files — honest trade-offs and a recommendation — not an unrequested edit. If it suggests an improvement, Claude offers it and waits; work starts when you say yes.

Continue

“Yes” or “continue.”

Claude runs the loop: impact analysis, smallest change, tests, docs sync, verification, honest report. Decisions it had to make are waiting as proposed ADRs, and the log tells the story in dated entries you can read months later.

Backlog empty

The work runs out.

Claude runs the first-time-user acceptance pass, reports the goal met, and stops building. Instead of inventing scope, it lays out your options — log items, ADR revisit triggers, acceptance findings, missing repo hygiene, and non-goal-fitting extensions — and drafts only what you pick.

A week later

You come back.

Nothing is re-explained. The goal, milestone state, and knowledge indexes load automatically; the log and ADRs carry every decision since; “continue” means the same thing it meant last time.

Install

One installer, the safe path.

The kit is a reviewable source repo. Clone it, point the installer at your target repo, and it chooses the safe path — a fresh setup for new or empty repos, a non-destructive update (backups, merged settings, numbered candidates) for existing ones.

git clone https://github.com/lilabrooks/claude-okf-repo-kit.git
cd claude-okf-repo-kit
bash scripts/install-kit /path/to/target-repo
bash scripts/verify-install /path/to/target-repo

Then open the target repo in Claude Code — it runs the goal interview with you before the first task. Full instructions, the manual paths, and verification details are in the README.

Keep reading

See the model, or the evidence behind it.

The home page explains why the kit exists and what it installs; the dogfood record shows what real repositories taught it.