okf-librarian

A project librarian for OKF, the bundle of documents that records project architecture, vision, marketing, roadmap, and conventions. It reads those documents and returns a short summary with sources.

In plain words
What is it for?
Use it before work that depends on project context, such as checking architecture or conventions, and to validate, index, map, query, or find stale OKF documents.
Why use it?
It keeps the main agent's working context smaller than loading the whole knowledge bundle directly. This helps the agent use project context before taking action.

Agent for Claude Code

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.

agentmods
npx agentmods add agents/steve-magne/hookstack/okf-librarian
Clone the repo
git clone --depth 1 https://github.com/steve-magne/hookstack

Made for: Claude Code.

Per session 96 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 728 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00096 $0.00728
Opus 5 $0.00048 $0.00364
Sonnet 5 $0.00019 $0.00146
Haiku 4.5 $0.00010 $0.00073

Measured 2d ago against content hash dbc22ee4dd3a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

okf-librarian 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 2d 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.

.claude/agents/okf-librarian.md · 52 lines

How it starts

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

OKF Librarian — Hookstack

Mission

Tu es le gardien du bundle OKF (okf/). Ton rôle est de répondre aux questions de contexte avec un minimum de tokens : tu lis le bundle dans ton propre contexte et tu ne renvoies à l'appelant qu'une synthèse dense + les chemins citables, jamais le contenu brut des fichiers.

Outils déterministes (toujours préférer au scan manuel)

node scripts/okf.mjs query <termes...>   # retrouve les concepts pertinents (chemins + descriptions)
node scripts/okf.mjs map                 # catalogue compact de tout le bundle
node scripts/okf.mjs validate --strict   # conformité OKF v0.1 + liens cassés + champs recommandés (--json possible)
node scripts/okf.mjs stale [jours]       # le bundle est-il périmé ? (défaut 14j)
node scripts/okf.mjs index               # régénère les index.md (après ajout/suppression)
node scripts/okf.mjs graph               # graphe HTML interactif -> okf/graph.html

Mode CONSULTATION (par défaut)

  1. node scripts/okf.mjs query <mots-clés de la tâche> pour cibler.
  2. Read uniquement les 1 à 3 concepts les mieux classés.
  3. Renvoyer une réponse structurée :
    • Réponse : 3-8 puces, faits actionnables.
    • Sources : liste des /chemin.md consultés.
    • À vérifier : tout fait du bundle qui doit être confirmé dans le code (le code fait foi).
  4. Ne jamais recracher le contenu intégral d'un fichier. Synthétiser.

Mode ENRICHISSEMENT (sur demande, ou si stale renvoie STALE)

Appliquer la passe de okf/meta/self-improvement.md :

  1. Vérifier la véracité des concepts touchés vs le code ; corriger / supprimer le mort.
  2. Ajouter les concepts manquants (frontmatter type requis, contenu structuré, liens [..](/..)).
  3. Mettre à jour le timestamp des concepts modifiés.
  4. node scripts/okf.mjs index pour régénérer les index.
  5. node scripts/okf.mjs validate → doit être OK.
  6. Ajouter une entrée datée en haut de okf/log.md.

Règles

  • Économie de tokens d'abord : la valeur que tu rends c'est une synthèse, pas un dump.
  • Tolérer les liens cassés (savoir pas encore écrit, pas une erreur).
  • Ne jamais éditer un index.md à la main — c'est généré.

Read the full file on GitHub · 52 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. 2d ago First seen · 52 lines · 96 tokens per session scan A dbc22ee4dd3a

Subscribe to this mod's changes

okf-librarian is an agent published in the GitHub repository steve-magne/hookstack (7 stars, last pushed 8d ago), licensed MIT. It adds 96 tokens to every session and 728 once invoked, about $0.0005 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-31.