/prp-core:prp-codebase-question <question or topic> [--web] [--follow-up]from prp-core
Researches codebase questions by spawning parallel agents to find where code lives and how it works. Documents existing structure without suggesting changes.
Ships in prp-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Input: $ARGUMENTS
Answer codebase questions thoroughly by spawning parallel specialized agents, synthesizing their findings, and producing a research document.
Core Philosophy: Document what IS, not what SHOULD BE. You are a technical cartographer.
Golden Rule: Every claim must have a file:line reference. No speculation, no suggestions, no critique.
If the user mentions specific files, read them FULLY first (no limit/offset) before any decomposition.
| Type | Indicators | Agent Focus |
|---|---|---|
| Where | "where is", "find", "locate" | prp-core:codebase-explorer primary |
| How | "how does", "trace", "flow" | prp-core:codebase-analyst primary |
| What | "what is", "explain", "describe" | Both agents in parallel |
| Pattern | "how do we", "convention", "examples" | prp-core:codebase-explorer primary |
| External | "docs", "best practice", "API" | Add prp-core:web-researcher |
--web flag for external research--follow-up flag for appending to existing researchPHASE_1_CHECKPOINT:
Break the query into 2-5 composable research areas:
RESEARCH QUESTION: {user's question}
AREAS:
1. {Area} → Agent: {which agent}
2. {Area} → Agent: {which agent}
3. {Area} → Agent: {which agent}
| Agent | Use When |
|---|---|
prp-core:codebase-explorer | Finding WHERE code lives, locating files, extracting patterns, discovering conventions |
prp-core:codebase-analyst | Understanding HOW code works, tracing data flow, mapping integration points |
prp-core:web-researcher | Only when --web flag is set or user explicitly asks for external docs |
Strategy:
prp-core:codebase-explorer to find what existsprp-core:codebase-analyst on the most relevant findings to trace how they workPHASE_2_CHECKPOINT:
Launch agents in parallel using multiple Task tool calls in a single message.
For each research area, use the appropriate agent:
prp-core:codebase-explorer:
Find all code relevant to: {research area}
LOCATE:
1. {Specific files/components to find}
2. {Patterns or conventions to extract}
3. {Related test files and configuration}
Categorize findings by purpose. Return ACTUAL code snippets with file:line references.
Remember: Document what exists, no suggestions or improvements.
prp-core:codebase-analyst:
Analyze the implementation of: {research area}
TRACE:
1. {Data flow to trace}
2. {Integration points to document}
3. {Contracts between components}
Document what exists with precise file:line references. No suggestions.
prp-core:web-researcher:
Research external documentation for: {topic}
FIND:
1. {Specific documentation needed}
2. {API references or patterns}
Return findings with direct links and citations.
IMPORTANT: Wait for ALL agents to complete before proceeding.
PHASE_3_CHECKPOINT:
file:line references throughoutMap findings back to the user's original question:
| Question Aspect | Finding | Evidence |
|---|---|---|
| {aspect 1} | {what was found} | file.ts:123 |
| {aspect 2} | {what was found} | file.ts:456 |
Note any areas that couldn't be fully documented:
PHASE_4_CHECKPOINT:
date -u +"%Y-%m-%dT%H:%M:%SZ"
git rev-parse --short HEAD
git branch --show-current
basename $(git rev-parse --show-toplevel)
# --- PRP store resolver (canonical; keep byte-identical across skills) ---
# Adopt the store that already records this root; mint a key only when none does.
_gd="$(git rev-parse --path-format=absolute --git-common-dir 2>/dev/null)"
case "$_gd" in */.git) _root="${_gd%/.git}" ;; "") _root="$PWD" ;; *) _root="$_gd" ;; esac
_root="$(cd "$_root" && pwd -P)"
_name="$(basename "$_root" | tr '[:upper:]' '[:lower:]' | tr -cs 'a-z0-9' '-' | sed 's/^-*//;s/-*$//')"
_home="${PRP_HOME:-$HOME/.prp}"
_hit="$(grep -lsF "\"path\": \"$_root\"" "$_home"/*/project.json 2>/dev/null | head -1)"
PRP_DIR="${_hit%/project.json}"
[ -n "$PRP_DIR" ] || PRP_DIR="$_home/${_name:-project}-$(printf %s "$_root" | git hash-object --stdin | cut -c1-8)"
mkdir -p "$PRP_DIR"; [ -f "$PRP_DIR/project.json" ] || printf '{"path": "%s", "name": "%s"}\n' "$_root" "${_name:-project}" > "$PRP_DIR/project.json"
mkdir -p "$PRP_DIR/research"
If --follow-up: Append to existing research file instead of creating new one.
If new research:
Path: $PRP_DIR/research/{YYYY-MM-DD}-{kebab-case-topic}.md
Examples:
2025-01-08-authentication-flow.md2025-01-15-database-migration-patterns.md---
date: {ISO timestamp with timezone}
git_commit: {short hash}
branch: {branch name}
repository: {repo name}
topic: "{User's Question/Topic}"
tags: [research, codebase, {relevant-component-names}]
status: complete
last_updated: {YYYY-MM-DD}
---
# Research: {User's Question/Topic}
**Date**: {ISO timestamp}
**Git Commit**: {short hash}
**Branch**: {branch name}
**Repository**: {repo name}
## Research Question
{Original user query}
## Summary
{High-level documentation of what was found, answering the question by describing what exists}
## Detailed Findings
### {Component/Area 1}
- Description of what exists (`file.ts:123`)
- How it connects to other components
- Current implementation details
### {Component/Area 2}
...
## Code References
| File | Lines | Description |
|------|-------|-------------|
| `path/to/file.ts` | 123-145 | {What's there} |
| `another/file.ts` | 45-67 | {What's there} |
## Architecture Documentation
{Current patterns, conventions, and design implementations found}
## Open Questions
- {Areas that need further investigation}
# Check if on main or pushed
git branch --show-current
gh repo view --json owner,name -q '"\(.owner.login)/\(.name)"'
If on main/pushed, replace local file references with:
https://github.com/{owner}/{repo}/blob/{commit}/{file}#L{line}
If --follow-up flag and existing research file:
last_updated and add last_updated_note## Follow-up Research {timestamp}PHASE_5_CHECKPOINT:
## Research Complete
**Question**: {original question}
**Document**: `{expanded absolute path to $PRP_DIR/research/{filename}.md}`
### Summary
{2-3 sentence answer to the question}
### Key Findings
- **{Finding 1}**: {brief} (`file.ts:123`)
- **{Finding 2}**: {brief} (`file.ts:456`)
- **{Finding 3}**: {brief} (`file.ts:789`)
### Architecture
{1-2 sentence description of relevant architecture}
### Open Questions
- {Any unanswered aspects}
### Follow-up
To dig deeper: `/prp-codebase-question --follow-up {topic}`
To include external docs: `/prp-codebase-question --web {topic}`
# Basic codebase question
/prp-codebase-question how does authentication work
# Include external documentation
/prp-codebase-question --web how does the PRP runner execute commands
# Follow up on previous research
/prp-codebase-question --follow-up what error handling patterns exist in the runner
# Locate and document a specific area
/prp-codebase-question where are all the command templates and how are they structured
Document, don't evaluate. Describe what IS, never what SHOULD BE.
Evidence required. Every claim needs a file:line reference.
Agents are parallel. Launch multiple agents simultaneously when researching different areas.
Wait for completion. Never synthesize until ALL agents have returned.
Read first. If the user mentions files, read them fully before spawning agents.
No placeholders. Every field in the research document must have real values.
Codebase is truth. Live code always overrides documentation or assumptions.
file:line references{expanded absolute path to $PRP_DIR/research/}What SKILL.md sets; muted values are Claude Code's defaults
22 skills in this plugin
/prp-broRestates the previous response in plain language, with no jargon. Use when the user says "bro", asks to "say that plainly", says "explain it simply", or invokes /prp-bro./prp-commitCreates Git commits for completed work. Always use when committing changes, when the user explicitly asks to commit the work, when another PRP workflow reaches its commit step, or when the user invokes /prp-commit./prp-companionWrites the visual HTML companion of a PRP plan or review - one self-contained page beside the markdown that shows a plan's change diagram, steps and risks, or a review's verdict, findings and a diagram of what the PR changed, with every item carrying a stable id a mark can point at. In helm a review or plan page is live: the operator sets each finding's or step's status and replies on the page. prp-plan and prp-review run it after writing their markdown. Use when the user wants to "make it visual", "show me the plan", "visualize this review", "diagram this plan", "write the companion", or invokes /prp-companion.npx claudepluginhub wirasm/prp --plugin prp-coreOther plugins' skills for the same job