AI agent codebase onboarding
Give an AI coding agent the right codebase context before it edits files: architecture, rules, commands, risks and examples.

Put it into practice
What you will produce
A short map of entry points, domain boundaries, data flow, commands and high-risk areas with file references.
- 01
Find the actual entry points
Inspect app or package manifests, route registration and executable scripts; cite the files that show where requests, jobs or user actions enter the system.
Expected result: An entry-point map grounded in source files rather than guessed architecture.
- 02
Trace one representative data path
Follow a real feature from presentation through domain logic to persistence or an external service; note validation, authorization and ownership boundaries encountered.
Expected result: A compact flow map with file references and security-sensitive transitions.
- 03
Record commands and risk areas
Read project scripts and contributor guidance to identify safe checks; mark high-impact areas such as auth, billing or migrations only when the source shows they exist.
Expected result: A map of verified commands and evidenced risk areas, not a generic warning list.
- 04
Spot-check the map
Open each key citation, verify one important flow against code and run one safe command listed in the map; label runtime claims that static inspection cannot establish.
Expected result: A checked onboarding note that separates observed structure from behavior still needing execution.
Acceptance checks
- Entry points and package commands are backed by cited current files.
- At least one feature path is traced across the relevant layers.
- Authorization or data ownership boundaries are included when present in the path.
- Static observations are not presented as proof of runtime behavior.
Limits and trade-offs
A repository map goes stale and cannot prove runtime behavior by itself. Separate observed code from assumptions and unresolved questions.
Official sources
Prepare agent context
Related guides
CLAUDE.md: A Guide for Every Developer
One markdown file that makes AI coding assistants actually understand your codebase. Here's what to put in it.
There's a reason Claude Code writes great code in some projects and generic boilerplate in others. It's not the model. It's CLAUDE.md . It is one part of my Claude Code workflow: project conventions reduce guesswork, but they do not guarantee a speedup or remove the need to review the change. What it is CLAUDE.md is a plain markdown file that Claude Code reads at the start of every session. Think of it as the onboarding doc you'd give a senior contractor on day one: stack, conventions, rules, context. Without it, Claude infers patterns from what it sees in the codebase. Sometimes it infers correctly. Often it doesn't especially for implicit conventions your team just "knows". A CLAUDE.md makes your rules available without repeating them, but does not guarantee compliance: review the diff and run the checks. What to put in it 1. Stack and versions Simple but important. These…
Read the guideClaude Code Subagents: Parallel Agents
Learn when Claude Code subagents help, how to split parallel work, and how to configure a focused custom subagent without creating conflicts.
Subagents are useful when a task can be split cleanly: one agent searches the authentication code, another traces the database path, and the main conversation compares what they found. They add little to "read this file" or to work where every step depends on the same context. Short version: delegate independent research or a separate review when the results are worth the extra context and usage. Give each agent a narrow scope, the files or area to inspect, and a specific report format. Keep dependent work in the main conversation. Claude Code agents vs subagents Claude Code's documentation calls delegated workers subagents and uses Agent for the tool that starts them. When people search for Claude Code agents in this context, they usually mean subagents: workers that handle a delegated task in their own context and return a result to the main conversation. Claude Code's subagent documentation uses this terminology.…
Read the guideBuilding AI agents that actually work
Most 'agents' are brittle pipelines dressed up with AI. Here's the anatomy of a reliable agent, three patterns that hold up in production, and when to use n8n vs code.
Everyone is building agents. Most of them break on the third run. One common failure mode is asking the model to handle too many responsibilities without clear checks. Architecture, model behavior and external dependencies can all contribute to failures. Here's what I've learned building agents that actually run week after week. The anatomy of a reliable agent Every agent that works has three parts, and only one of them should involve AI. Trigger something deterministic starts the agent. A schedule, a webhook, a file drop, a form submission. Not "whenever the AI decides it's time." Context the agent gathers what it needs before calling the AI. The document, the data, the user preferences, the constraints. The AI call happens with full context, not halfway through discovery. Action after the AI produces output, something deterministic happens with it. It gets saved, sent, logged, or published. The action step doesn't retry or…
Read the guide