LearnThatStack Ace your next interview
AI-Assisted Development

Context Engineering.

Start free Change topic Change

Practise Context Engineering one question at a time. Answer out loud or in writing, get graded, and see exactly what you missed.

Try one question

What is context engineering, and how does it differ from prompt engineering?

The answer

Context engineering designs everything a model receives during a task, whereas prompt engineering focuses on the words in one request. Context can include instructions, conversation history and summaries. It can also include source files, tests and documentation. Tool results can land there too.

A strong prompt cannot fix missing or misleading context. If the model cannot see the current interface or a project rule, it must guess. Context engineering puts the right information in front of the model at the right time, and removes noise that could distract the model.

Context engineering also decides how context is retrieved, ordered and kept current. It covers what carries over between sessions too. Prompt writing is one part of the larger job of building a reliable information environment for the assistant.

Example · what grading looks like
What are instruction files such as CLAUDE.md or AGENTS.md, and what problem do they solve?

“Basically they're a README written for the AI. You put a CLAUDE.md or an AGENTS.md at the root of the repo with the things the assistant would otherwise have to guess, or that I'd keep retyping: how to build and run the tests, where things live, and the conventions we follow, like using our own logger instead of console.log. The tool picks the file up on its own at the start of every session, so each conversation starts from the same baseline instead of me pasting that context in every time. The thing I'd watch is size. It gets loaded on every request, so I keep it short, and for anything long I link to the existing docs instead of copying them into the file.”

Knew it

They have the core idea: a repo-root file the assistant loads automatically so setup, conventions and build/test steps don't get retyped each session. Missing: safety limits, definition of done, and never putting secrets in the file.

Missed: Didn't mention they also set safety limits and the expected definition of done

Missed: Didn't mention never putting secrets in these files


Get your own answers graded

Sign up free. Your account comes with 50 credits for grading, and it remembers what you missed.

What it covers

All 49 questions

Each on its own page

Context engineering foundations

What context engineering is, how it differs from prompt engineering, what a context window is and why managing it still matters as windows grow.

4 questions

  1. What is context engineering, and how does it differ from prompt engineering?
  2. What is a context window, and why does it matter when working with AI coding tools?
  3. Explain the "show, don't tell" prompt pattern for code tasks. Pro
  4. Context windows keep growing, so why does context management still matter? Pro

Instruction file basics

What instruction files like CLAUDE.md are for, what belongs in them, why they stay lean, and when guidance goes in rules, docs or the prompt instead.

4 questions

  1. What are instruction files such as CLAUDE.md or AGENTS.md, and what problem do they solve?
  2. What kinds of information belong in a project instruction file, and what should stay out?
  3. Why is it important to keep rules files lean?
  4. How do you decide whether guidance belongs in a rules file, project docs, or the prompt? Pro

Rules across tools and scopes

AGENTS.md, Cursor rules and Copilot instructions, layering by scope, resolving conflicts between layers, and keeping rules from going stale or drifting.

7 questions

  1. What is AGENTS.md, and how does it relate to tool-specific files like CLAUDE.md? Pro
  2. How do instruction files layer across global, project, and directory scope, and what belongs at each level? Pro
  3. How does Cursor's rules system work, and how does it differ from the legacy .cursorrules file? Pro
  4. How do you customize GitHub Copilot's behavior for a specific repository? Pro
  5. How do instruction files go stale, and how do you keep them trustworthy? Pro
  6. Instruction layers can conflict. How do you design precedence and hygiene so they do not fight? Pro
  7. Your team uses several AI tools with different instruction file formats. How do you avoid duplicated, drifting rules? Pro

AI-legible codebases

How READMEs, typed interfaces, module size, naming and tests make a repository easy for an agent to understand and change correctly.

5 questions

  1. What does it mean for a repository to be AI-legible?
  2. How does a good README help an AI coding assistant? Pro
  3. How do typed interfaces make a codebase easier for agents to work with? Pro
  4. How do module size and naming conventions affect agent effectiveness? Pro
  5. How can a test suite serve as documentation for agents, and what makes tests good context? Pro

