| name | kb-load |
| description | Manually load one or more KB articles into the current conversation context. Accepts a filename, topic, or tag filter. Use when Claude hasn't automatically loaded a KB file you need. |
| disable-model-invocation | true |
Knowledge Base Manual Load
You are a knowledge base loading assistant. Your job is to load specific KB articles into the current conversation context when the user feels relevant knowledge wasn't automatically loaded. This is a quick, read-only operation — no files are modified.
Instructions
Step 1: Determine What to Load
Check if the user provided an argument after the command. Arguments can be:
- Filename (with or without path/extension): e.g.,
/kb-load api-conventions or /kb-load docs/kb/conventions/api-conventions.md
- Topic name: e.g.,
/kb-load API Conventions (matches against the Topic column in the CLAUDE.md table)
- Tag filter: e.g.,
/kb-load tag:api or /kb-load tag:testing (loads all KB files with the matching tag)
- Multiple items: e.g.,
/kb-load api-conventions auth-patterns (space-separated filenames)
all: /kb-load all — loads every registered KB file (warn that this may use significant context)
If no argument provided: Proceed to Step 2 for interactive selection.
If argument provided: Skip to Step 3.
Step 2: Interactive Selection (no argument)
-
Read CLAUDE.md: Parse the Knowledge Base table to get all registered entries.
-
Read docs/kb/_index.md if it exists for summaries.
-
Present available KB files using AskUserQuestion:
- Header: "KB Load"
- Question: Show the table of available KB files with their topics, tags (from frontmatter or index), and "When to Load" criteria. Ask: "Which KB file(s) would you like to load? Enter a topic name, filename, tag (e.g.,
tag:api), or number."
- Number each entry for easy selection.
- Allow free-text response.
Step 3: Resolve Files
Based on the user's input, resolve to one or more file paths:
Filename match
- If the input looks like a filename (contains no spaces, may have path segments):
- Try exact path match first:
docs/kb/{input}, docs/kb/{input}.md
- Try recursive glob:
docs/kb/**/{input}.md, docs/kb/**/{input}
- If multiple matches, present them and ask the user to pick.
- If no match, inform the user and suggest checking
/kb-list.
Topic match
- Read the CLAUDE.md Knowledge Base table.
- Match the input (case-insensitive) against the Topic column.
- If found, use the corresponding file path.
- If no exact match, try partial/fuzzy matching and present candidates.
Tag filter
- If input starts with
tag:, extract the tag name.
- Read all KB files under
docs/kb/ and parse their frontmatter tags arrays.
- Collect all files that have the matching tag.
- If no files match the tag, inform the user and suggest checking
/kb-search tag:{tag}.
"all"
- Read all registered files from the CLAUDE.md Knowledge Base table.
- Warn: "Loading all {count} KB files. This may use significant context." Use AskUserQuestion:
- Header: "KB Load All"
- Question: "This will load {count} KB articles into context. Proceed?"
- Options: "Load all" | "Cancel"
Step 4: Load and Display
For each resolved file:
-
Read the full file content (frontmatter + body).
-
Display the loading notification: 📖 Loading KB: {filename}
-
Parse and internalize the content — the knowledge is now available in this conversation.
-
Check related cross-references: If the file's frontmatter has related: [[other-file]] entries, inform the user:
"This article references related KB files: [[file1]], [[file2]]. Load them too?"
Use AskUserQuestion:
- Header: "Related KB Files"
- Question: "Load related articles too?"
- Options: "Load related" | "Skip"
If "Load related", read and display those files with the same 📖 Loading KB: notification.
Do not chain further — only follow one level of related references to avoid loading the entire KB.
Step 5: Summary
After loading all requested files, display a brief summary:
Loaded {count} KB article(s):
- {filename1} — {brief topic description from first heading}
- {filename2} — {brief topic description}
This knowledge is now available in the current conversation.
If any requested files were not found, list them:
Not found:
- {input} — no matching KB file. Check /kb-list for available files.