kb: Instructions file for Claude Code

CLAUDE.md

kb CLAUDE.md is an instructions file for Claude Code from compozy/kb. It costs 3,988 tokens per session, scanned A, original, MIT.

A project instruction document for compozy/kb, a Go command-line program that builds and maintains topic-based knowledge bases. It defines the project overview, source-of-truth files, rules, commands, and package layout.

In plain words
What is it for?
Use it when working on the kb codebase, especially for locating specifications, following dependency rules, and running formatting, linting, tests, builds, and boundary checks.
Why use it?
It gives coding agents a shared description of the project and its required verification process before changing code.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

This is compozy/kb's own configuration. It tells Claude Code how to work on kb itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything kb configures →

View source ↗ compozy/kb
Reuse

Borrowing it

Nothing to install: this file belongs to compozy/kb. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/compozy/kb/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/compozy/kb

Made for: Claude Code.

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 kb CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/compozy/kb/claude-md/github.svg)](https://agentmods.dev/instructions/compozy/kb/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/compozy/kb/claude-md"><img src="https://agentmods.dev/badge/instructions/compozy/kb/claude-md/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 kb CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/compozy/kb/claude-md"><img src="https://agentmods.dev/badge/instructions/compozy/kb/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,988 This file is loaded in full into every session.
When invoked 3,988 The same file — it is already loaded in full.
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.03988 $0.03988
Opus 5.5 $0.01595 $0.01595
Sonnet 5.5 $0.00798 $0.00798
Haiku 4.5 $0.00399 $0.00399

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

Security

Grade A, and why

kb CLAUDE.md 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.

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.md · 154 lines

How it starts

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

CLAUDE.md

Project Overview

kb is a single-binary Go CLI for building and maintaining topic-based knowledge bases in the Karpathy KB pattern. It handles the non-LLM workflow: topic scaffolding, multi-source ingestion, structural linting, codebase analysis, QMD indexing/search, and KB-oriented inspection commands. Semantic judgments (ingest gates, classification, linking, retrieval) go through a required decision model (Jev over OpenRouter); a generation model writes only short literals, never article prose.

Reference TypeScript source: ~/dev/projects/kodebase

Source of Truth

  • KB pivot tech spec: .compozy/tasks/kb-pivot/_techspec.md
  • KB pivot task tracker: .compozy/tasks/kb-pivot/_tasks.md
  • KB pivot workflow memory: .compozy/tasks/kb-pivot/memory/
  • Decision model spec (kb-jev, revision 3): .wayfinder/kb-jev/spec.md; cross-package contracts: .claude/plans/kb-jev.md; domain vocabulary: CONTEXT.md

Critical Rules

  • make verify is the non-negotiable completion gate: fmt -> lint -> test -> build -> boundaries.
  • make lint must report zero findings.
  • Use go get for dependency changes.
  • Never use destructive git restore/reset/checkout/clean/rm commands without explicit approval.
  • Prefer local repository inspection over web search for codebase questions.
  • kb-written frontmatter keys carry no namespace prefix: they are plain (summary, concepts, triage, genre, ...) and ownership comes from decisions.OwnedKeys plus value hashes.

Active Build Surface

make verify
make fmt
make lint
make test
make test-integration
make build
make deps
make help
  • make build compiles ./... and writes bin/kb from cmd/kb.

Active Package Layout

Path Responsibility
cmd/kb Program entrypoint for the kb binary
internal/cli Cobra root, subcommands, flag resolution, and command I/O
internal/topic Topic scaffolding, listing, and topic metadata lookup
internal/ingest Ingest orchestration, frontmatter assembly, raw writes, and log entries
internal/convert Converter registry and format-specific file converters
internal/firecrawl Firecrawl REST client for kb ingest url, including the fresh-refetch options (maxAge, waitFor, onlyMainContent)
internal/mediadl Shared yt-dlp + STT engine: audio/caption download, ffmpeg segmentation, and transcript extraction reused by youtube and instagram
internal/youtube YouTube URL parsing, channel/bulk ingestion, and frontmatter over the mediadl core
internal/instagram Instagram reel/video URL parsing and caption+transcript composition over the mediadl core
internal/frontmatter Shared frontmatter parsing and generation helpers
internal/lint KB lint engine (structural and decision-workflow kinds; never calls a model) and report rendering
internal/generate Codebase-to-KB pipeline used by kb ingest codebase and the hidden legacy generate alias
internal/scanner Source discovery and ignore handling for codebase ingest
internal/adapter Tree-sitter parsing adapters
internal/graph Graph normalization for codebase snapshots
internal/metrics File, symbol, directory, and smell metrics
internal/vault Topic path helpers, render/write logic, vault reads, and inspect snapshot loading
internal/qmd QMD subprocess integration for index and search
internal/output Table, JSON, and TSV formatting
internal/models Shared domain models and interfaces
internal/config TOML config plus env-backed runtime overrides
internal/logger Slog logger setup
internal/version Build metadata surfaced by kb version
internal/decisions Decision engine: Engine.Decide, transport to the OpenRouter decisions endpoint, receipt validation, receipts cache, banding, budget, concurrency, redaction, run summary, and the OwnedKeys list
internal/generation Generation-model client for short literals over OpenRouter chat completions (strict JSON schema, reasoning disabled, fallback model), sharing the run budget and receipts
internal/questions Embedded, versioned question banks, loader (guard prefix, schema check, bank hash), composite banks, topic extra banks, and regression cases
internal/resolve Obsidian-style link resolution and link extraction shared by lint, refs, and link; quarantine path helpers
internal/corpus Topic document loader, body and value hashes, BM25, alias dictionary and mention scan, section-aware excerpts, provenance state, .decisions/state.jsonl, and the byte-preserving owned-key writer
internal/contract Selection contract parse/validate/hash/render, CLAUDE.md section import and render, topic.yaml settings (contract, drafts, decisions block), path globs
internal/contract/topicyaml Node-level topic.yaml editor that keeps untouched keys, comments, and key order
internal/session Per-run bundle for decision-backed commands: config, topic, settings, contract, engine, generation client, lazy corpus, state store, writer, review store, decision modes; fails fast without OPENROUTER_API_KEY
internal/scope kb topic contract workflow: draft, CLAUDE.md import, self-check, impact preview, activation
internal/classify Classification facets, generated literals (summary, entities, questions, criterion, aliases), the shared gate judgment, recapture/remove queues, concept proposals, vocabulary draft/accept
internal/quality Code quality checks run before any quality question (not_an_article, thin, error_page)
internal/gate Ingest gates: exact dedupe, pre-fetch relevance, code quality, refetch, post-fetch quality and relevance, near-duplicate, quarantine
internal/link Link candidates, per-document judgment, write policy (frontmatter relations, body links), reverse pass
internal/find Retrieval judge (candidates, judgment, ranking with named exclusions) and facet counts
internal/review Review queue store, labels, import-labels, import-links, calibration with holdout, impact-preview ledger
internal/refs Inbound-reference scan, quarantine and restore, quarantine-ledger.jsonl
internal/actions kb review accept|reject dispatcher over refs, link, gate, and classify
internal/okf OKF bundle promote, conformance check, and decision-model type suggestion
internal/fakes httptest fakes for the OpenRouter decisions and generation endpoints and Firecrawl, used by tests

Read the full file on GitHub · 154 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. 3d ago Changed cf4ede6cecba
  2. 26d ago Changed · +43 lines · +2,089 tokens per session ff28f19f00b4
  3. 1mo ago First seen · 111 lines · 1,899 tokens per session scan A 26492af08a28

Subscribe to this mod's changes

kb CLAUDE.md is an instructions file published in the GitHub repository compozy/kb (112 stars, last pushed 3d ago), licensed MIT. It adds 3,988 tokens to every session, about $0.0160 per session on Opus 5.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.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,649 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,384 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens