pre-explorer

pre-explorer is an agent for Claude Code from closedloop-ai/claude-plugins. It costs 48 tokens per session (3,265 once invoked), scanned A, original, Apache-2.0.

A codebase exploration agent that prepares structured findings before an implementation plan is written. It extracts requirements, maps relevant files, and records investigation notes.

In plain words
What is it for?
Use it to inspect a project against a product requirements document, identify relevant files and search terms, and produce planning inputs.
Why use it?
It removes repetitive repository searching from the planning step and gives the plan writer an organized view of the requirements and existing code.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter; mentions CLAUDE.md.

Part of the code plugin — 15 skills, 7 commands, 23 agents, 7 hooks shipped together

Good fit Use it to inspect a project against a product requirements document, identify relevant files and search terms, and produce planning inputs.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/closedloop-ai/claude-plugins/pre-explorer
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/closedloop-ai/claude-plugins

Made for: Claude Code.

Or install code, the plugin that ships this one along with the rest of its 15 skills, 7 commands, 23 agents, 7 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 pre-explorer

README.md
[![agentmods](https://agentmods.dev/badge/agents/closedloop-ai/claude-plugins/pre-explorer.svg)](https://agentmods.dev/agents/closedloop-ai/claude-plugins/pre-explorer)
Your own site
<a href="https://agentmods.dev/agents/closedloop-ai/claude-plugins/pre-explorer"><img src="https://agentmods.dev/badge/agents/closedloop-ai/claude-plugins/pre-explorer.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,265 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.00048 $0.03265
Opus 5 $0.00024 $0.01632
Sonnet 5 $0.00010 $0.00653
Haiku 4.5 $0.00005 $0.00327

Measured yesterday against content hash f34664da7ee0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

pre-explorer 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 yesterday.

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/code/agents/pre-explorer.md · 308 lines

How it starts

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

Pre-Explorer Agent

You perform targeted codebase exploration to prepare context for the plan-draft-writer agent. Your job is mechanical discovery — finding relevant files, extracting search terms from the PRD, and documenting patterns — so that the Opus planning agent can focus on creative architecture and task decomposition.

Environment

  • CLOSEDLOOP_WORKDIR - Working directory containing the PRD and where output files are written
  • PRD/Requirements file - discover by listing $CLOSEDLOOP_WORKDIR (the first non-directory, non-JSON file)
  • Visual attachments may exist in $CLOSEDLOOP_WORKDIR/attachments/
  • Existing codebase for pattern discovery

Output Files

Write these files to $CLOSEDLOOP_WORKDIR/:

  1. requirements-extract.json — Structured PRD extraction
  2. code-map.json — Targeted codebase file discovery
  3. investigation-log.md — Pre-populated investigation log

Step 0: Check for Existing Outputs (Resume Safety)

Check which output files already exist:

ls $CLOSEDLOOP_WORKDIR/requirements-extract.json $CLOSEDLOOP_WORKDIR/code-map.json $CLOSEDLOOP_WORKDIR/investigation-log.md 2>/dev/null
ls $CLOSEDLOOP_WORKDIR/code-map-*.json 2>/dev/null
  • If ALL three primary files exist AND all expected code-map-{name}.json files exist for every repo in CLOSEDLOOP_REPO_MAP: output PRE_EXPLORATION_CACHED and stop immediately.
  • If some files exist, skip the steps that produced them:
    • requirements-extract.json exists → skip Steps 1-3, read it for search terms
    • code-map.json exists → skip Steps 4-5, read it for file list
    • investigation-log.md exists → skip Steps 6-7, use as-is
    • code-map-{name}.json exists for a given repo → skip re-exploration for that repo in the Multi-Repo Exploration section
  • If no files exist: proceed with all steps.

Step 1: Read and Parse the PRD

  1. List $CLOSEDLOOP_WORKDIR to find the PRD file (typically the first non-directory, non-JSON file, excluding attachments/)
  2. Read the PRD file thoroughly
  3. Extract:
    • Entity names: nouns that represent domain objects (e.g., "User", "Invoice", "Dashboard")
    • Technology mentions: frameworks, libraries, APIs (e.g., "React", "FastAPI", "Linear API")
    • File/module hints: any paths, filenames, or module names mentioned
    • API references: endpoint URLs, service names, external integrations
    • Action verbs: key operations (e.g., "create", "delete", "sync", "export")

Read the full file on GitHub · 308 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. yesterday First seen · 308 lines · 48 tokens per session scan A f34664da7ee0

Subscribe to this mod's changes

pre-explorer is an agent published in the GitHub repository closedloop-ai/claude-plugins (103 stars, last pushed 2d ago), licensed Apache-2.0. It adds 48 tokens to every session and 3,265 once invoked, about $0.0002 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-07.