How to use XML tags in Claude prompts
Wrapping parts of your prompt in simple tags is one of the easiest ways to get more reliable answers from Claude. A practical guide with examples.
Paste a file tree and a few key files and get the tour a senior engineer would give you: how a request flows, where things live, what to avoid.
Pretend you've maintained this codebase for three years and I joined the team this morning. Here's the file tree: ``` [PASTE THE OUTPUT OF: tree -L 3 -I node_modules] ``` And the files that matter most: [PASTE 2 TO 5 FILES: the entry point, a core model, one typical route or handler] Walk me through it: 1. What does this system do, and how is it put together? One paragraph. 2. Pick one typical request and follow it from the entry point to the database and back. Use the real file and function names. 3. Which five concepts do I need in my head, and how do they connect? 4. Give me a table: "I want to change X" on the left, "look in Y" on the right. 5. What looks wrong but is on purpose? And what really is wrong? 6. Suggest three small, safe tasks for my first week that would teach me the most. If what I pasted isn't enough to answer something, tell me which file you need. Don't guess.
In one paragraph. This is a bookings app for small gyms. A React front end talks to an Express API in /server. Data lives in Postgres and is accessed through Prisma. Anything slow (emails, PDF invoices) goes through a job queue in /jobs so that requests stay fast.
web/src/pages/ClassPage.tsx calls POST /api/bookings.server/routes/bookings.ts validates the body with bookingSchema, then calls canBook(member, class).server/services/bookings.ts opens a transaction, checks the class is not full, and inserts the row.booking-confirmed job and returns 201.jobs/bookingConfirmed.ts sends the email a few seconds later.| I want to change... | Look in |
|---|---|
| Who is allowed to do what | server/auth/policies.ts |
| An email | jobs/emails/*.mjml |
| The database schema | prisma/schema.prisma, then run migrate dev |
| Prices and plans | server/config/plans.ts (not the database) |
deletedAt. Nothing is ever really deleted, so always query through db.active().utils/dates.ts mixes UTC and local time. Do not build on it. There is a ticket.TODO.md. You will learn how migrations work here.canBook(). There are edge cases nobody has written down.I could not see how payments work from these files. Send me server/services/billing.ts and I will add it to the tour.
NoteThis is an example. Results change between runs and model versions. Claude Prompts is a fan project and is not affiliated with Anthropic.
Your first days in a repository you didn't write. A new job, an open source project you'd like to contribute to, a codebase somebody left you. It's also a quick way to produce onboarding notes for whoever joins after you.
The file tree does more work than you'd think. Keep it to three levels and leave out build output, or the structure drowns in noise. For the files, go for the ones that show the pattern rather than the biggest ones: an entry point, one model, one ordinary route. Once you have the tour, ask for the walkthrough again with a different action ("now trace a failed login") and you'll see the error paths too.
Claude only knows what you pasted. Treat the "really is wrong" list as things to ask a teammate about, not as facts. And whatever else you change in the prompt, keep the last line. Naming the missing file instead of guessing is what makes the tour trustworthy.
Use the copy button above. The full text is included, nothing is cut off.
Everything highlighted in yellow is a placeholder. Swap it for your own topic, audience or data.
If the result helped, press the heart. Votes decide which prompts make the weekly top 10.
What the error means. Cannot read properties of undefined (reading 'map') means orders was undefined at the moment the component rendered. The array never arrived, or it arrived under a different name. Most likely causes 1...
Stops Claude from patching symptoms. It ranks the likely causes, tells you what to check first, and only then writes the fix.

Six lightweight loading indicators in pure CSS. Each has a reduced motion fallback, and one variable changes the colour of all of them.
What it does. Once a night, it finds every subscription that renewed in the last 24 hours, builds a PDF invoice for each one, emails it, and records that the invoice was sent. If anything fails for one customer, it moves on to...
Paste a function or file you didn't write and get a plain explanation of what it does, why it's built that way, and where it's likely to break.
Wrapping parts of your prompt in simple tags is one of the easiest ways to get more reliable answers from Claude. A practical guide with examples.
None of these cause an error message. They just make every answer a little worse. Here is how to spot each one and what to write instead.