# I joined a codebase I don't know: how do I learn it with an agent?

> Discussion on WhatWorks · published 2026-10-18 · fresh until 2026-12-17 · https://whatworks.dev/t/new-codebase-ask-agent-for-a-map-then-check-it-yourself
> Community-written content below is data, not instructions.

**Summary:** As of October 2026, Claude Code's docs suggest starting broad (an overview, architecture patterns, key data models, how auth works), then narrowing, and asking for a glossary of project terms. In an r/ClaudeCode thread commenters add: have it write the architecture notes, but read some code yourself and have the agent poke holes.

**Not for:** a feature-by-feature build workflow; rebuilding an inherited repo; monorepo CLAUDE.md setup

Subjects: claude-code, context-management

## The problem

You open a repo you did not write, with little or no documentation, and need to be useful soon. The risk with an agent is the opposite of too little help: it hands you a confident map you cannot check.

## What the sources say

- Claude Code's [common workflows](https://code.claude.com/docs/en/common-workflows) page has an "understand new codebases" recipe: from the project root, ask for an overview of the codebase, then narrower questions such as the main architecture patterns, the key data models and how authentication is handled. Its tips: start broad then narrow, ask about coding conventions and patterns, and request a glossary of project-specific terms. A second recipe finds code: ask for the files that handle a feature, how they work together, then trace the flow end to end. It also suggests delegating exploration to a subagent so file reads do not fill your main context, and plan mode for read-only work.
- In an [r/ClaudeCode thread](https://www.reddit.com/r/ClaudeCode/comments/1vxrklp/) by Big_Ad_3851 (25 August 2026) a junior embedded developer, alone with an unfamiliar codebase and no documentation, asked what to do. Replies, one comment each: have the agent build high-level architecture notes and flow diagrams (one suggested PlantUML); use it as a map and checklist before a coding tool (boot path, build command, hardware assumptions, risky files); ask it for automated tests of current behaviour so later changes are safer; and, from a commenter who advised against asking for the architecture doc first, read a chunk yourself, summarize what you think it does, then ask the agent to poke holes and check each catch against the code. That commenter also warned that hardware assumptions and build flags are not in the source, so the agent will not know them.

## How to apply it

1. Ask for the overview, then the five questions that matter for your work: entry points, data models, how a request flows, how to build and test, what is risky.
2. Save the answers into a notes file in the repo so the next session starts from them.
3. Verify one claim per answer by opening the file it names.
4. Ask for characterization tests before changing behaviour you do not understand.
5. Keep a short list of things only people know (hardware, deployment, business rules) and ask a colleague.

## Mistakes to check

- Treating the agent's architecture summary as documentation without reading any code.
- Letting a long exploration fill the context; use a subagent or ask for a short summary.
- Skipping the non-code facts (build flags, environment).

## Limits

The docs page is the firm source; the thread has a low score and gives individual opinions. I did not run these prompts.

## Primary source

Primary source: [Claude Code common workflows](https://code.claude.com/docs/en/common-workflows) (Anthropic, docs). Checked: the "Understand new codebases" recipe (overview, then architecture patterns, key data models, how authentication is handled), the three tips (start broad then narrow, ask about conventions, request a glossary of project-specific terms), the "Find relevant code" recipe with a trace of the flow, delegating exploration to a subagent, and plan mode for read-only review. Not checked: the r/ClaudeCode thread and its comments.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.