Onboarding a new developer when your team works with coding agents
Developer onboarding, tested in Claude Code and Codex: what a new hire's agent learns from the code, what only people know, and the three files to write first.
By Scott Strang
Last updated
The short answer. In developer onboarding on a team that works with Claude Code or Codex, the new hire's agent can explain the code on day one (setup, structure, any reason written in a commit message), but not why things were decided, who owns what or what's in flight. In our test, a fresh session in both tools said a file two customers depend on looked safe to clean up, with only a caveat that it couldn't see outside callers. Write those three things down once in the repo (a pointer in AGENTS.md, short decision notes and a first-week note), and the new person and every agent read them.
On day one, the agent knows the code, not the team
We built a small billing repo and asked a fresh Claude Code session and a fresh Codex session a new engineer's eight first-week questions. Then we added four short files (a three-line AGENTS.md, two decision notes and a first-week note) and asked again.
| A new engineer asks | Code only | Code plus four written files |
|---|---|---|
| How do I set up and run the tests? | ✅ both found it | ✅ both found it |
| What does this service do? | ✅ both found it | ✅ both found it |
| Why is the retry limit 7? (the reason is in a commit message) | ✅ both found it in git history | ✅ both found it |
| Why Postgres locks and not Redis? | ❌ Claude Code guessed; Codex said the repo doesn't say | ✅ both read the decision note |
| Can I clean up this legacy file? (two customers parse its output) | ⚠️ both: nothing in the repo calls it, so cleanup looks safe, but they can't see outside callers | ✅ both: no, it's frozen, and why |
| Who do I ask about the payments code? | ❌ Claude Code: unknown; Codex: "ask" the commit author | ✅ both named the team's channel |
| Is anyone working on the retry code right now? | ❌ Claude Code: "No" (it checked local branches); Codex: unknown | ✅ both read the "in flight" note |
| What's a good first task? | ⚠️ both suggested a sensible test, not the team's pick | ✅ both gave the one the team chose |
Claude Code 2.1.283 (Sonnet) and Codex CLI 0.146.0 (gpt-5.6-sol, medium reasoning), Nov 24, 2026, both read-only. One run per tool. Where each answer came from is the agent's own report, not a measurement. The files we added are in Step 2 and the questions are in Step 4, so you can rerun it.
The pattern: the agent answers the what and the how from the code. The why, the who and the now live in people's heads until someone writes them down.
The risky answer is the confident one
An agent that says "the repo doesn't say" sends the new engineer to a person, which is the right outcome. The risk is a plausible answer built from what the agent can see. Asked whether the legacy invoice file could be cleaned up, both tools found nothing in the repo calling it and said cleanup looked safe, with a caveat a new hire could skim past. That's a fact the people who talk to customers know, not something an engineer finds in the code, so on most teams a founder, a PM or whoever owns the customer writes decision notes too. Two customers parse that file's exact output.
The same gap shows up in the setup files agents write for themselves. Run on the code-only repo, Claude Code's /init wrote a sensible CLAUDE.md (setup, test commands, the retry reason it found in git history) and described the legacy file as old code "kept for reference only". Nothing in the repo says why it's kept. That line would load into every future session as fact.
Step 1: Let the agent answer the "what" questions
On their first morning, have the new engineer open their coding agent at the root of each repo they'll work in and ask it to walk them through the code. Anthropic's Claude Code docs suggest the same start for a new codebase: an overview first, then the architecture, then the key data models. The same prompts work in Codex.
Give me an overview of this codebase: what it does, how it's laid out, and how to run it and its tests.
Then explain the main architecture patterns and the key data models.
For anything you tell me, name the file or commit it came from, and say when you're guessing.The last line matters. In our test we asked for a source and a "found / inferred / unknown" label on every answer, and the labels are how we could tell a guess from a fact.
Step 2: Write down the three things only people know
Most of what a new engineer needs from a person fits in three kinds of short file in the repo, and they help every agent as much as the new hire:
| File | What goes in it | Why the agent needs it |
|---|---|---|
AGENTS.md | Setup and test commands, plus one line pointing to the two files below | Codex reads it at every start; Claude Code (2.1.277 or later) reads it when no CLAUDE.md or CLAUDE.local.md sits in that folder or above |
docs/decisions/ | One short note per decision: what, why, what you rejected, date, owner | The why behind code that looks odd, and what not to change |
docs/onboarding.md | Who owns which area and where to ask, a good first task, and what's in flight, with a date | The who and the now |
These are three of the four files from our test (the second decision note has the same shape). Copy and edit them:
AGENTS.md:
# billing: notes for people and agents
- Run `make setup` once, then `make test` before every PR.
- Decisions live in docs/decisions/. Read the relevant one before changing retries, locking or invoices.
- New to the team? Read docs/onboarding.md first.docs/decisions/0002-freeze-legacy-invoices.md:
# 0002 · legacy/invoice_v1 is frozen
Date: 2026-10-20 · Owner: invoices
Decided: no changes to legacy/invoice_v1.py. Two enterprise customers parse its exact text output.
Plan: they move to the v2 JSON invoices by March 2027, then we delete it.docs/onboarding.md:
# Your first week on billing
- Owners: payments code (src/retry.py, src/locks.py) is the payments group; ask in #billing-payments. Invoices: #billing-invoices.
- Good first task: add a test for should_retry when attempt reaches MAX_RETRIES.
- In flight as of 2026-11-20: the retry code is being moved to a queue worker on branch retry-worker. Don't refactor src/retry.py until it lands.Keep the instructions in AGENTS.md. If your team also keeps a CLAUDE.md, CLAUDE.md and AGENTS.md: keeping them right for a whole team shows how to make both tools read the same file, including the Windows caveat for symlinks. For the decision notes, A decision log people and agents both use has a template.
Keep the reason in the commit message too. Both tools found the retry reason in git history, and Claude Code's /init copied it into the CLAUDE.md it wrote.
Step 3: Run /init, then fix what it guessed
Getting a new agent up to speed on a codebase is the same job as getting a new person up to speed, and both tools have a command that drafts the agent's file:
| Tool | Command | What it writes |
|---|---|---|
| Claude Code | /init | A starting CLAUDE.md with "build commands, test instructions, and project conventions it discovers"; it suggests improvements if one already exists |
| Codex | /init | An AGENTS.md scaffold to "review" and "edit" to match your conventions |
Run it, then read every line about why something exists. Claude Code's docs say to refine the file "with instructions Claude wouldn't discover on its own", and our test showed what that means: the reasons it couldn't see, it filled in with a guess. The legacy file was "kept for reference only", and a declined card was a customer-side failure, which the repo never says. Delete or correct those lines. Then keep one file: Claude Code skips AGENTS.md whenever a CLAUDE.md or CLAUDE.local.md sits in the same folder or above, so a plain /init in Claude Code leaves you with two files and Claude Code reading only the new one. Fold its useful lines into AGENTS.md and make CLAUDE.md a symlink to it; CLAUDE.md and AGENTS.md: keeping them right for a whole team has the commands.
In Claude Code, setting CLAUDE_CODE_NEW_INIT=1 before /init makes it ask follow-up questions and show a proposal before writing any files, so you can supply the reasons instead of reviewing its guesses (per Anthropic's docs; we didn't run this mode):
CLAUDE_CODE_NEW_INIT=1 claudeThen type /init in the session.
Step 4: Test it with a fresh session before they start
Before the new engineer's first day, open a fresh agent session in the repo and ask the questions they will ask. Any answer marked "inferred" or "unknown" on a why, who or now question is a line someone needs to write.
You are helping a new engineer who joined this team today. Answer their first-week questions about this
repository. Look at whatever you need in the repo (files, git history). Do not change any file.
1. How do I set up and run the tests?
2. What does this service do?
3. Why is <the oddest-looking thing in the code> the way it is?
4. Why did we choose <a key technology> over the obvious alternative?
5. Can I clean up <the code that looks unused>? Is anything relying on it?
6. Who should I ask about <the area they'll work in>?
7. Is anyone working on <that area> right now?
8. What's a good first task?
For each: the answer in one or two sentences, the file or commit it came from, and FOUND (stated in the
repo), INFERRED (your reasoning) or UNKNOWN (the repo doesn't say).Fill in the angle brackets with your own repo's details before you paste it.
Step 5: Keep a person for the judgment calls
Written context doesn't replace an onboarding buddy; it changes what the buddy spends time on. The buddy no longer explains where the tests live. They answer the questions no file can: which of two owners to trust, or whether a shortcut is fine this week. Pair the new engineer with one named person for the first two weeks, and write every question a file couldn't answer into one.
Watch the "in flight" line. It goes stale fastest: in our test, one tool noticed the named branch didn't exist in the clone and said so, and the other repeated the note as current. Date it, and update it in the same pull request that finishes the work.
Developer onboarding checklist: what the agent finds, and what a person must write down
| First week | The agent finds it in the code | A person must write it down |
|---|---|---|
| Machine set up, repo running, tests pass | ✅ from the README, Makefile, AGENTS.md | Access and accounts, if setup needs a person to grant them |
| How the code is laid out | ✅ | |
| Why the odd parts are the way they are | Only if the reason is in a commit or a comment | ✅ a decision note per choice |
| What must not change, and who depends on it | ❌ it sees callers inside the repo only | ✅ the decision note, linked from AGENTS.md |
| Who owns each area, where to ask | ❌ | ✅ docs/onboarding.md |
| What's in flight right now | ❌ | ✅ docs/onboarding.md, dated |
| A good first task | It can suggest one | ✅ the one the team wants done |
| The first pull request merged | It can help write it | A person reviews and merges it |
How we do it: one start-here file, and CI flags what it's missing
The repo where we wrote this guide opened to the whole team on Nov 23, 2026. The handoff starts at one file, docs/team-handoff/README.md, which tells agents to "read this file first" and is named in the repo's CLAUDE.md as "Start here". Every job, table, data source and setting has a short card in one definitions file, and a CI check named "Team handoff docs" fails any pull request that adds one without its card. A new teammate's agent reads the same map the new teammate does, and CI flags any new part of the repo that the map is missing.
We also reviewed how every person with a commit on our three repos got set up (Oct 30, 2026). Two findings shaped this guide. We now count a person as onboarded when a fresh coding session can pull up real team knowledge and answer one real question with evidence, not when their tools are installed. And every newcomer needed a colleague at some point, even with the team's context loaded, which is why Step 5 is there.
Where it breaks for a team: decisions made in meetings never reach the file
The three files work for one repo and one new hire. A team multiplies them: every repo needs its own, the decisions that matter are often made in a meeting or a chat, by a founder, a PM or someone in sales as often as an engineer, and never reach a file, and the "in flight" line is wrong by the end of the week. The new engineer's agent reads whatever was true when someone last edited the file.
The team-sized fix: an owner per file, and a check before each hire
Without any new tool: give each file an owner, update the decision note and the "in flight" line in the same pull request that changes them, add a check that fails when a new area has no owner listed, and rerun the Step 4 questions before each new hire starts. What stays manual is getting decisions out of meetings and chats into the repo, and keeping "what's in flight" true.
Where SageOx helps
SageOx is a tool-agnostic context layer that keeps teams of humans and agents coordinated, so every person and every agent knows what the team knows. It works alongside Claude Code and Codex.
- Agent priming (
ox agent prime) loads Team Context, team rules, the docs catalog and prior work into a Claude Code or Codex session at start, so a new engineer's first session begins with more than one repo's files. - Team Context is a team-scoped repo of conventions, decisions, meeting transcripts and distilled memory that every person and agent on the team reads, across every connected repo. Decisions made in recorded meetings reach it without someone copying them into each repo.
- Team rules are written once and reach every teammate's agent in every connected repo.
- CodeDB (
ox code search) is a local index of code symbols, call graph, git history and GitHub PRs and issues that agents query instead of grep, so "who changed this and why" can come from the PR, not a guess.
All four are live for everyone. One person sets SageOx up for the team (Team setup quickstart); each new teammate then joins from an invite link and connects each repo with ox init.
Have your agent do it
Paste this into Claude Code or Codex at the root of a repo before your next hire starts. It finds the gaps and drafts the three files, and changes nothing until you approve.
A new engineer joins this team soon and will work in this repo with a coding agent. Find what they, and
their agent, can't learn from the code alone.
1. Read AGENTS.md, CLAUDE.md, the README, any docs/ folder and the last 50 commits.
2. List the five things in the code most likely to confuse a newcomer: odd values, code that looks unused,
unusual technology choices. For each, say whether the reason is written anywhere (file or commit), or
mark it UNKNOWN.
3. Draft docs/onboarding.md with three sections: who owns each area and where to ask, a good first task,
and what's in flight, each with "Owner:" and "As of:" lines for me to fill in. Don't invent names,
owners or reasons; leave a blank where you don't know.
4. Draft one docs/decisions/ note for each UNKNOWN reason, with the reason left blank for me.
5. Propose the line to add to AGENTS.md that points to both.
Show me the drafts and the diff before writing anything.See how a new teammate starts with Team Context →
Questions
Can an AI coding agent onboard a new developer? Partly. In our test, Claude Code and Codex answered setup, structure and what the code does from the repo alone; they couldn't answer why things were decided, who owns them or what's in flight until those were written down.
What should a developer onboarding checklist include now? The usual items (setup, access, a first task, a first merged pull request), plus the things the new hire's agent can't find in the code: the reasons behind odd-looking code, what must not change, owners, and current work, each written in a file the agent reads.
Does /init write onboarding docs?
It writes a starting instructions file: CLAUDE.md in Claude Code, AGENTS.md in Codex. It records what it can discover from the code; review every line that explains why something exists, because that's where it guesses.
Should onboarding notes go in CLAUDE.md or AGENTS.md?
AGENTS.md, with a pointer to the longer notes in docs/. Codex reads AGENTS.md and not CLAUDE.md by default, and Claude Code 2.1.277 or later reads it when no CLAUDE.md or CLAUDE.local.md sits in that folder or above. CLAUDE.md and AGENTS.md: keeping them right for a whole team covers the rest.
Does a new developer still need an onboarding buddy? Yes: in our own review of how our engineers onboarded, every one needed a colleague at some point. The files change what the buddy spends time on.
Related guides
- How-to · CLAUDE.md and AGENTS.md: keeping them right for a whole team
- Template · A decision log people and agents both use
- Advice · Tribal knowledge: keeping what your team knows when engineers leave
Sources
| Source | What it supports | Checked |
|---|---|---|
Our test: Claude Code 2.1.283 and Codex CLI 0.146.0, eight questions, code only vs four written files, plus Claude Code /init | The main table, the legacy-file and /init results, Step 4 | Nov 24, 2026 |
| Claude Code: how Claude remembers your project | /init, CLAUDE_CODE_NEW_INIT, AGENTS.md read only with no CLAUDE.md | Nov 24, 2026 |
| Claude Code: common workflows | The "understand new codebases" prompts in Step 1 | Nov 24, 2026 |
| Codex CLI: developer commands | Codex /init creates an AGENTS.md scaffold | Nov 24, 2026 |
| Codex: AGENTS.md | Which instruction files Codex reads | Nov 24, 2026 |
| Our own repo and review: the Nov 23, 2026 team handoff docs and CI check; the Oct 30, 2026 review of how our engineers onboarded | How we do it, Step 5 | Nov 24, 2026 |

