Build a Code Onboarding Assistant with AI

Use Claude Code, ChatGPT custom instructions, MCP Roots, and the Explain It Back technique to build a living assistant that reads, understands, and explains any codebase to you on demand.

Ever cloned a repo and had absolutely no idea where to start? Maybe it was a colleague's project, an open-source library, or something you wrote six months ago. Either way, staring at a wall of unfamiliar files is not fun.

In this project you're going to build a Code Onboarding Assistant — a personal AI-powered tool that reads a real codebase, explains what it does, answers your questions about it, and gives you a structured summary you can actually use. You'll combine five skills you've been building this week: MCP Roots for controlled file access, Claude Code's subagent mode for task delegation, the Explain It Back technique for verification, AI-assisted code understanding, and ChatGPT custom instructions for a consistent Q&A interface.

By the end you'll have a workflow you can reuse on any codebase — yours or someone else's.

What You'll Build

  • A structured codebase summary generated by Claude with subagent delegation — architecture, key files, entry points, and data flow
  • An MCP Roots configuration that gives Claude safe, scoped access to only the project folder you choose
  • An Explain It Back verification step that confirms Claude truly understood the codebase before you rely on its answers
  • A ChatGPT custom instructions profile that turns ChatGPT into a consistent onboarding Q&A assistant you can paste the summary into
  • A reusable onboarding prompt template you can drop into any new project immediately

What You'll Need

🤖

AI Tools

Claude (with Claude Code and MCP enabled) for codebase analysis and subagent delegation. ChatGPT (free or Plus) for the custom instructions Q&A interface. Both are used in this project.

📁

A Codebase + Text Editor

Any local project folder works — it can be your own code, a cloned GitHub repo, or even a small open-source project. VS Code or any text editor for saving your outputs and template.

How to Build It

1

Set Up MCP Roots to Give Claude Scoped Access

Before Claude can read your project, you need to tell it exactly where to look — and nothing else. MCP Roots is how you do that safely. Instead of giving Claude access to your entire file system, you point it at one specific folder. This step generates the MCP configuration you need and explains how to apply it.

Pick a real project folder on your machine — even a small one with 5–10 files is perfect. Then send the prompt below to Claude (in the Claude Code interface) to generate your scoped MCP Roots config.

Prompt — Claude Code
I want to set up MCP Roots so you have controlled, read-only access to a specific local project folder for a code onboarding session.

The folder path is: [REPLACE WITH YOUR ACTUAL FOLDER PATH, e.g. /Users/yourname/projects/my-app]

Please do the following:
1. Generate the correct MCP Roots JSON configuration block I need to add to my Claude MCP settings file to give you scoped access to only this folder.
2. Show me exactly where and how to add this configuration (which file to edit, what the full entry should look like).
3. Explain in 2-3 sentences why scoping access to one root is safer than giving access to my whole file system.
4. Tell me what to say to confirm you can see the folder once the config is applied.

What to look for

Claude should output a valid JSON config block with your folder path as a root entry, step-by-step instructions for applying it, and a clear explanation of why scoping matters. If it asks clarifying questions about your OS or Claude version, answer them — that's normal. Once you've applied the config, restart Claude Code and confirm it can list the files in your folder before moving on.

2

Use Subagent Mode to Delegate Codebase Analysis

Now that Claude has safe access to your folder, it's time to actually understand what's in it. Rather than asking Claude to do everything in one massive prompt, you're going to use subagent delegation — breaking the analysis into focused subtasks and letting Claude coordinate them like a senior dev would.

This prompt tells Claude to act as the orchestrator and spin up subagents for specific parts of the analysis: file structure, entry points, dependencies, and data flow. Send this in Claude Code after confirming your MCP Roots connection is working.

Prompt — Claude Code (Subagent Mode)
You now have MCP Roots access to my project folder. I want you to act as the orchestrating agent and delegate this codebase analysis across focused subagents. For each subtask below, treat it as a separate delegated analysis unit and report the findings clearly labeled by task name.

Subtask 1 — File Map: List every file and folder in the project. Group them by type (config, source, tests, assets, docs). Flag any file that looks like a main entry point.

Subtask 2 — Architecture Summary: Read the key source files and describe the overall architecture in plain English. What kind of project is this? What pattern does it follow (MVC, component-based, script-based, etc.)?

Subtask 3 — Dependency Audit: Find any package.json, requirements.txt, Gemfile, go.mod, or equivalent. List the main dependencies and explain in one sentence what each major one does.

Subtask 4 — Data Flow Trace: Identify how data enters the application (user input, API call, file read, etc.), how it moves through the code, and where it ends up (output, database write, rendered UI, etc.).

After all four subtasks are complete, write a combined "Onboarding Summary" section that synthesizes the findings into a 200-300 word overview a new developer could read in under 2 minutes. Use plain English. Avoid jargon unless you define it.

What to look for

