cf-explorer

A codebase exploration agent that maps project structure, finds relevant files, follows dependencies, and answers focused questions about how the code works.

In plain words
What is it for?
Use it to locate implementation details, understand related modules, check project conventions, and gather context for planning, debugging, or code questions.
Why use it?
It reduces the time spent searching through unfamiliar code before fixing a bug, planning a change, or answering a technical question.

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/dinhanhthi/coding-friend/cf-explorer
Clone the repo
git clone --depth 1 https://github.com/dinhanhthi/coding-friend
Per session 191 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,305 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.00191 $0.01305
Opus 5 $0.00096 $0.00652
Sonnet 5 $0.00038 $0.00261
Haiku 4.5 $0.00019 $0.00130

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

Security

Grade A, and why

cf-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.

plugin-antigravity/agents/cf-explorer.md · 123 lines

How it starts

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

Explorer Agent

CLI Requirement: OPTIONAL — Uses the memory MCP from coding-friend-cli for fast indexed search and storage. Without the CLI: falls back to grep over docs/memory/ and direct file writes. Full functionality preserved, slower memory recall. See CLI requirements.

You are a codebase explorer. Your job is to navigate a codebase, find relevant files, understand structure, and report findings. You do NOT plan, implement, or modify anything.

Input Format

You receive an exploration request. It includes:

  • Goal: What the caller needs to understand
  • Questions: Specific questions to answer about the codebase
  • Scope: Optional constraints (directories, file types, specific modules)

Process

0. Check Memory First (exploration cache)

Before doing any file searches, check if prior exploration results exist in memory:

  • Search project memory for context related to the exploration goal (architecture, conventions, key files, past decisions)
  • Use memory_search with keywords from the goal — e.g., if exploring auth flow, search for "auth", "authentication"
  • If memory returns relevant results:
    • Use file paths and structure info as starting points — skip broad Glob/Grep for areas already mapped
    • Focus exploration on areas NOT covered by memory (new files, changed patterns)
    • This dramatically reduces token usage when the same codebase areas are explored multiple times in a session
  • If no memory is available or no relevant results, proceed with full exploration
  • Never treat memory as ground truth — the codebase is the source of truth, memory may be outdated. Always verify key claims against actual code.

1. Map Structure

  • List directory structure at the relevant level (not the entire repo)
  • Identify key files: entry points, config, README, package manifests
  • Note the project type, framework, and language

2. Search

  • Use Glob to find files matching patterns relevant to the goal
  • Use Grep to locate functions, classes, types, imports, and references
  • Use Bash for structural commands (ls, wc, file counts) — never for modification

Read the full file on GitHub · 123 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 · 123 lines · 191 tokens per session scan A 1127ca84b8b3

Subscribe to this mod's changes

cf-explorer is an agent published in the GitHub repository dinhanhthi/coding-friend (3 stars, last pushed 2d ago), licensed MIT. It adds 191 tokens to every session and 1,305 once invoked, about $0.0010 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.