kb-add

kb-add is a command for Claude Code from qqabcv520/my-claude-marketplaces. It costs 12 tokens per session (459 once invoked), scanned A, original, MIT.

A command for recording project knowledge as a categorized Markdown note.

In plain words
What is it for?
Use it to create a dated entry in the selected category, add its metadata and content, and update the knowledge-base index.
Why use it?
It prevents important decisions, solutions, issues, patterns, corrections, or background information from being lost between sessions.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths.

Part of the knowledge-base plugin — 1 skill, 3 commands, 1 agent shipped together

Good fit Use it to create a dated entry in the selected category, add its metadata and content, and update the knowledge-base index.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/qqabcv520/my-claude-marketplaces/kb-add
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.

Clone the repo
git clone --depth 1 https://github.com/qqabcv520/my-claude-marketplaces

Made for: Claude Code.

Or install knowledge-base, the plugin that ships this one along with the rest of its 1 skill, 3 commands, 1 agent.

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-add

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/qqabcv520/my-claude-marketplaces/kb-add"><img src="https://agentmods.dev/badge/commands/qqabcv520/my-claude-marketplaces/kb-add.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 459 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.00012 $0.00459
Opus 5 $0.00006 $0.00230
Sonnet 5 $0.00002 $0.00092
Haiku 4.5 $0.00001 $0.00046

Measured 12d ago against content hash 7a0047778680, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

kb-add 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 12d 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.

plugins/knowledge-base/commands/kb-add.md · 48 lines

What it actually says

Create a new knowledge base entry with proper formatting and categorization.

Instructions

  1. Read configuration from .claude/knowledge-base.local.md to get kb_path (default: ~/.claude/knowledge-base/)
  2. If the knowledge base directory doesn't exist, create it with all category subdirectories:
    • decisions/, solutions/, issues/, patterns/, corrections/, context/
  3. Parse the user's input:
    • If category is provided (e.g., /kb-add decisions JWT选型), use it directly
    • If only a title is given, ask the user to choose a category
    • If no arguments, ask what knowledge to record
  4. Create the entry file:
    • Filename: YYYY-MM-DD-kebab-case-title.md (today's date)
    • Location: {kb_path}/{category}/
    • Use the YAML + Markdown format from the knowledge-management skill
    • Fill in frontmatter: title, category, tags, created date
    • Write the Background, Content, and Key Takeaways sections based on conversation context
  5. After creating the entry, update _index.md:
    • If _index.md doesn't exist, create it
    • Add the new entry to the appropriate category section
    • Sort entries by date within each category

Category Reference

Category Use When
decisions Recording architecture or design choices
solutions Documenting a technical approach
issues Recording a bug fix or troubleshooting
patterns Capturing a reusable code pattern
corrections Fixing a previous misconception
context Adding project background info

Usage Examples

/kb-add decisions 选择 PostgreSQL 作为主数据库
/kb-add issues 修复登录页面白屏问题
/kb-add                                    # Interactive mode
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. 12d ago First seen · 48 lines · 0 tokens per session scan A 7a0047778680

Subscribe to this mod's changes

kb-add is a command published in the GitHub repository qqabcv520/my-claude-marketplaces (2 stars, last pushed 5mo ago), licensed MIT. It adds 12 tokens to every session and 459 once invoked, about $0.0001 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.