codebase-discovery

codebase-discovery is a skill for Claude Code from OKHP3/skillz. It costs 108 tokens per session (2,502 once invoked), scanned A, original, MIT.

Codebase analysis guidance for learning how an existing software system works, including its business rules, architecture, workflows, and terminology. It turns those findings into concise onboarding documents.

In plain words
What is it for?
Mapping an unfamiliar codebase, documenting business concepts and workflows, and preparing context for future development work.
Why use it?
It helps new developers or AI tools understand poorly documented code without relying on guesses or reading the entire repository.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: mentions CLAUDE.md; mentions subagents; mentions Claude Code.

Good fit Mapping an unfamiliar codebase, documenting business concepts and workflows, and preparing context for future development work.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/okhp3/skillz/codebase-discovery
View source ↗ OKHP3/skillz
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.

Any agent
npx skills add OKHP3/skillz --skill codebase-discovery
Clone the repo
git clone --depth 1 https://github.com/OKHP3/skillz

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/okhp3/skillz/codebase-discovery/github.svg)](https://agentmods.dev/skills/okhp3/skillz/codebase-discovery)
Your own site
<a href="https://agentmods.dev/skills/okhp3/skillz/codebase-discovery"><img src="https://agentmods.dev/badge/skills/okhp3/skillz/codebase-discovery/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-discovery

Your own site · 80×15
<a href="https://agentmods.dev/skills/okhp3/skillz/codebase-discovery"><img src="https://agentmods.dev/badge/skills/okhp3/skillz/codebase-discovery.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 108 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,502 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.00108 $0.02502
Opus 5 $0.00054 $0.01251
Sonnet 5 $0.00022 $0.00500
Haiku 4.5 $0.00011 $0.00250

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

Security

Grade A, and why

codebase-discovery 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 6d 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.

community/codebase-discovery/SKILL.md · 207 lines

How it starts

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

User Input

$ARGUMENTS

You MUST consider the user input before proceeding (if not empty). It identifies the codebase (or subsystem) to analyse and, optionally, the mode.


Purpose

Reverse-engineer enough business and domain knowledge out of an existing codebase to onboard a new team member — human or AI — and to give AI harness tooling (e.g. Spec Kit) the context it needs before any specification or change work begins.

The output is a small, lean set of onboarding documents under docs/, not a comprehensive knowledge base. Each document is written so it can be linked from a CLAUDE.md / AGENTS.md without consuming an unreasonable amount of context.

This skill is the orchestrator. It runs five phases, each defined in its own playbook under playbooks/. Read and follow the relevant playbook at each phase.


Core principle

The code is ground truth for what the system does. Only people hold the why.

So the method is: mine the code first to form evidence-backed hypotheses, then spend the human's time validating intent and explaining, not re-deriving mechanics. Existing docs (README, CLAUDE.md, AGENTS.md, wikis) are a valuable starting point, but because documentation naturally drifts from code over time, the source code is the source of truth — everything is verified against it before being relied on.


Roles

Adopt the role that fits the phase:

  • Recon / synthesis: act as a Senior Software Engineer + Solution Architect reading the system as-is. Understanding existing architecture is in scope; designing new architecture or proposing changes is not, unless explicitly asked.
  • Interview: act as a Senior Business Analyst supported by a Product Manager. Understand business intent, users, rules and domain language.

Modes

Determine the mode from the user input (default to full and confirm):

  • full — Pre-check → Recon → Interview → Synthesis → Verify. Requires a stakeholder (senior BA / Product Owner / SME) to validate findings.
  • code-only — Pre-check → Recon → Synthesis → Verify, with no interview. Everything that would need human confirmation is emitted as [assumption] / [unverified] for later validation. Use when no SME is available yet.

Read the full file on GitHub · 207 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. 6d ago First seen · 207 lines · 108 tokens per session scan A ab813652857a

Subscribe to this mod's changes

codebase-discovery is a skill published in the GitHub repository OKHP3/skillz (3 stars, last pushed yesterday), licensed MIT. It adds 108 tokens to every session and 2,502 once invoked, about $0.0005 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-09-03.

Related

Other skills, from other repositories

baoyu-comic

A tool for creating original educational comics that explain knowledge or ideas through multiple illustrated panels. It supports different art styles and tones and can create several comics in one batch.

JimLiu/baoyu-skills · 61 tokens

pm-career-coach

PM Career Coach — guides product managers through career transitions, skill development, and growth planning Use when: Planning your PM career path, preparing for promotion, navigating role transitions, or seeking career advice.

konglong87/superPM · 46 tokens

pm-interview-prep

PM Interview Preparation — practice product sense, execution, behavioral, and strategy questions Use when: Preparing for PM job interviews, practicing case studies, or refining interview responses.

konglong87/superPM · 40 tokens

kelly-homework-coach

A child-friendly homework coaching desk for elementary students. It explains photographed or pasted questions, studies wrong answers, keeps a mistake notebook, and prepares practice papers for review.

mr-kelly/skills · 110 tokens

kelly-lesson

A lesson-planning and compliance desk for schools or training programs. It drafts plans from curriculum materials and a required template, checks them against set standards, and routes them for review.

mr-kelly/skills · 110 tokens

kelly-education-intel

A daily research workspace for the education industry, including training centres, tutoring, exams, study abroad, visas, and admissions. It collects source-backed signals, explains their relevance, and prepares possible actions and draft messages for review.

mr-kelly/skills · 98 tokens