You should see Claude working through each labeled subtask sequentially, reading actual files from your folder via MCP, and producing a labeled report for each one. The final Onboarding Summary should read like something you'd find in a good README — clear, structured, and specific to your project. Copy this entire output into a text file called onboarding-summary.md — you'll use it in Step 4.

3

Run the Explain It Back Technique to Verify Understanding

Here's a mistake a lot of people make: they assume the AI understood because it gave a confident-sounding answer. The Explain It Back technique fixes that. You ask Claude to summarize its own understanding back to you in its own words — and you specifically check for gaps, wrong assumptions, or hallucinated details before trusting any of it.

This is especially important when Claude is reading someone else's code. It might fill in gaps with plausible-sounding guesses. This step catches that before it becomes a problem. Send this prompt immediately after Step 2, in the same Claude Code session.

Prompt — Claude Code
Before I rely on your onboarding summary, I want to run an Explain It Back check. Please do the following:

1. In your own words, explain back to me what this codebase does — as if you were describing it to a teammate who has never seen it. Do NOT copy your previous summary. Rephrase it from memory.

2. List any parts of the codebase where you made an assumption or filled in a gap because the code was unclear, missing, or ambiguous. Be honest — if you weren't 100% sure about something in your analysis, flag it here.

3. Tell me: what is the ONE thing about this codebase you are least confident about, and why?

4. Based on your re-explanation, do you want to revise or correct anything from your earlier Onboarding Summary? If yes, write the corrected version of just that section.

What to look for

A trustworthy response will include at least one honest admission of uncertainty — something like "I assumed this function handles authentication because of its name, but I didn't see it called anywhere." If Claude says it's confident about everything, that itself is a red flag worth probing. If it flags corrections, update your onboarding-summary.md file with any revisions before moving to Step 4.

4

Configure ChatGPT Custom Instructions as Your Q&A Interface

Claude did the heavy lifting of reading and analyzing the code. Now you're going to set up ChatGPT as a dedicated Q&A assistant for your onboarding session — one that already knows how to respond to code questions in a way that's consistent, structured, and beginner-friendly every single time.

Open ChatGPT, go to Settings → Personalization → Custom Instructions, and use the prompt below to generate a set of custom instructions specifically designed for a code onboarding assistant. You'll paste these directly into your custom instructions fields.

Prompt — ChatGPT
I need you to write two custom instruction blocks for ChatGPT — one for the "What would you like ChatGPT to know about you?" field, and one for the "How would you like ChatGPT to respond?" field.

Context: I'm setting up ChatGPT as a code onboarding Q&A assistant. I'll paste a structured codebase summary into the start of each new chat, and then ask questions about the code. I'm an intermediate developer — I understand basic programming concepts but I'm not familiar with this specific codebase yet.

For the first field ("About You"), write instructions that tell ChatGPT:
- I'm a developer who is onboarding to an unfamiliar codebase
- I will always paste a codebase summary at the start of the conversation
- I want it to treat that summary as the source of truth for the session
- I may ask about specific files, functions, patterns, or concepts from the project

For the second field ("How to Respond"), write instructions that tell ChatGPT:
- Always anchor answers to the specific codebase summary I provided, not general assumptions
- If something isn't covered in the summary, say so explicitly instead of guessing
- Use clear, plain English explanations with short code examples when helpful
- Structure longer answers with numbered steps or labeled sections
- End each answer with one follow-up question I might want to ask next

Keep each block under 300 words. Write them ready to copy-paste.

What to look for

ChatGPT should give you two clearly separated instruction blocks, each ready to paste directly into the custom instructions fields. Copy each one into the appropriate field in ChatGPT's settings. Once saved, open a new chat, paste the contents of your onboarding-summary.md at the top, and try asking something like "What's the main entry point of this project?" — you should immediately notice more grounded, structured answers than you'd get from a default ChatGPT session.

5

Build Your Reusable Onboarding Prompt Template

You've now run a full AI-powered onboarding session on a real codebase. The final step is to turn everything you did into a reusable template — so next time you face an unfamiliar project, you have a proven, personalized system ready to go in under five minutes instead of starting from scratch.

This prompt asks ChatGPT (with your new custom instructions active) to help you package everything you've done this session into a clean, shareable template. You'll save this as a file you can drop into any project.

Prompt — ChatGPT (with custom instructions active)
I just completed a full AI-powered code onboarding session using a 5-step workflow. I want you to package this into a reusable template I can save and use on any future codebase.

Here's what the workflow covered:
1. MCP Roots config to give Claude scoped, safe read access to a project folder
2. Claude Code subagent delegation to analyze file structure, architecture, dependencies, and data flow
3. An Explain It Back verification step to check for gaps and assumptions in Claude's analysis
4. ChatGPT custom instructions to set up a consistent Q&A onboarding interface
5. A Q&A session using a pasted codebase summary as the source of truth

Please create a reusable "Code Onboarding Template" document with the following sections:

