kb CLAUDE.md

kb CLAUDE.md is an instructions file for coding agents from okash1n/kb. It costs 2,169 tokens per session, scanned A, original, MIT.

A set of Claude Code instructions for a Japanese knowledge-base repository. The repository shares project context, decisions, notes, and learning between several AI tools through a local MCP server.

In plain words
What is it for?
For maintaining shared development notes across Claude, Copilot, and Codex. It covers the repository architecture, data locations, note rules, and project selection.
Why use it?
It records past decisions, mistakes, requirements, and project knowledge so later AI sessions can use the same context. It also explains how the notes are organised in an Obsidian vault.

Instructions file

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 instructions/okash1n/kb/claude-md
Clone the repo
git clone --depth 1 https://github.com/okash1n/kb

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/okash1n/kb/claude-md.svg)](https://agentmods.dev/instructions/okash1n/kb/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/okash1n/kb/claude-md"><img src="https://agentmods.dev/badge/instructions/okash1n/kb/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,169 This file is loaded in full into every session.
When invoked 2,169 The same file — it is already loaded in full.
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.02169 $0.02169
Opus 5 $0.01085 $0.01085
Sonnet 5 $0.00434 $0.00434
Haiku 4.5 $0.00217 $0.00217

Measured 4d ago against content hash a3842d61a343, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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 · 141 lines

How it starts

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

kb リポジトリ

複数プロジェクト × 複数AIの共通コンテキスト基盤。ローカルMCPサーバーとして動作する。

kb は単なるノート置き場ではなく、AI がセッションをまたいで成長するための共有学習基盤を目指している。 Claude、Copilot、Codex のような複数の AI が、gapknowledgeadr を通じて「ユーザーが AI に求めること」と「そのプロジェクトで積み上がった判断や知見」を学び、次のやり取りで自然に活かせる状態を作る。

目標は 2 つある。

  • 単体 AI が、過去の失敗や判断を踏まえて継続的に賢くなること
  • AI チーム全体が、同じユーザー・同じプロジェクト文脈を共有しながら揃って成長していくこと

アーキテクチャ

  • kb_mcp は「Obsidian CLIのラッパー + kb固有ロジック」
  • Obsidian CLI 1.12+ 起動済みを前提とする
  • Obsidian CLI に委譲: ファイルI/O、frontmatter操作、検索、リンク構造取得
  • kb_mcp 固有: ULID生成、slug生成、ファイル命名規則、ADR status管理、organize提案、graduate分析

データ配置

ノートはこのリポジトリには含まれない。kb-mcp setup で設定した Obsidian Vault に保存される。

設定: ~/.config/kb/config.yml

  • vault_path: Obsidian Vault のルートパス
  • kb_root: Vault 内の kb 専用スコープ(空 = Vault 直下、kb = サブディレクトリ)

実効パス = vault_path / kb_root の下に以下の構造が作られる:

  • projects/<project-name>/ — プロジェクトごとのコンテキスト
    • adr/ — 意思決定ログ
    • gap/ — AI指摘 → 本当はどうしてほしかったか
    • session-log/ — セッションログ
    • knowledge/ — 開発中に得た知識
    • draft/ — やりたいこと・アイデアメモ
  • inbox/ — プロジェクトに紐づかないアイデア・雑多なメモ
  • general/ — プロジェクト横断の共通知見(kb_graduateで昇格)
    • knowledge/ — 共通知識
    • requirements/ — ユーザーがAIに求めることの集約

ノートのルール

  • frontmatter必須: id(ULID), summary, ai_tool, created, updated
  • frontmatter任意: ai_client, repo, tags, related, status(ADR用)
  • ai_tool: AI ベンダー(claude | copilot | codex
  • ai_client: 具体的なクライアント(claude-code | copilot-cli | codex-cli 等、optional)
  • 配列フィールド(tags, related)はインライン形式 [a, b] で表現する
  • ファイル命名: {slug}--{ULID}.md(session-logのみ {yyyymmdd-hhmm}--{ULID}.md
  • ノート間の関連付けは ULID(id)を正とする(related はULID配列)

Project resolver

  • 保存系 tool は project を自動解決する(cwd の git remote → .kb-project.yml でマッチング)
  • 明示的に project を指定することもできる
  • 各プロジェクトの .kb-project.yml に紐付くリポジトリを記録する

MCP Tools

tool 役割
kb_init プロジェクト初期化
kb_adr 意思決定ログ保存
kb_gap 反省記録保存
kb_knowledge 知識保存
kb_session セッションログ保存
kb_draft アイデア・やりたいことメモ(project指定→draft/、なし→inbox/)
kb_search 検索
kb_read ノート読み込み
kb_lint ルール整合性チェック
kb_organize リンク候補の発見・提案
kb_graduate general/への昇格提案

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

Subscribe to this mod's changes

kb CLAUDE.md is an instructions file published in the GitHub repository okash1n/kb (0 stars, last pushed 5mo ago), licensed MIT. It adds 2,169 tokens to every session, about $0.0108 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.