map-codebase

map-codebase is a command for Claude Code from pwdev-solucoes/pwdev-claude-marketplace. It costs 15 tokens per session (1,080 once invoked), scanned A, original, Apache-2.0.

A command that analyzes an existing codebase and writes a context document for later planning. A codebase is the project's source code and structure.

In plain words
What is it for?
Use it before planning changes in an unfamiliar repository or when you need a documented overview of the current code.
Why use it?
It collects the stack, directories, files, and conventions so future plans can match the project more closely.

Command for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the pwdev-feat plugin — 7 commands shipped together

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add pwdev-solucoes/pwdev-claude-marketplace
Claude Code
/plugin install pwdev-feat

Made for: Claude Code.

Or install pwdev-feat, the plugin that ships this one along with the rest of its 7 commands.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/pwdev-solucoes/pwdev-claude-marketplace/map-codebase.svg)](https://agentmods.dev/commands/pwdev-solucoes/pwdev-claude-marketplace/map-codebase)
Your own site
<a href="https://agentmods.dev/commands/pwdev-solucoes/pwdev-claude-marketplace/map-codebase"><img src="https://agentmods.dev/badge/commands/pwdev-solucoes/pwdev-claude-marketplace/map-codebase.svg" alt="Measured on agentmods" height="20"></a>
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,080 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00015 $0.01080
Opus 5 $0.00008 $0.00540
Sonnet 5 $0.00003 $0.00216
Haiku 4.5 $0.00002 $0.00108

Measured 2d ago against content hash 83850ca3fbd9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

map-codebase 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 2d 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.

plugins/pwdev-feat/commands/map-codebase.md · 142 lines

How it starts

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

/pwdev-feat:map-codebase — Codebase Analysis

Purpose

Analyze the current project and generate .planning/feat/codebase.md — a context document that the PWDEVIA planner uses to create better, more consistent action plans.

Procedure

STEP 0 — Language

Follow ${CLAUDE_PLUGIN_ROOT}/references/language.md (resolve lang from .planning/config.json; ask only if unset).

STEP 1 — Stack Detection

# Package managers and deps
cat package.json 2>/dev/null | head -40
cat composer.json 2>/dev/null | head -40
cat requirements.txt 2>/dev/null | head -20
cat Gemfile 2>/dev/null | head -20
cat go.mod 2>/dev/null | head -10

# Framework detection
ls artisan 2>/dev/null && echo "LARAVEL"
ls nuxt.config.* 2>/dev/null && echo "NUXT"
ls next.config.* 2>/dev/null && echo "NEXT"
ls vite.config.* 2>/dev/null && echo "VITE"

STEP 2 — Project Structure

# Directory structure (2 levels)
find . -maxdepth 2 -type d -not -path "*/node_modules/*" -not -path "*/.git/*" -not -path "*/vendor/*" -not -path "*/__pycache__/*" | sort | head -40

# Source file count by type
find . -type f \( -name "*.ts" -o -name "*.js" -o -name "*.vue" -o -name "*.php" -o -name "*.py" -o -name "*.jsx" -o -name "*.tsx" \) -not -path "*/node_modules/*" -not -path "*/vendor/*" | sed 's/.*\.//' | sort | uniq -c | sort -rn

STEP 3 — Conventions

# Code style config
cat .editorconfig 2>/dev/null | head -20
cat .eslintrc* eslint.config.* 2>/dev/null | head -20
cat .prettierrc* 2>/dev/null | head -10
cat phpcs.xml* 2>/dev/null | head -10

# TypeScript config
cat tsconfig.json 2>/dev/null | head -20

# Git conventions
git log --oneline -10 2>/dev/null

STEP 4 — Testing Setup

# Test framework detection
ls vitest.config.* jest.config.* phpunit.xml* pytest.ini 2>/dev/null
find tests/ test/ __tests__/ spec/ -type f 2>/dev/null | head -10
cat playwright.config.* 2>/dev/null | head -10

STEP 5 — Generate codebase.md

Write to .planning/feat/codebase.md:

Read the full file on GitHub · 142 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. 2d ago First seen · 142 lines · 15 tokens per session scan A 83850ca3fbd9

Subscribe to this mod's changes

map-codebase is a command published in the GitHub repository pwdev-solucoes/pwdev-claude-marketplace (2 stars, last pushed 17d ago), licensed Apache-2.0. It adds 15 tokens to every session and 1,080 once invoked, about $0.0001 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.