**Section 1: Pre-Flight Checklist** — A short checklist of things to confirm before starting (MCP Roots set up, folder scoped, Claude Code open, ChatGPT custom instructions saved).

**Section 2: The 4 Claude Code Prompts** — Placeholder versions of the subagent analysis prompt and the Explain It Back prompt, with [BRACKETS] wherever the user needs to fill in their specific project details.

**Section 3: The ChatGPT Session Starter** — A template opening message to paste at the start of every new ChatGPT onboarding chat (includes where to paste the summary and how to frame the first question).

**Section 4: 10 Go-To Onboarding Questions** — A list of 10 great questions to ask ChatGPT once the summary is loaded, covering architecture, logic, debugging, and "gotchas".

Format this as a clean Markdown document I can save as ONBOARDING-TEMPLATE.md.

What to look for

ChatGPT should produce a clean, well-structured Markdown document with all four sections clearly labeled and ready to use. The prompts in Section 2 should have obvious placeholder brackets. Save this as ONBOARDING-TEMPLATE.md somewhere easy to find — your Documents folder, a notes app, or a personal GitHub repo. This is now a permanent tool in your developer toolkit.

Common Issues

Claude says it can't see my folder after setting up MCP Roots

This almost always means you either forgot to restart Claude Code after editing the config, or there's a typo in the folder path. Double-check the path is absolute (starting with /Users/... on Mac or C:\... on Windows) and try a full restart of the application.

The subagent analysis just describes generic code concepts, not my actual files

Claude may not have actually read your files — it might be working from the file names alone. Add this line to the beginning of your Step 2 prompt: "Before responding, confirm you can read the file contents (not just names) by quoting the first line of the main entry point file." This forces it to actually open files via MCP.

The Explain It Back step says Claude is confident about everything

Push back. Add a follow-up prompt: "I find it hard to believe there were zero ambiguities. If you had to guess about anything — even slightly — what would it be?" A little pressure usually surfaces the honest uncertainty that was there all along. If it still insists everything was clear, check whether the codebase is genuinely tiny and simple — that's sometimes the real answer.

ChatGPT's answers feel generic even with custom instructions and the pasted summary

Make sure you're pasting the summary before your first question, not after. ChatGPT's custom instructions tell it how to behave, but if the summary isn't in the conversation context yet, it has nothing project-specific to anchor to. Also check that you're opening a new chat after saving your custom instructions — existing chats don't pick up new instruction changes.

The onboarding summary is too long to paste into ChatGPT

Ask Claude to generate a "compact version" of the summary with a 400-word limit. You can do this by sending: "Write a compact 400-word version of the onboarding summary, keeping only the most important architectural details, entry points, and data flow." Use that shorter version with ChatGPT and keep the full version in your .md file for reference.

What You Learned

🔐

Controlled AI File Access with MCP Roots

You learned how to configure MCP Roots to give Claude read access to exactly one folder — keeping your other files private and making the AI's scope predictable and safe.

🤝

Subagent Delegation for Complex Tasks

You practiced breaking a large, multi-part analysis job into named subtasks and letting Claude coordinate them — a pattern that produces better results than one giant prompt.

🔍

The Explain It Back Verification Method

You used the Explain It Back technique to surface gaps and assumptions in Claude's analysis — building a habit of verifying AI output before acting on it, especially with unfamiliar code.

⚙️

ChatGPT Custom Instructions for Consistent Sessions

You designed and applied custom instructions that turn ChatGPT into a domain-specific assistant — so every new onboarding session starts with the same reliable behavior instead of a blank slate.

Tips for Going Further

  • Add a CLAUDE.md file to your project. After generating your onboarding summary, ask Claude to turn it into a CLAUDE.md file at the root of the project. This permanently embeds project context so future Claude Code sessions start already informed — no re-analysis needed.
  • Run this on a GitHub repo you've always wanted to understand. Clone any open-source project locally, point your MCP Roots config at it, and run the full workflow. It's one of the fastest ways to actually understand a popular library instead of just using it blindly.
  • Extend the subagent analysis with a security subtask. Add a fifth delegated subtask to your Step 2 prompt: "Subtask 5 — Risk Flags: Look for any patterns that might indicate security concerns — hardcoded secrets, unvalidated inputs, overly broad file permissions, or commented-out auth checks." You'll be surprised what turns up.
  • Turn your 10 go-to questions into a Custom GPT. Take the question list from your ONBOARDING-TEMPLATE.md and build a Custom GPT with those questions as quick-action buttons. Now anyone on your team can onboard to a codebase with a single paste and a click.
  • Use the Explain It Back check as a code review step. The verification prompt from Step 3 works equally well when you've asked AI to write or refactor code. Before accepting any AI-generated code, ask it to explain back what the code does and flag any assumptions — it catches a surprising number of subtle bugs.
More projects

One of 32 hands-on projects.

All projects Getting Started tutorials