Bootcamp — 8 · Documentation
BOOTCAMP — 8 · Documentation

Documentation

Turn code into clear explanations, API references, and technical docs — and keep them living so the next person (or agent) inherits context instead of guessing.

Read time11 min
LevelBasic → Advanced
Quiz3 questions
SectionBootcamp 2026
01 — what & why

Docs are context that outlives the chat

Good docs are how knowledge survives after the session ends — for teammates and for Claude on the next run. This directly counters the "nobody knows the project" failure mode.

Claude can explain unfamiliar code, draft API docs from handlers, and keep a docs folder current. Anchor this in Backend → Docs Folder and feed durable facts back into CLAUDE.md.

Docs the agent reads (CLAUDE.md, docs/) are also context that improves every future prompt.

02 — the technique

Explain, then capture

Generate the explanation, verify it against the code, then put it where it will be found.

✓
Verify against source
Docs that drift from code are worse than none.
✓
Put it where it's found
README, docs/, or CLAUDE.md — not a lost chat.
✗
Don't over-document
Explain the why and the non-obvious, not every line.
✗
Don't let it rot
Update docs in the same change as the code.
03 — worked example (Leave Management)

API docs for POST /leave-requests

Accurate, verified against the code — the contract a frontend or teammate can rely on.

markdown
### POST /leave-requests
Create a leave request for the acting employee.

Acting user: x-acting-user header (a seeded employee id) — no login flow
Body: { "startDate": "2026-08-01", "endDate": "2026-08-03", "reason": "..." }

Responses
  201  { "id", "status": "pending", "days" }   created
  400  invalid or missing dates
  422  insufficient leave balance

Verify each line against the handler + service before committing, then record the durable bits in docs/api.md and note the endpoint in CLAUDE.md.

Now do this on YOUR project: generate docs for one of your endpoints, diff them against the code to catch drift, and save them where teammates look.

04 — best practices

Capture context that survives

Good docs are the context that outlives the chat — they brief the next session and the next hire.

✓
Only what Claude can't infer
CLAUDE.md earns its length — non-obvious commands, style deviations, env quirks only; everything inferrable from the code is noise.
✓
Start with /init, then hand-refine
Generate the first CLAUDE.md draft with /init so it starts grounded in the actual codebase — editing is faster than writing from scratch.
✗
Sprint status or temp workarounds
Exclude anything that changes frequently — stale entries erode trust in the whole file and cost more to maintain than they save.
✗
Auto-merge doc updates
Automate detection of doc drift, but always require human review before merging — documentation changes carry judgment calls that automation can't validate.
Check your understanding
1. How do docs counter the "nobody knows the project" risk of heavy AI use?
Correct.Not quite — the correct answer is highlighted above.
2. What is the biggest risk with generated documentation?
Correct.Not quite — the correct answer is highlighted above.
3. Where should durable project facts live so future Claude sessions use them?
Correct.Not quite — the correct answer is highlighted above.
Basic · Guided Project: Leave Management System
Explain a code file

Objective: get a clear, accurate explanation of one file in your project that a new teammate could follow.

prompt
Explain what this file does, for a new teammate.
Cover its responsibility, key functions, and how it fits the app.
Flag anything surprising or non-obvious.
  • Pick one non-trivial file.
  • Generate the explanation; check it against the code.
  • Correct any drift; save it near the file or in docs/.
✓
Done when
An accurate explanation exists where a teammate would look.
✗
Watch out
Publishing an explanation you haven't checked against the code.

Discuss with your facilitator: did explaining the file reveal anything you didn't actually understand?

Intermediate · Semi-guided Project: Leave Management System
Generate API docs for an endpoint

Objective: produce accurate API documentation (request, response, errors) for one endpoint of your project.

  • Point Claude at one endpoint's handler.
  • Generate request/response/error docs.
  • Verify against the code; fix mismatches.
✓
Done when
API docs match the actual behaviour of the endpoint.
✗
Watch out
Docs that describe intended, not actual, behaviour.

Discuss with your facilitator: where did the docs and the code disagree — and which was wrong?

Advanced · Open challenge Project: Leave Management System
Write (and wire up) a technical doc

Objective: create a technical doc for a subsystem and add the durable facts to CLAUDE.md / docs so future sessions inherit them.

✓
Done when
A technical doc exists and CLAUDE.md/docs carry the durable facts.
✗
Watch out
A one-off doc that no future session will ever read.

Discuss with your facilitator: what did you add to CLAUDE.md so the next session starts smarter?