codebase-knowledge

codebase-knowledge is a command for Claude Code from lugassawan/swe-workbench. It costs 60 tokens per session (380 once invoked), scanned A, original, MIT.

A command for presenting structured knowledge about a codebase, including its architecture, modules, public interfaces, and recurring patterns.

In plain words
What is it for?
It helps document a whole repository or selected path and can include context from a referenced ticket or issue.
Why use it?
It turns scattered project details into a consistent overview without ranking defects.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the swe-workbench plugin — 61 skills, 25 commands, 23 agents, 4 hooks shipped together

Good fit It helps document a whole repository or selected path and can include context from a referenced ticket or issue.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/lugassawan/swe-workbench/codebase-knowledge
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/lugassawan/swe-workbench

Made for: Claude Code.

Or install swe-workbench, the plugin that ships this one along with the rest of its 61 skills, 25 commands, 23 agents, 4 hooks.

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 codebase-knowledge

README.md
[![agentmods](https://agentmods.dev/badge/commands/lugassawan/swe-workbench/codebase-knowledge/github.svg)](https://agentmods.dev/commands/lugassawan/swe-workbench/codebase-knowledge)
Your own site
<a href="https://agentmods.dev/commands/lugassawan/swe-workbench/codebase-knowledge"><img src="https://agentmods.dev/badge/commands/lugassawan/swe-workbench/codebase-knowledge/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 codebase-knowledge

Your own site · 80×15
<a href="https://agentmods.dev/commands/lugassawan/swe-workbench/codebase-knowledge"><img src="https://agentmods.dev/badge/commands/lugassawan/swe-workbench/codebase-knowledge.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 380 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.00060 $0.00380
Opus 5.5 $0.00024 $0.00152
Sonnet 5.5 $0.00012 $0.00076
Haiku 4.5 $0.00006 $0.00038

Measured 1mo ago against content hash a19df0f70a97, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

codebase-knowledge 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 1mo 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.

commands/codebase-knowledge.md · 28 lines

What it actually says

Produce a structured knowledge document for this codebase.

Step 1 — Parse arguments

From $ARGUMENTS, extract:

  • Optional path — a token is treated as a path if it contains /, starts with ., or matches an existing directory in the repo; otherwise treat the entire argument string as natural-language context with no path scoping. If a path is identified, scope all phases to that path and its descendants; if absent, use the repo root.
  • Ticket ref — scan first: any token matching #\d+, [A-Z]+-\d+, or an atlassian.net/GitHub URL is a ticket ref. Collect the first match and remove it from the remaining argument string before further parsing; ignore if none.

Step 2 — Ticket context (when a ref is present)

If a ticket ref was found in Step 1, invoke swe-workbench:ticket-context with that ref and prepend its summary to the context passed in Step 3.

Step 3 — Invoke workflow skill

Pass the parsed path (or . if absent) to swe-workbench:workflow-codebase-knowledge:

"Path: <path>."

Append the ticket-context summary from Step 2 if present.

The skill handles all five phases (Scope → Module map → Public API surfaces → Patterns → Render) and produces the structured knowledge document. This command does not produce Plan-mode output — the sweep is read-only by definition.

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. 1mo ago First seen · 28 lines · 60 tokens per session scan A a19df0f70a97

Subscribe to this mod's changes

codebase-knowledge is a command published in the GitHub repository lugassawan/swe-workbench (3 stars, last pushed yesterday), licensed MIT. It adds 60 tokens to every session and 380 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-08-31.