kb

kb is a skill for Claude Code, Codex from mav-rik/kb-cli. It costs 49 tokens per session (1,093 once invoked), scanned A, original, MIT.

A persistent wiki for storing and finding knowledge across conversations. It uses linked Markdown pages so related information can be followed instead of relying on one search result.

In plain words
What is it for?
Use it to save facts, search past knowledge, update notes, and maintain an organized information base through a command-line tool or web API.
Why use it?
It prevents useful context from being lost between sessions and makes stored knowledge easier to retrieve and connect.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to save facts, search past knowledge, update notes, and maintain an organized information base through a command-line tool or web API.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mav-rik/kb-cli/claude
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 mav-rik/kb-cli --skill claude
Clone the repo
git clone --depth 1 https://github.com/mav-rik/kb-cli

Made for: Claude Code, Codex.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/mav-rik/kb-cli/claude"><img src="https://agentmods.dev/badge/skills/mav-rik/kb-cli/claude.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,093 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.00049 $0.01093
Opus 5.5 $0.00020 $0.00437
Sonnet 5.5 $0.00010 $0.00219
Haiku 4.5 $0.00005 $0.00109

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

Security

Grade A, and why

kb 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 19d 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.

content/setup/claude-skill.md · 84 lines

What it actually says

kb

Persistent wiki for AI agents — a graph of interlinked markdown notes built up across prior conversations. Pages are connected because earlier sessions recognized them as related; those links are pre-computed reasoning to follow.

  • To answer a question: search returns seed pages, not answers. Read seeds, follow --links, run kb related, and crawl outward until you have enough context. One document is almost never enough.
  • To add knowledge: decompose into atomic linked pages, and add links FROM existing related pages back to anything new — a page with no incoming links is invisible to future agents.

Two interfaces: CLI and HTTP API.

CLI (run directly):

kb skill                # full instructions
kb skill ingest         # how to store knowledge
kb skill search         # how to retrieve knowledge
kb skill update         # how to modify knowledge
kb skill lint           # how to maintain wiki health

HTTP API (when kb serve is running on port 4141):

GET http://localhost:4141/api          # list all endpoints
GET http://localhost:4141/api/skill    # full instructions via API

Quick reference (run kb skill for the full command list with every flag):

# Search & retrieval
kb search "<query>" [--limit, -n N] [--mode, -m hybrid|fts|vec] [--format json] [--wiki, -w <name>]
    # Default: limit 10, mode hybrid. --mode fts = keyword only (fast, no model load).
kb related <id> [--limit, -n N] [--wiki, -w <name>]   # find similar docs

# Reading
kb read <filename> [--lines, -l 1-80] [--meta, -m] [--links] [--follow, -f ./other.md]

# Writing
kb add --title, -t "<title>" --category, -c <cat> [--tags "<t1,t2>"] \
       (--content "..." | --body "..." | --file <path> | --stdin) \
       [--dry-run] [--format json]
    # --dry-run: lint only, no write — preview retrievability issues first.
    # Real run also returns lint warnings in the response (always-on).
kb update <id> [--title, -t "..."] [--category, -c <c>] [--tags "..."] \
               (--content "<replacement>" | --append "<more>") \
               [--dry-run] [--format json]
kb delete <id>
kb rename <old> <new>                       # auto-updates links

# Browse / maintenance
kb list [--category, -c <c>] [--tag <t>] [--format json]
kb categories
kb toc
kb lint [--fix] [--format json]
    # Reports broken/orphan/missing/drift + retrievability (chunk-merge,
    # long-paragraph, doc-too-short, doc-too-long). See `kb skill lint`.
kb schema [update]
kb reindex

# Activity log
kb log [--limit, -n N]                       # default 20 entries
kb log add --op, -o <type> [--doc, -d <id>] [--details, -m "<text>"]
    # <type>: ingest | query | lint | note

# Wikis
kb wiki list | create <name> | use <name> | info <name> | delete <name> [--force, -f]

# Most commands accept --wiki, -w <name> to target a specific wiki.

Key rules:

  1. Always search before adding (avoid duplicates)
  2. Cross-link aggressively — links are how future agents traverse the graph; a page with no incoming links is unreachable
  3. After every mutation, check and fix related docs
  4. Discuss key takeaways with user before ingesting
  5. Resolve contradictions using recency → authority → specificity
  6. Log session summaries after ingest/lint with kb log add
  7. Write for chunked retrieval — docs are split by H2/H3 heading and each chunk is searched independently. Target ~200-1500 words per doc, ≥80 words per section, paragraphs under 1500 chars. Sections under ~160 chars or >50% link syntax auto-merge into the previous chunk. Three frontmatter opt-outs (use deliberately):
    • important_sections: [TL;DR, Status] — prevent merging of named sections
    • suppress_merge_warn: [See Also, Contacts] — let the merge happen but silence the lint warning for those sections
    • suppress_lint: [doc-too-short, doc-too-long, long-paragraph, chunk-merge] — silence doc-level soft warnings (justify the choice)
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. 19d ago First seen · 84 lines · 49 tokens per session scan A 82c58b4fda53

Subscribe to this mod's changes

kb is a skill published in the GitHub repository mav-rik/kb-cli (12 stars, last pushed 20d ago), licensed MIT. It adds 49 tokens to every session and 1,093 once invoked, about $0.0002 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-10-09.

Related

Other skills, from other repositories

knowledge-ingest

Ingest documents, articles, conversations, or supplied text into Knowledge with retained originals, sourced claims, entity updates, timelines, and cross-links; also learn durable lessons from a set of conversations, transcripts, or past sessions (/learn), including the Learn from conversations and Learn from Memory…

openclaw/openclaw · 79 tokens

forget

Remove a personal fact, preference, relationship detail, topic, or prior event from Muse's active memory and stop existing copies or automations from bringing it back. Use for explicit requests such as 'forget that', 'don't remember this about me', or 'remove that from your memory'. Do not use when 'forget it' merely…

asgeirtj/system_prompts_leaks · 74 tokens

mem0-oss-to-platform

Plan, then execute, a migration of a project from the mem0 open-source / self-hosted SDK (local Memory class) to the mem0 Platform / hosted SDK (MemoryClient). TRIGGER when: the developer wants to move, switch, or migrate mem0 off OSS/self-hosted to the hosted API, e.g. "migrate my mem0 setup to the platform", "switch…

mem0ai/mem0 · 217 tokens

Cortex

LifeOS memory, prior-session recall, and learning capture. USE WHEN capture this learning, document this learning, what did we learn recently, recent learnings, cortex, knowledge, knowledge base, search knowledge, what do we know about, archive, harvest, knowledge status, develop note, add to knowledge, add a people…

danielmiessler/LifeOS · 184 tokens

memory

Use when the user asks to remember, recall, forget, update, search, or inspect durable OpenSquilla memory, including profile facts in USER.md and long-term notes in MEMORY.md or memory//.md.

opensquilla/opensquilla · 44 tokens

ha-data-stores

Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger…

shiwenwen/hope-agent · 115 tokens