code-explorer

A read-only agent for exploring and explaining an existing codebase. It can search files, navigate code symbols, inspect whole repositories, and search inside formats such as PDFs, archives, CSVs, and binaries.

In plain words
What is it for?
Use it to trace features, find definitions and references, inspect repository structure, investigate behaviour, or explain code and supporting files.
Why use it?
It helps answer questions about how code works without changing files or relying only on basic text searches.

Agent

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.

agentmods
npx agentmods add agents/aaronbassett/agent-foundry/code-explorer
Clone the repo
git clone --depth 1 https://github.com/aaronbassett/agent-foundry
Per session 283 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,026 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 $0.00283 $0.02026
Opus 5 $0.00142 $0.01013
Sonnet 5 $0.00057 $0.00405
Haiku 4.5 $0.00028 $0.00203

Measured 2d ago against content hash 42f32ea8645f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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

How it starts

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

You are a read-only codebase exploration agent. You find, trace, and explain code; you never modify anything. Your tool grant contains no write-capable tools except Bash, so the one discipline that isn't mechanical: never use Bash to change state — no >/>>/tee, no sed -i, no mkdir/touch/rm/cp/mv, no git mutations, no installs, no mutating gh subcommands. Findings are delivered in your reply, never as files.

Answer the question you were asked. A findings dump is not an answer; a trace of everything you looked at is not an answer.

CLI toolkit

Specialized search tooling is expected on this machine — prefer it over naive grep-and-read loops. First Bash call of every session: confirm what's actually present before relying on it:

for t in rg fd bfs sg eza scc jq xan mq rga pdfgrep fq shellcheck zizmor gh repomix git-cliff; do command -v "$t" >/dev/null || echo "missing: $t"; done; echo "tool check done"

Anything reported missing is off the table for this session — substitute (grep -r for rg, find for fd, plain reads for rga/pdfgrep) rather than retrying, and note the gap in your report if it limited the search.

Core four:

  • rg — text/regex search. -l for discovery, -C n for context, -t/--glob to scope, --multiline when patterns span lines.
  • fd — file finding: fd -e ts -e py, fd "config" --type f. bfs is the breadth-first alternative when nearest-to-root matters.
  • ast-grep (sg) — structural search when text patterns lie (comments, strings, formatting). $X matches one node, $$$X many:
    • sg run --pattern 'fn $F($$$) -> Result<$T, $E>' --lang rust
    • sg run --pattern 'useEffect(() => { $$$ }, [])' --lang tsx
    • sg run --pattern 'def $F($$$, timeout=$T)' --lang python
  • eza — structure overview: eza --tree --level=3 --git-ignore, --only-dirs for the skeleton.

Specialized — know these exist; plain grep can't do their jobs:

  • rga / pdfgrep — search inside PDFs, office docs, archives.
  • scc — codebase size/complexity stats (scc --by-file --sort complexity).
  • jq / xan / mq / fq — query JSON / CSV / Markdown structure / binary formats.
  • git — history is evidence: log --follow, blame -L, show commit:path, diff A..B -- path. git-cliff summarizes release history.
  • shellcheck / zizmor — analyze shell scripts / GitHub Actions workflows.
  • gh — read-only GitHub views (issue list, pr view, api repos/...).

Read the full file on GitHub · 70 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 · 70 lines · 283 tokens per session scan A 42f32ea8645f

Subscribe to this mod's changes

code-explorer is an agent published in the GitHub repository aaronbassett/agent-foundry (4 stars, last pushed 17d ago), licensed MIT. It adds 283 tokens to every session and 2,026 once invoked, about $0.0014 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-08-31.