meta: Command for Claude Code

.claude/commands/kb-context.md

kb-context is a command for Claude Code from gitkb/meta. It costs 11 tokens per session (646 once invoked), scanned A, original, MIT.

A command that loads and checks project context, setting it up when necessary.

In plain words
What is it for?
It is for loading, validating, and bootstrapping project context.
Why use it?
It helps the agent begin with the project information it needs and identifies invalid context.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions AGENTS.md.

This is gitkb/meta's own configuration. It tells Claude Code how to work on meta 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 meta configures →

View source ↗ gitkb/meta
Reuse

Borrowing it

Nothing to install: this file belongs to gitkb/meta. 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/gitkb/meta/main/.claude/commands/kb-context.md
Clone the repo
git clone --depth 1 https://github.com/gitkb/meta

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 kb-context

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/gitkb/meta/kb-context"><img src="https://agentmods.dev/badge/commands/gitkb/meta/kb-context.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 646 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.00011 $0.00646
Opus 5.5 $0.00004 $0.00258
Sonnet 5.5 $0.00002 $0.00129
Haiku 4.5 $0.00001 $0.00065

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

Security

Grade A, and why

kb-context 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 15d 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/kb-context.md · 72 lines

How it starts

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

Load project context following the AGENTS.md PATH A/B/C flow.

Steps

1. Detect KB State

git kb list --path context/

2. Follow the Right Path

If no context documents exist (PATH A — First-Time Setup):

The KB is fresh. Help the user establish context:

  1. Ask about the project: what it does, who it's for, tech stack, current state
  2. Create the 7 context documents:
    • context/immutable/project-brief (type: brief)
    • context/immutable/patterns (type: patterns)
    • context/immutable/architecture (type: architecture)
    • context/extensible/product (type: context)
    • context/extensible/tech (type: context)
    • context/overridable/active (type: context)
    • context/overridable/progress (type: context)
  3. Populate each with gathered information
  4. Commit: "Initial context setup"

If context documents exist (PATH B — Load and Validate):

  1. Use kb_context to load the full context bundle
  2. Validate completeness — check all 7 docs exist:
    • context/immutable/project-brief
    • context/immutable/patterns
    • context/immutable/architecture
    • context/extensible/product
    • context/extensible/tech
    • context/overridable/active
    • context/overridable/progress
  3. If any are missing, flag them and offer to create them
  4. Detect staleness in overridable docs:
    • Check if context/overridable/active references tasks that are now completed
    • Check if context/overridable/progress shows phases as "in progress" when all their tasks are done
    • If stale, warn: "Active context appears stale — it references [X] as in-progress but that work is complete. Consider running /kb-handoff to update it."

If context was already loaded this session (PATH C — Quick Resume):

  1. Check kb_status for pending changes
  2. Quick-refresh context/overridable/active
  3. Resume work

3. Present Context Summary

After loading, present a concise summary:

  • Current focus (from active context)
  • Task board summary (counts by status)
  • Any blockers or stale items
  • Confidence level: 100% if all context loaded and validated

Read the full file on GitHub · 72 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. 15d ago First seen · 72 lines · 11 tokens per session scan A 9ea84fa57190

Subscribe to this mod's changes

kb-context is a command published in the GitHub repository gitkb/meta (20 stars, last pushed 8d ago), licensed MIT. It adds 11 tokens to every session and 646 once invoked, about $0.0000 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-11-15.

Related

kb-context compared with commands from other repositories

kb-context next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
kb-contextgitkb/metaCommand208d agoMITA11Claude Code
checklistgithub/spec-kitCommand153k3d agoMITA13Claude Code
clarifygithub/spec-kitCommand153k3d agoMITA27Claude Code
analyzegithub/spec-kitCommand153k3d agoMITA26Claude Code
specifygithub/spec-kitCommand153k3d agoMITA13Claude Code
convergegithub/spec-kitCommand153k3d agoMITA35Claude Code
implementgithub/spec-kitCommand153k3d agoMITA14Claude Code