Token budgets and caching

What consumes tokens in an agent session, how to audit and budget that use, and how prompt caching shapes the order of context.

3 questions

  1. In a typical coding agent session, what actually consumes context tokens?
  2. How do you audit and budget token consumption in an agent session? Pro
  3. How does prompt caching interact with how you arrange context? Pro

Long sessions, compaction and subagents

When to start a fresh session, how compaction works and fails, using subagents to keep the main context small, and keeping a long task coherent across sessions, summaries and agent handoffs.

6 questions

  1. When should you start a fresh session instead of continuing a long conversation with a coding agent? Pro
  2. What is context compaction, and what are its tradeoffs? Pro
  3. How do subagents help with context management? Pro
  4. What are common compaction failure modes, and how do you engineer around them? Pro
  5. How do you architect context handoffs in a multi-agent system? Pro
  6. How do you keep a long-horizon agent task coherent across multiple sessions and compactions? Pro

Code search and retrieval

Repo maps, grep versus semantic search, the cost of a semantic index, and staged retrieval for an agent in a large unfamiliar repository.

4 questions

  1. What is a repo map, and how does a tool like Aider use one? Pro
  2. Compare grep-based exploration with semantic code search for coding agents. Pro
  3. What are the tradeoffs of maintaining a semantic index of your codebase? Pro
  4. Design a retrieval approach for an agent dropped into a large unfamiliar repository. Pro

MCP, tools and skills

MCP servers, tool design without context bloat, current library docs and llms.txt, and packaging workflows as skills with progressive disclosure.

7 questions

  1. What is the Model Context Protocol (MCP), and why is it relevant to development workflows? Pro
  2. What is llms.txt, and how does it help agents consume documentation? Pro
  3. What are practical ways to give a coding agent access to up-to-date library documentation? Pro
  4. What kinds of MCP servers are most useful in day-to-day development? Pro
  5. What are custom commands and skills, and when should you create one? Pro
  6. What is progressive disclosure in agent context design, and how do skills implement it? Pro
  7. How does MCP tool design affect agent performance, and how do you prevent tool definitions from bloating context? Pro

Secrets and context security

Keeping secrets out of agent context, context poisoning, and prompt injection through instruction files, retrieved content and MCP servers.

4 questions

  1. Why must secrets never appear in instruction files or other agent context, and what belongs there instead? Pro
  2. What is context poisoning, and how does it show up in practice? Pro
  3. What does thorough secrets hygiene look like in an agentic workflow, beyond keeping keys out of rules files? Pro
  4. How are instruction files, retrieved content, and MCP servers an attack surface, and what mitigations exist? Pro

Governance and measuring impact

Managing shared context across teams and monorepos, evaluating whether context changes help, and prioritizing context investment by its return.

5 questions

  1. How should a team manage shared context files in version control? Pro
  2. What context strategies work best in a large monorepo? Pro
  3. Design a context governance model for a multi-team monorepo adopting coding agents at scale. Pro
  4. How would you build an evaluation harness to measure whether context changes help your agents? Pro
  5. An organization wants to invest seriously in context engineering. How do you prioritize efforts and measure return? Pro
Practice · Questions

All questions

Showing of 49
Beginner 13
01

What is context engineering, and how does it differ from prompt engineering?

Visual

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
Visual

Context engineering designs everything a model receives during a task, whereas prompt engineering focuses on the words in one request. Context can include instructions, conversation history and summaries. It can also include source files, tests and documentation. Tool results can land there too.

A strong prompt cannot fix missing or misleading context. If the model cannot see the current interface or a project rule, it must guess. Context engineering puts the right information in front of the model at the right time, and removes noise that could distract the model.

Context engineering also decides how context is retrieved, ordered and kept current. It covers what carries over between sessions too. Prompt writing is one part of the larger job of building a reliable information environment for the assistant.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

02

What are instruction files such as CLAUDE.md or AGENTS.md, and what problem do they solve?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Instruction files hold standing guidance for a coding assistant. They describe the repository layout, the build and test commands, and the coding conventions. They also set safety limits and the expected definition of done. Tools load them automatically at the project or directory scope.

