AI agents

Real-world examples

Example: Understand a new repository

Prompt examples are illustrative; commands are verified against official docs.

You just cloned a repo you have never seen. Goal: build a mental model of the architecture, find the entry points, and leave durable project instructions behind so future sessions start smarter.

Workflow

  1. Start a session in the repo root.
  2. Ask broad orientation questions, then narrow down.
  3. Use a read-only exploration subagent where supported.
  4. Generate a project instructions file (/init).
  5. Ask follow-up questions on the areas you care about.

Claude Code

Start an interactive session:

cd your-repo
claude

Generate a starter CLAUDE.md so future sessions load project context automatically:

/init

Explore interactively:

Give me an overview of this repository: what does it do, what are the main
modules, and where is the application entry point?
How does the authentication flow work end to end? Trace it from the HTTP
handler to the database.

Delegate deep exploration to the built-in Explore subagent (read-only, runs a fast model, supports thoroughness levels):

Use an Explore subagent (very thorough) to map out how the billing module is
structured and which other modules depend on it.

Follow up without leaving the session, and later continue where you left off:

claude -c    # continue the most recent conversation in this directory

Claude Code also accumulates learnings across sessions automatically (auto memory).

Codex

Start the TUI:

cd your-repo
codex

Generate an AGENTS.md scaffold (Codex reads AGENTS.md from the repo automatically):

/init

Explore interactively:

Give me an overview of this repository: main modules, entry points, and how
they are wired together.

Delegate read-heavy exploration to the built-in explorer subagent (subagent workflows are enabled by default; features.multi_agent = true):

Spawn an explorer subagent to map the billing module and its dependencies,
then summarize the findings here.
Trace a login request from the route handler to the database query. List the
files involved.

Kimi Code

Start the TUI:

cd your-repo
kimi

Analyze the codebase and generate AGENTS.md (Kimi Code’s project instruction file):

/init

Explore interactively:

Give me an overview of this repository: purpose, main modules, and entry
points.

Use the built-in read-only explore sub-agent (dispatched with an approval request in the default Always Ask mode):

Use the explore sub-agent to map out the billing module and report which
files define its public interface.

Ask side questions without polluting the main investigation thread:

/btw What test framework does this repo use?

Last verified: 2026-09-07

AI coding tools evolve quickly. If you find outdated information, please open an issue or pull request.