When the AI already knows who you are, what the company rules are and what went wrong last time, your request fits on one line. You don't build this base in every conversation: it lives in a place the AI reads on its own before it starts. It's what separates repeating everything every time from having someone who already knows the work.
Goal: build the context base the agent reads before any request, with rules and a lesson from a real mistake.
01 · Where context comes from
Four sources the agent reads before your request. Tap or click each one.
Lesson 301 · Where context comes fromFour sources the agent reads before your request. Tap or click each one.
Each new mistake becomes a line in the lessons, and the base improves on its own with use
1/6
Rules
One file per project (AGENTS.md in Codex, CLAUDE.md in Claude Code, the project instructions in ChatGPT or Claude) with who you are, your audience, your tone, your tools and your boundaries. The agent reads it before it starts.
Scroll the page: each step below lights up its part of the diagram.
1/6
Rules
One file per project (AGENTS.md in Codex, CLAUDE.md in Claude Code, the project instructions in ChatGPT or Claude) with who you are, your audience, your tone, your tools and your boundaries. The agent reads it before it starts.
2/6
Lessons
Every time something goes wrong, add a new line at the top of the list: what happened and the rule that keeps it from happening again. In my case (Nei, from INEMA), it works like this: the same mistake doesn't come back, because the fix becomes a written rule.
3/6
History
What you've already decided with the AI shouldn't be asked again. In the chat, turn on ChatGPT or Claude memory in the settings and keep the topic inside the same project. In the terminal, save the session logs in a folder the agent can search.
4/6
Files
The real documents and spreadsheets: in the chat, the files uploaded to the project; in the terminal, the folder or repository the agent opens. It uses the original instead of your memory-based summary.
5/6
Agent
With the four sources in place, the request gets short, and the agent understands where it came from and why. You don't build the context from scratch every time.
6/6
The whole base
Rules, lessons, history and files reach the agent before the request. Each mistake becomes a lesson, and the next task already starts better.
Good context has a home of its own: it lives in a file or folder, not in the text of the request.
02 · Build the base in four steps
Start small. Tap or click each step.
1. Choose a home
In the chat: create a project (ChatGPT or Claude) or a Gem (Gemini), write the rules in its instructions and upload the reference files.
In the terminal, with Claude Code or Codex (agents that work in a folder on your computer), the rules go in a file in the folder called AGENTS.md or CLAUDE.md. That's just the name of the rules file.
ExampleA project called "School communication" with its own instructions.
2. Rules
Start with five rules: who you are, who the work is for, the tone, the tool and one boundary.
A good rule is checkable: you can look at the result and say whether it was followed.
Checkable ruleEvery announcement states the date the change starts.
3. Lessons
When the AI gets something wrong, don't just fix that one answer: write the lesson at the top of the list, with the date.
One line: what happened and the rule that prevents it.
LessonAnnouncement went out without the start date: every change states the day it starts. (10/24)
4. Test
Open a new chat, make a short request, and see whether the rule and the lesson were followed without you reminding it.
If they weren't, the rule is buried or vague: move it to the top and word it so it can be checked.
Short requestWrite the notice for the holiday party.
03 · Templates to copy
Replace the text between < > with your own.
Project rules (instructions in the chat, or AGENTS.md in the terminal)
# Who I am
<your name, what you do, who you work for>
# Who the work is for
<the audience, in one sentence>
# Rules
- Write in English, short sentences.
- <checkable rule 2>
- <checkable rule 3>
- Before you finish, tell me what changed and how I can check it.
- Boundary: <what must never happen>
# Where the rest is
- References: the files uploaded to the project (in the terminal, the references/ folder)
# Lessons (newest on top)
- <date> · <what went wrong> → <the rule that prevents it>
Request for when the AI gets it wrong
You got this wrong: <what happened>.
Before fixing it, write the lesson in ONE line, in this format:
<date> · <what went wrong> → <the rule that prevents it>.
Then redo the work following the new rule and show me both.
First line of every task
Read the project's rules and lessons before you start. If anything I ask goes against a rule, tell me before you do it.
Simulation: illustrative example
In the chat: the AI writes the line; you copy it and paste it at the top of the Lessons section in the project instructions.
In the terminal: ask it to save the line in AGENTS.md (or CLAUDE.md) and check the file.
The rules file exists and has at least five rules of your own.
There is at least one lesson taken from a real mistake, with a date.
In a new chat, a one-line request came out following the rule and the lesson.
Vague rule ("be professional"): no one can check it. Write what can be seen in the result.
Fixing only the answer: the mistake comes back tomorrow. The fix has to become a written lesson.
Password or key in the rules file: anything in plain text can leak. Keep keys out.
04 · Practice: your context base
Pick a subject where you use AI every week.
S1 · The home and the rules
20 min
Create the project (in the chat) or the folder with AGENTS.md (in the terminal) and write the five rules from the template.
Done when: the file or the project instructions have five rules, and each one can be checked by looking at the result.
S2 · The first lesson
15 min
Ask for a task, find a mistake (there always is one), use the "when the AI gets it wrong" request, and paste the lesson into the project instructions (in the terminal, it saves it in AGENTS.md).
Done when: the Lessons section has a line with the date, the mistake, and the rule that prevents it.
S3 · The new-session test
10 min
Open a new chat and make a one-line request of the same kind.
Done when: the result followed the rule and the lesson without you repeating either one in the request.
05 · Test what you learned
The explanation appears after your answer.
Question 1 of 3
The AI forgot the date in the announcement. What can you do so the mistake doesn't come back?skill
Correct
Fixing only the answer solves it today. The written lesson goes into the context of every later task, and the same mistake doesn't come back.
Not that one
Fixing only the answer solves it today. The written lesson goes into the context of every later task, and the same mistake doesn't come back.Review: Build the base in four steps
Question 2 of 3
Which of these is a checkable rule?
Correct
You can look at the announcement and tell whether the date is there. Nobody can check "professional" or "quality."
Not that one
You can look at the announcement and tell whether the date is there. Nobody can check "professional" or "quality."Review: Build the base in four steps
Question 3 of 3
Why should the context have a "home of its own"?
Correct
In a file or in the project instructions, the context arrives before every request. Repeated in the request, it disappears in the next conversation.
Not that one
In a file or in the project instructions, the context arrives before every request. Repeated in the request, it disappears in the next conversation.Review: Where context comes from
Quiz complete
You got {a} of {n} right. If you get them all right, the lesson is marked as completed.
Choose an answer. The explanation appears after you try.
06 · The lesson in three sentences
Four sourcesProject rules, lessons, history and files reach the agent before the request.
A mistake becomes a lessonEvery correction becomes one written line, and the same mistake doesn't come back.
Test in a new sessionThe base works when a one-line request already comes out right.