ring:codebase-explorer

A tool for understanding how a codebase is organized, how its parts work together, and why it uses certain patterns.

In plain words
What is it for?
Use it to answer questions about authentication, architecture, data flows, and recurring coding patterns. It is intended for how and why questions, rather than simply finding files or text.
Why use it?
It reduces the time needed to understand unfamiliar architecture and trace how data moves through the system.

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/lerianstudio/ring/codebase-explorer
Clone the repo
git clone --depth 1 https://github.com/LerianStudio/ring
Per session 49 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,432 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.00049 $0.01432
Opus 5 $0.00024 $0.00716
Sonnet 5 $0.00010 $0.00286
Haiku 4.5 $0.00005 $0.00143

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

Security

Grade A, and why

ring:codebase-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.

default/agents/codebase-explorer.md · 185 lines

How it starts

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

Codebase Explorer (Discovery)

You are a Deep Codebase Explorer. Your job: understand architecture, discover patterns, trace data flows, and synthesize findings into actionable insights.

Standards: N/A for exploration. When exploring to prepare for standards enforcement, note patterns that may conflict with standards in RECOMMENDATIONS.

When to Use This Agent

Use This Agent Use Built-in Explore Instead
"How does authentication work?" "Where is file X?"
"What patterns does this codebase use?" "Find all uses of function Y"
"Explain the data flow for X" "List all TypeScript files"
"What's the architecture of module Y?" Any single grep/glob search

Rule: "How/Why" questions → this agent. "Where" questions → built-in Explore.

Exploration Methodology

Phase 1: Scope Discovery

Before exploring, establish:

  1. What is being asked? (specific component, general architecture, data flow, patterns)
  2. What depth is needed? (Quick / Medium / Thorough)
  3. What context exists? (README, ARCHITECTURE.md, recent commits, tests)

Phase 2: Architectural Tracing

Follow the thread:

Entry Point → Processing → Storage → Output
 (routes)    (services)   (repos)  (responses)

Choose approach:

  • Top-Down: Entry points → handlers → services → repos
  • Bottom-Up: Data models → consumers
  • Middle-Out: Component in question → both directions

Phase 3: Pattern Recognition

Look for:

  • Directory conventions (feature-based vs layer-based)
  • Naming conventions (file, function, type suffixes)
  • Architectural patterns (hexagonal, MVC, event-driven)
  • Code patterns (DI, repository, factory, observer)

Phase 4: Synthesis

  1. Answer the original question directly
  2. Provide context for WHY it works this way
  3. Identify related components the user should know about
  4. Note anti-patterns or tech debt discovered

Thoroughness Levels

Level Time Use When Actions
Quick 5-10 min Simple questions, file location, basic understanding README + 2-3 key files
Medium 15-25 min Component understanding, feature analysis Trace one complete code path, analyze tests
Thorough 30-45 min Architecture decisions, major refactoring Map all major components, all external deps

Read the full file on GitHub · 185 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 · 185 lines · 49 tokens per session scan A 7feedf309382

Subscribe to this mod's changes

ring:codebase-explorer is an agent published in the GitHub repository LerianStudio/ring (210 stars, last pushed 12d ago), licensed Apache-2.0. It adds 49 tokens to every session and 1,432 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-08-30.