They solve the problem of repeating stable facts in every prompt. Without them, each session may guess how to run tests or which helper to use.

Keep them short and specific, link to longer docs instead of copying them, and never put secrets in them.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

03

What kinds of information belong in a project instruction file, and what should stay out?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Put in stable facts that affect many tasks:

  • important directories
  • standard commands
  • architectural boundaries
  • naming rules
  • approved libraries
  • any dangerous action that needs approval

Add a short definition of done, such as running focused tests and reporting any failures.

  • Leave out secrets, credentials and customer data.
  • Leave out temporary task details and long tutorials too. Point to a trusted document instead of copying it.
  • Skip vague advice such as "write good code", because it gives the model nothing to act on.
  • Drop rules that tools or linters already enforce, unless the assistant needs them to choose an approach.

A useful file is a small map and policy guide, not a complete project handbook.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

04

What is a context window, and why does it matter when working with AI coding tools?

Visual

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
Visual

A context window is the amount of text and other tokenized information a model can consider in one request. It holds:

  • the prompt
  • the instructions
  • the prior conversation
  • source files
  • tool output
  • the model's own response

Every model has a limit. When the window fills, older content may be removed or summarized, and important details can be lost. Even before the limit, too much unrelated material can make the model overlook the right fact.

Give the assistant current, relevant sources instead of a repository dump. For long tasks, record decisions and progress in a compact handoff. Careful context selection improves accuracy, cost, and speed.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

05

In a typical coding agent session, what actually consumes context tokens?

Visual

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
Visual

Nearly everything the agent reads or writes consumes tokens:

  • Standing text: system and project instructions, and the tool definitions.
  • The conversation: your messages, earlier replies, and any summaries.
  • What the agent reads: source files, search results, and documentation.
  • What tools return: command output, error logs, and diffs.

Repeated content can be charged and processed again unless caching applies. Large test logs, generated files and broad searches fill the window fast without adding much value. Ask for focused output, open only the relevant file sections, and filter noisy command results.

Keep standing rules lean, because they appear in many requests. When a task changes direction, start a fresh session instead of carrying unrelated history. Watching tokens saves money, and it also keeps the model's attention on the evidence that matters.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

06

Why is it important to keep rules files lean?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Rules files are loaded often, so every unnecessary paragraph uses context on many requests. Long files also make important guidance harder to notice. Conflicting or overly detailed rules can cause the assistant to follow the wrong instruction, or to spend time reconciling advice that does not apply.

Keep only stable, high-impact facts that change how work should be done.

  • Use clear commands, short examples, and links to deeper documentation.
  • Move subsystem guidance into scoped files when the tool supports them.
  • Remove rules that a formatter, type checker, or test already enforces.
  • Review the file after repeated agent mistakes and after architecture changes.

Lean rules reduce cost, improve attention, and are easier for people to keep accurate.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

07

What does it mean for a repository to be AI-legible?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

An AI-legible repository makes its structure and intent easy for an assistant to discover. It has:

  • clear names
  • small focused modules
  • typed interfaces
  • current docs
  • reliable tests
  • standard commands

Important behavior is written down instead of living only in team memory.

In such a repository, an agent can find the owning module and inspect a nearby example. It can run one documented test command and understand what success means. Hidden setup and duplicate patterns force it to guess. Vague names and stale docs do the same.

Improve legibility by making boundaries explicit, removing dead code and documenting unusual decisions. Keep examples current. The goal is to make project knowledge visible and verifiable, which helps human developers too.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

08

How does a good README help an AI coding assistant?

Part of Pro
09

What is AGENTS.md, and how does it relate to tool-specific files like CLAUDE.md?

Part of Pro
10

When should you start a fresh session instead of continuing a long conversation with a coding agent?

Part of Pro
11

What is the Model Context Protocol (MCP), and why is it relevant to development workflows?

Part of Pro Visual
12

Why must secrets never appear in instruction files or other agent context, and what belongs there instead?

Part of Pro Visual
13

