Context Engineering: How to Teach AI Your Project
TL;DR: Context Engineering is the skill of delivering the right information to AI at the right time. It covers CLAUDE.md files, skills, system messages, MCP servers, and subagents. Most quality problems with AI output come not from the model but from poor context. A well-engineered context turns Claude Code into a senior teammate who knows your codebase.
TL;DR
Context engineering is the skill of giving AI the right information at the right moment. It covers CLAUDE.md files, skills, system memory, project documentation and PRDs. This competence is what separates "vibe coding" from production work with AI. In practice it is the foundation of effective collaboration with Claude Code in any project.
Key concepts
What context engineering is
Context engineering is the term the hosts use for the whole process of "teaching" an AI agent about the project, the company and the rules of collaboration. It is not about a single prompt. It is about building a whole ecosystem of knowledge.
"Let us focus on what it was always really about: delivering value to the end user. Through the successive stages of delivering that value we will get to know this artificial intelligence."
"Claude Code does not work freestyle. It relies on some rules, principles, some framework."
CLAUDE.md: the project constitution
The CLAUDE.md file (or the .claude/ folder) is the main configuration file that Claude Code loads automatically when a session starts. It contains:
- A description of the project and its goals
- The technology stack
- Coding conventions
- Constraints and rules
- Links to documentation
One of the videos showed how OpenSpec automatically detects a CLAUDE.md file and adapts its commands to it.
System memory and assistants
The configuration of a "Head of Product" assistant:
"It is based mainly on a system prompt, on the instruction I gave it. I arrived at that instruction by first having a fairly long discussion with Claude about my principles of product work."
How it works:
- You have a long conversation with Claude about your working principles
- Claude generates a system prompt out of it
- That prompt powers the assistant
- Claude has "memory": it remembers context from ongoing discussions
"While editing its memory I wrote 'GOG is no longer part of CD Projekt Group', and Claude already remembers that and actually takes it into account in our debates."
Skills (slash commands): repeatable prompts
Skills are saved prompts with context, launched with the /skill-name command. They are the equivalent of Custom GPTs or Gems in Gemini, but stored as files.
"Skills are the so-called slash commands. They are nothing more than your own abilities, or ones downloaded from a marketplace, that extend Claude. Repeatable prompts."
Example of a competitor research skill:
- Input: a description of the problem
- Process: web search, verification of claims, prioritization of sources
- A defined list of competitors
- A specified output format
Metaprompting: prompts that create prompts
An advanced technique shown by one of the hosts:
"You are an experienced product manager and prompt engineer. Your goal is to create a prompt for writing PRDs. Spawn three subagents and make them work on three unique prompts."
The process:
- You ask Claude Code to create three different prompts (through subagents)
- Each subagent works in an isolated context
- You ask for an analysis of the strengths and weaknesses of each prompt
- Claude builds a "super prompt" by combining the best elements
"This is useful when we are solving a non-obvious problem with AI. We know a magic prompt probably exists, and we do not really want to build it by hand."
WebFetch: an agent that teaches itself
Claude Code can fetch documentation and learn from it on its own:
"Go to that page yourself, learn how skills are created in your case, because I have no idea. Then summarize it all in a file called skill creation guidelines."
This pattern, "let the agent read the manual itself", is a key change of mindset:
"The new mindset is that we look for the instructions and tell the agent: 'Look, here are the instructions, you can handle it.'"
The /clear command: context hygiene
"There is an important command in Claude Code, 'clear', which we recommend using every time you finish a task. Why? To clear the context window."
"We do not want individual tasks to get mixed up in Claude's head. We want it to do one thing and forget about it."
You can check context usage with the /context command.
"AI asks instead of answering": ask_user_question
"The mere fact that AI does not give you an answer but asks you something and collects preparatory context for a target task, a lot of people react with surprise when they see that."
"When you design prompts, it is worth asking the model to ask you questions through 'ask user question'. It completely changes how you work."
Practical advice: always include an instruction in your prompts like "Before you start implementing, ask me about everything you do not know."
Obsidian as a knowledge base
"Obsidian is simply a tool for managing many Markdown files, it creates a knowledge graph. LLMs work very well with this tool."
One of the hosts does not use it himself: "I always manage context very sparingly and precisely, so I have no need to build a giant vault of data."
Subagents: a team of virtual assistants
Claude Code can spawn subagents for parallel work:
"Through the subagent feature we no longer work with one virtual helper but with three, or we work with a manager of virtual co-workers."
"Each one has an isolated context, their work does not mix, and later the orchestrator can do some work on top of it."
In one demo two Claude Code instances ran in separate terminals: one as the "architect" (asking questions about the PRD), the other as the "provider" (answering as a domain expert). Together they built a PRD automatically.
How to implement it
- Create a CLAUDE.md template for each type of project the team runs (e-commerce, SaaS, landing page)
- Define a set of company skills:
/bee-research(competitor analysis),/bee-prd(PRD writing),/bee-seo-audit - Apply the "AI asks before implementing" pattern in all skills (ask_user_question)
- Prepare "skill creation guidelines": how to create new skills in the company
- Use metaprompting to build optimal prompts for repeatable tasks (UX audit, GA4 data analysis, feature proposals)
- Keep a company skill library in a Git repository, so everyone can add and use them
- Teach the team to run
/clearafter every finished task
Tools and commands
Structure of context files
project/
|-- CLAUDE.md # Main project configuration
|-- .claude/
| |-- settings.json # Claude Code settings
| `-- skills/
| |-- research.md # Research skill
| |-- prd.md # PRD skill
| `-- testing-guide.md # Testing skill
|-- ai/
| |-- prd/
| | `-- prd-final.md # PRD document
| |-- roadmap.md # Project roadmap
| `-- competitive-research.md # Research report
`-- src/
`-- ...
Example CLAUDE.md
# Project: [name]
## Technology stack
- Frontend: Astro + React
- Backend: Supabase
- Hosting: Vercel
- CMS: Sanity
## Conventions
- We use TypeScript strict mode
- Components live in src/components/
- Tests live in __tests__/ next to the components
- Naming: kebab-case for files, PascalCase for components
## Working rules
- Always ask before you start implementing
- Do not modify configuration files without asking
- Write tests for every new feature
- Commit small, atomic changes
## Documentation
- PRD: ai/prd/prd-final.md
- Roadmap: ai/roadmap.md
Creating a skill
# /skill-name
## Context
You are [role]. You work in the context of [project/company].
## Input
The user will provide: [what we expect]
## Process
1. [Step 1, e.g. web search]
2. [Step 2, e.g. source verification]
3. [Step 3, e.g. analysis]
## Questions for the user
Before you start, ask questions through ask_user_question:
- [Question 1]
- [Question 2]
## Output format
[Description of the expected format]
Metaprompting: an example
You are an experienced [role] and prompt engineer.
Your goal is to create a prompt for [task].
Requirements for the prompt:
- [requirement 1]
- [requirement 2]
- The prompt should include a conversational mode (questions for the user)
Spawn three subagents and make them work on three unique prompts.
Save the results in the ai/prompts/ folder.
Teaching Claude Code a new skill
Go to [URL of documentation in Markdown format].
Read the instructions.
Summarize everything in the file ai/guidelines/[name].md.
Then use these guidelines to create a new global skill.
Related topics
- Claude Code: Complete Beginner's Guide: installation and first steps
- MCP Servers: MCP as a way of extending context
- Spec-Driven Development: PRDs and specifications as context for implementation