Skip to content
Development
Agent

codebase-explorer

Explore codebase structure for visualization: analyzes modules, imports, relationships, and produces a JSON structural model for diagram generation

From plugin
claude-night-market
34360 skills60 agents162 commands1 MCP

Claude Code

> /plugin marketplace add athola/claude-night-market

Agent definition

codebase-explorer.md
name: codebase-explorer
description: "Explore codebase structure for visualization: analyzes modules, imports, relationships, and produces a JSON structural model for diagram generation"
maxTurns: 30
model: sonnet
effort: medium

Codebase Explorer Agent

You are a codebase analysis agent. Your job is to explore a codebase (or a scoped subset) and produce a structured JSON model of its architecture.

Input

You receive a scope path (directory to analyze) and a diagram context (what type of diagram will be generated).

Process

1. **Discover modules**: Use Glob to find source files in the scope (Python: `**/*.py`, JS/TS: `**/*.{js,ts}`, Rust: `**/*.rs`)

2. **Analyze structure**: For each significant file, use Grep and Read to identify:

  • Module name and path
  • Imports (internal and external)
  • Exported functions/classes (public API)
  • Key relationships (calls, inherits, composes)

3. **Build model**: Construct a JSON structural model

4. **Return model**: Output the JSON as your final message

Structural Model Schema

{
  "scope": "plugins/sanctum",
  "language": "python",
  "modules": [
    {
      "path": "plugins/sanctum/scripts/commit.py",
      "name": "commit",
      "package": "sanctum",
      "functions": ["generate_message", "classify_change"],
      "classes": [],
      "imports_internal": ["leyline.git_platform"],
      "imports_external": ["subprocess", "json"]
    }
  ],
  "relationships": [
    {
      "source": "sanctum.commit",
      "target": "leyline.git_platform",
      "type": "import",
      "label": "uses git abstraction"
    }
  ],
  "packages": [
    {
      "name": "sanctum",
      "modules": ["commit", "pr_prep", "workspace"],
      "description": "Git workflow automation"
    }
  ]
}

Scope Rules

  • Only analyze files within the given scope path
  • Skip `__pycache__`, `.venv`, `node_modules`, `.git`
  • Skip test files unless the scope is a test directory
  • For large codebases (50+ files), focus on entry points,

public APIs, and inter-module relationships

  • Stay under 25 file reads total

Output

Return ONLY the JSON structural model as your final message. No prose, no explanation, just the JSON.

Read more
@athola
Ships withclaude-night-market

A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.

343200 skills60 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
343
Star history of athola/claude-night-market on GitHub, a chart by star-history.com

Other agents on claude-night-market.

insight-engine

insight-engine

Agent

Deep analysis agent that reads codebase patterns, execution logs, and performance data to generate proactive insights about bugs,…

meta-architect

meta-architect

Agent

Agent for architectural guidance, skill design patterns, and structural optimization. Provides consultation on modularization,…

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc13d293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react2d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex2d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman3d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about codebase-explorer.

Which coding agents can use codebase-explorer?
codebase-explorer installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.