Explain the "show, don't tell" prompt pattern for code tasks.

Part of Pro Visual
Intermediate 20
14

How do instruction files layer across global, project, and directory scope, and what belongs at each level?

Part of Pro Visual
15

How does Cursor's rules system work, and how does it differ from the legacy .cursorrules file?

Part of Pro Visual
16

How do you customize GitHub Copilot's behavior for a specific repository?

Part of Pro
17

What is context compaction, and what are its tradeoffs?

Part of Pro Visual
18

How do subagents help with context management?

Part of Pro Visual
19

What is a repo map, and how does a tool like Aider use one?

Part of Pro Visual
20

Compare grep-based exploration with semantic code search for coding agents.

Part of Pro Visual
21

What is llms.txt, and how does it help agents consume documentation?

Part of Pro
22

What are practical ways to give a coding agent access to up-to-date library documentation?

Part of Pro
23

What kinds of MCP servers are most useful in day-to-day development?

Part of Pro
24

What are custom commands and skills, and when should you create one?

Part of Pro
25

How do typed interfaces make a codebase easier for agents to work with?

Part of Pro
26

How do module size and naming conventions affect agent effectiveness?

Part of Pro
27

What is context poisoning, and how does it show up in practice?

Part of Pro Visual
28

How do instruction files go stale, and how do you keep them trustworthy?

Part of Pro
29

How should a team manage shared context files in version control?

Part of Pro
30

How do you decide whether guidance belongs in a rules file, project docs, or the prompt?

Part of Pro
31

Context windows keep growing, so why does context management still matter?

Part of Pro
32

What is progressive disclosure in agent context design, and how do skills implement it?

Part of Pro Visual
33

How can a test suite serve as documentation for agents, and what makes tests good context?

Part of Pro
Expert 16
34

What context strategies work best in a large monorepo?

Part of Pro Visual
35

How do you audit and budget token consumption in an agent session?

Part of Pro
36

How does MCP tool design affect agent performance, and how do you prevent tool definitions from bloating context?

Part of Pro Visual
37

How does prompt caching interact with how you arrange context?

Part of Pro Visual
38

Instruction layers can conflict. How do you design precedence and hygiene so they do not fight?

Part of Pro Visual
39

What are the tradeoffs of maintaining a semantic index of your codebase?

Part of Pro
40

Design a retrieval approach for an agent dropped into a large unfamiliar repository.

Part of Pro
41

What does thorough secrets hygiene look like in an agentic workflow, beyond keeping keys out of rules files?

Part of Pro Visual
42

What are common compaction failure modes, and how do you engineer around them?

Part of Pro Visual
43

Your team uses several AI tools with different instruction file formats. How do you avoid duplicated, drifting rules?

Part of Pro Visual
44

Design a context governance model for a multi-team monorepo adopting coding agents at scale.

Part of Pro
45

How would you build an evaluation harness to measure whether context changes help your agents?

Part of Pro
46

How are instruction files, retrieved content, and MCP servers an attack surface, and what mitigations exist?

Part of Pro Visual
47

How do you architect context handoffs in a multi-agent system?

Part of Pro
48

How do you keep a long-horizon agent task coherent across multiple sessions and compactions?

Part of Pro Visual
49

An organization wants to invest seriously in context engineering. How do you prioritize efforts and measure return?

Part of Pro

No matches

Try a different filter or search term.

Know someone prepping for Context Engineering? Send them this set.
Quick recap

Context Engineering in pictures.

A quick recap of Context Engineering in 30 short animated pictures, one idea at a time. About 7 min to get the whole topic back in your head before you walk in. Pause any picture, slow it down, or step through it.

Pro The first chapter is free to play. The other 28 pictures come with Pro.

Get Pro · $10/mo
Pro · $10/mo

42 of 49 Context Engineering answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

Serverless on AWS

Serverless Architecture on AWS

Flutter Mobile

Flutter Cross-Platform Mobile Development

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

AI Engineer

LLMs, RAG, Agents, Evals

AI-Powered Developer

Claude Code, Copilot, Agentic Workflows

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git