Bootcamp — 2 · Context Engineering
BOOTCAMP — 2 · Context Engineering

Context Engineering

Prompting is what you say in the moment; context engineering is what Claude already knows when you say it. Organise the project so every session starts with the right context — cheaply — instead of re-explaining it each time.

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

Context is the window Claude reasons over

Everything Claude can "see" in a session — your files, the CLAUDE.md, the conversation so far — is its context window. It has no memory of your project between sessions: every new chat starts blank.

Foundation made the case that context is the whole game. This stage is the engineering: deciding what goes into the window, where it lives, and how to keep sessions small enough that Claude stays focused. The failure mode is the opposite of too little context — a single sprawling session where early instructions drift out of attention, tokens burn on re-reading, and answers get vaguer as the chat grows.

The reframe: you are not "chatting with an AI" — you are curating the information a fast junior sees before it acts. Good curation beats a longer prompt every time.

02 — the technique

Organise the project so context is cheap

Four places hold your context so you never re-type it — and one habit keeps each session sharp.

✓
CLAUDE.md — the standing brief
Stack, structure, and rules the agent reads every session. Building Blocks → Claude.md.
✓
docs/ — durable knowledge
API contracts, flows, decisions that outlive a chat. Backend → Docs Folder.
✓
Memory — facts across sessions
Preferences and project facts Claude should carry forward. Backend → Memory System.
✓
Token economy — spend on the work
Point at files, keep scope narrow, start fresh when full. Backend → Token Economy.

The habit that ties them together: run multiple focused sessions instead of one giant one. One session plans, another builds one slice, another writes tests. Between them, a short written hand-off (or a note in docs/) carries the thread — see the QA team's Context Manager for a repeatable briefing pattern.

03 — worked example (Leave Management)

A context layout that makes a cold session productive

For the Leave app, the context lives in the repo — not in a chat. A fresh session reads this and is ready to work in one prompt.

repo layout
leave-app/
  CLAUDE.md            # standing brief: stack, structure, 5 rules
  docs/
    api.md             # endpoint contracts (request/response/errors)
    decisions.md       # why: 5433 port, balance rules, JWT mocked in dev
    handoff.md         # rolling "where we left off" note between sessions
  src/leave/ …
docs/handoff.md
## Session hand-off — 2026-07-22
DONE: POST /leave-requests (validation + service). Tests green.
NEXT: balance check in leaveService.createRequest (reject if
      requested days > remaining balance). See docs/decisions.md#balance.
OPEN: overlap-detection rule still unconfirmed — ask PM.

Now do this on YOUR project: create a docs/handoff.md and end your next session by writing three lines — DONE, NEXT, OPEN. The following session starts from it instead of from scratch.

04 — best practices

Curate context deliberately

The difference between a session that flies and one that flails is almost always context hygiene.

✓
/clear between unrelated tasks
Starting a fresh context prevents earlier tool calls and failed corrections from poisoning unrelated work downstream.
✓
Isolate exploration in subagents
Dispatch a subagent to investigate; only its summary returns to the main context — keeps the main window tight and navigable.
✗
Correct the same mistake twice
After two failed corrections, /clear and rewrite the prompt from scratch — the failed attempts are now context pollution.
✗
CLAUDE.md as a catch-all
Every unnecessary line in CLAUDE.md dilutes the signal; move situational domain knowledge into skills that load on demand.
Check your understanding
1. You've been in one Claude session for two hours and its answers are getting vaguer. What's the best move?
Correct.Not quite — the correct answer is highlighted above.
2. Which piece of information does NOT belong in the chat, but on disk (CLAUDE.md / docs / memory)?
Correct.Not quite — the correct answer is highlighted above.
3. Why prefer several focused sessions over one long one?
Correct.Not quite — the correct answer is highlighted above.
Basic · Guided Project: Leave Management System
Move repeated context out of the chat

Objective: find something you keep re-explaining and promote it into CLAUDE.md, then prove a cold session picks it up.

prompt
Read CLAUDE.md, then scaffold the next endpoint for this project.
Do not ask me about the stack or folder layout — it's all in CLAUDE.md.
  • Identify one background blob you paste often (stack, conventions, folder map).
  • Move it into CLAUDE.md (or a docs/ file) and delete it from your prompt.
  • Open a fresh session, run the prompt above, and confirm it works without re-explaining.
✓
Done when
A brand-new session produces correct work with no stack/setup questions.
✗
Watch out
If the session still asks about the stack, the CLAUDE.md entry is too vague — tighten it.

Discuss with your facilitator: what did you move, and how much shorter did your prompts get afterwards?

Intermediate · Semi-guided Project: Leave Management System
Split one bloated session into a multi-session flow

Objective: take a task you'd normally do in one long chat and run it as plan → build → test across separate sessions, connected by a written hand-off.

  • Session 1 — plan only: produce the steps and write them to docs/handoff.md.
  • Session 2 — build one slice from the hand-off, then update DONE / NEXT / OPEN.
  • Session 3 — write tests, reading only the hand-off + the file under test.
✓
Done when
Each session started warm from the hand-off — you never re-explained the whole task.
✗
Watch out
A hand-off so thin the next session has to re-discover context — capture DONE/NEXT/OPEN.

Discuss with your facilitator: which session benefited most from a clean, small context — and why?

Advanced · Open challenge Project: Leave Management System
Design your project's context layout

Objective: lay out CLAUDE.md + docs/ + memory so any teammate's cold session is productive in a single prompt — no tribal knowledge required.

  • Decide what belongs in CLAUDE.md vs docs/ vs memory, and write it down.
  • Have a teammate (or a fresh profile) start cold and complete one small task.
✓
Done when
Someone who has never seen the project ships a small change from your context alone.
✗
Watch out
Duplicating the same fact in three places — pick one home for each piece of context.

Discuss with your facilitator: where did the cold session stumble, and which doc closed the gap? (Preview of competency 10, Team Workflow.)