infinite-brain-os: Command for Claude Code

.claude/commands/build-knowledge-base.md

build-knowledge-base is a command for Claude Code from starmynd-org/infinite-brain-os. It costs 32 tokens per session (1,946 once invoked), scanned A, original, MIT.

A command for building or migrating a real knowledge namespace. A knowledge namespace is an organised topic area containing source material, summaries, reference information, and rules for using it.

In plain words
What is it for?
Use it to create a knowledge area, migrate a corpus of notes, or refactor semi-structured material into organised source, synthesis, support, and profile-specific content.
Why use it?
It provides a guided way to turn an existing folder or collection of notes into a consistent structure, without requiring rigid command options.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

This is starmynd-org/infinite-brain-os's own configuration. It tells Claude Code how to work on infinite-brain-os 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 infinite-brain-os configures →

Reuse

Borrowing it

Nothing to install: this file belongs to starmynd-org/infinite-brain-os. 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/starmynd-org/infinite-brain-os/main/.claude/commands/build-knowledge-base.md
Clone the repo
git clone --depth 1 https://github.com/starmynd-org/infinite-brain-os

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 build-knowledge-base

README.md
[![agentmods](https://agentmods.dev/badge/commands/starmynd-org/infinite-brain-os/build-knowledge-base/github.svg)](https://agentmods.dev/commands/starmynd-org/infinite-brain-os/build-knowledge-base)
Your own site
<a href="https://agentmods.dev/commands/starmynd-org/infinite-brain-os/build-knowledge-base"><img src="https://agentmods.dev/badge/commands/starmynd-org/infinite-brain-os/build-knowledge-base/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 build-knowledge-base

Your own site · 80×15
<a href="https://agentmods.dev/commands/starmynd-org/infinite-brain-os/build-knowledge-base"><img src="https://agentmods.dev/badge/commands/starmynd-org/infinite-brain-os/build-knowledge-base.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,946 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.00032 $0.01946
Opus 5 $0.00016 $0.00973
Sonnet 5 $0.00006 $0.00389
Haiku 4.5 $0.00003 $0.00195

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

Security

Grade A, and why

build-knowledge-base 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 9d 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/commands/build-knowledge-base.md · 169 lines

How it starts

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

/build-knowledge-base

Launch a real namespace build or migration in plain English.

This command is for cases where an operator wants to say something like:

Build a new namespace called personal-health from <legacy-root>\legacy-notes\Health, do not migrate the legacy database, and refactor the rest into Infinite Brain style.

The command does not require rigid mode= or exclude= flags. The operator describes the source, the target namespace, and any constraints in normal language. The command then routes that request through the V2 namespace machinery.

When to use this

  • Building a brand-new real knowledge namespace under knowledge/
  • Migrating an existing corpus, folder, or PKM subtree into Infinite Brain V2
  • Testing whether the current skills, agents, workflows, validator, and doctrine are good enough to convert a real source corpus
  • Refactoring semi-structured notes into canon, synthesis, support, and profile-aware structure

When NOT to use this

  • You only need a lightweight namespace registry stub. Use /create-namespace.
  • The inbound material is still raw intake and should go to root intake/ first.
  • The work is mostly runtime state, secrets, operational queue data, or databases that do not belong in a knowledge namespace.
  • The request is to add or revise one node inside an existing namespace rather than create or migrate the namespace itself.

Operator input style

The operator may describe the job in natural language. The command should extract, from the request, as much of the following as is available:

  • source location or source set
  • target namespace slug
  • target repo
  • what to exclude
  • what canon expectations matter
  • what the namespace should be used for
  • any known constraints, sensitivities, or live-truth risks

Do not force the operator into a fixed flag schema when plain-English instructions are sufficient.

What this command does

  1. Reads the operator request and determines whether this is:
    • a born-V2 namespace build, or
    • a migration of an existing knowledge corpus into a new namespace.
  2. Reads the V2 doctrine and operative contract:
    • AGENTS.md
    • CLAUDE.md
    • _system/README.md
    • _system/namespace-profiles.md
    • knowledge/ai-architecture/INDEX.md
    • knowledge/ai-architecture/canon/core-doctrine.md
    • knowledge/ai-architecture/canon/problem-to-architecture.md
  3. Chooses the namespace profile from first principles using [[skill-build-namespace]].
  4. Creates or updates the registry entry under _system/namespaces/.
  5. Scaffolds the namespace with the shared base and profile-additive folders.
  6. Routes the actual build through [[skill-build-knowledge-base]] and [[workflow-build-knowledge-base]], which in turn sequence the lower-level V2 machinery:
    • [[skill-build-namespace]] for new namespace scaffolding
    • [[skill-migrate-legacy-knowledge-to-v2]] or [[workflow-legacy-knowledge-migration]] for corpus refactoring
    • [[skill-canonize-namespace]] for compressed canon
    • [[skill-refine-namespace-index]] for the retrieval router
  7. Atomizes broad source material into digestible nodes before building higher-order summaries, so future agents can ingest the graph selectively rather than only reading a few large notes.
  8. Preserves provenance in support/, puts derived interpretation in synthesis/, and keeps canon compressed and agent-usable as the main-ideas layer future agents should ingest first.
  9. Reviews related namespaces for additive node, synthesis, canon, or router updates triggered by the new build.
  10. Runs bash _system/validate.sh plus [[workflow-namespace-lint-review]] before closing.
  11. Produces a short build or migration report describing:
  • chosen profile
  • sources used
  • major atomization decisions
  • canon surfaces created
  • synthesis surfaces created
  • cross-namespace changes made or deferred
  • support receipts created
  • validator/lint results
  • any open questions or human approval gates

Read the full file on GitHub · 169 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. 9d ago First seen · 169 lines · 32 tokens per session scan A 4bedcde3b613

Subscribe to this mod's changes

build-knowledge-base is a command published in the GitHub repository starmynd-org/infinite-brain-os (248 stars, last pushed 13d ago), licensed MIT. It adds 32 tokens to every session and 1,946 once invoked, about $0.0002 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.