Claude Code and Codex:
set up your client workspace right.
How to structure folders, instruction files and sessions so your AI agent knows each client from the first message.
Understand it. Build it with the agent. Use it daily.
The concept
What Claude Code and Codex are, and why a structured folder of instruction files beats a long prompt.
Build it with the agent
Copy-paste prompts that make Claude or Codex interview you and write your AGENTS.md, CLAUDE.md and MEMORY.md.
Work in sessions
Start, hand off and resume work so nothing is lost between days.
The concept
What these tools are, and the folder of files that makes them know your client.
Two coding agents. Same idea underneath.
Both read your files, run commands and make edits inside the folder you open them in. Both take standing instructions from a Markdown file.
| Claude Code | Codex | |
|---|---|---|
| Made by | Anthropic | OpenAI |
| Where it runs | Terminal, VS Code, desktop and web | Terminal, VS Code, desktop and web |
| Start it | claude inside your folder | codex inside your folder |
| Instruction file | CLAUDE.md | AGENTS.md |
| Create a starter file | /init | /init |
| Pick up yesterday's chat | claude --continue or claude --resume | codex resume |
Every session starts with zero memory.
Your files are its memory.
The agent does not remember your client, your rules or last Tuesday. It reads the instruction files in the folder you open. Good structure beats a long prompt, every single time.
One source of truth for both tools.
The real instructions. Codex reads it automatically, and it is the shared standard many other agents follow too.
One line that imports AGENTS.md, so Claude Code reads the exact same rules.
You maintain one file. Switch tools and nothing gets out of sync.
# Claude Code reads this file automatically. # The @ line pulls in the shared instructions. @AGENTS.md
# Acme Roofing: client instructions ## Who they are Residential roofing, Dallas TX. POC: Dana (Ops). ## Rules for every task here - Draft only. I send. Nothing goes to the client. - Never put passwords or API keys in any file. - Flag anything uncertain as [VERIFY].
Four layers, from broad to specific.
The agent reads every layer from where you started it up to the top. The closer file is more specific, so it wins on detail.
~/.codex/AGENTS.md
nurture-build/AGENTS.md
ug-workspace/ ├── AGENTS.md # layer 2: rules for all clients ├── CLAUDE.md # @AGENTS.md ├── _templates/ # copy these for every new client │ ├── client-AGENTS.md │ └── project-AGENTS.md └── clients/ └── acme-roofing/ ├── AGENTS.md # layer 3: the client brief ├── CLAUDE.md # @AGENTS.md ├── context/ # brand, people, offers, SOPs ├── projects/ │ └── 2026-10-nurture-build/ │ ├── AGENTS.md # layer 4: the job ticket │ ├── CLAUDE.md │ ├── PLAN.md # the approved plan │ ├── SESSION.md # where we stopped │ └── output/ └── archive/
One home for every client.
- One folder per client. Never mix two clients in one folder.
- One folder per project inside it, dated so they sort in order.
context/holds reference material the agent can read when needed._templates/means a new client takes five minutes, not an hour.
Each file has one job.
| File | Its job | Who updates it, and when |
|---|---|---|
AGENTS.md | Standing rules and facts that rarely change | You, when a rule or fact changes |
PLAN.md | The approved plan for this project | The agent drafts, you approve before any build |
SESSION.md | Where we stopped: Confirmed, Next, Do not yet | The agent, at the end of every session |
MEMORY.md | Lessons and gotchas learned about this client | The agent when it learns something, you review |
context/ | Reference material: brand, offers, SOPs, exports | You, as material arrives |
output/ | Everything the agent produces | The agent. Nothing leaves until you read it. |
Rules go in AGENTS.md. Lessons go in MEMORY.md.
How to work here. Written on day one, changes rarely. "Draft only. Mark approves customer copy."
What we learned along the way. Grows every week. "The CRM rejects phone numbers without +1."
Neither tool opens MEMORY.md on its own. One line in AGENTS.md tells it to.
# Acme Roofing: memory ## Decisions - 2026-10-02: Weekly report goes out Fridays, not Mondays - 2026-10-07: Dana approved the nurture copy ## Lessons and gotchas - Phone numbers must start with +1 or the CRM rejects them - Mark is on site Tuesdays, so expect slow replies ## Preferences we learned - Dana wants the summary first, details after # And in AGENTS.md: Read MEMORY.md before every task.
# Acme Roofing ## Snapshot Residential roofing and gutters, Dallas TX. My role: CRM and automation VA. POC: Dana (Ops). Client timezone: America/Chicago. ## People - Dana, Ops lead. Wants bullets, not paragraphs. - Mark, owner. Approves anything customer-facing. ## Tools and accounts - CRM: GoHighLevel, location id in context/accounts.md - Logins: in the password manager. Never here. ## Voice Warm, direct, no emojis, no em dashes. ## Standing rules - Draft only. Mark approves customer copy. - Mark unclear names, dates, amounts as [VERIFY].
The brief you wish every client sent you.
- Business snapshot and your role
- Who is who, and how each likes to receive things
- Tools used, with IDs but never passwords
- Voice, formatting and approval rules
"Read AGENTS.md. Tell me in five bullets who this client is and the two rules I must never break."
The job ticket the agent cannot drift from.
Scope written down is scope the agent respects. Out of scope written down is even more important.
One sentence. What done looks like.
In and out, as two lists.
Locked choices, with the date.
Checks that prove it works.
# Project: new-lead SMS and email nurture ## Goal New web leads get a 5-day follow-up sequence. ## In scope - 3 SMS + 3 emails, one workflow ## Out of scope - Ads, website changes, old leads ## Locked decisions - 2026-10-07: Dana approved the copy in PLAN.md - 2026-10-08: Sends stop when a lead books ## Done when - Test contact receives every message in order - Booking a call stops the sequence ## Status See SESSION.md for where we stopped.
Build it with the agent
You do not write these files from scratch. You prompt Claude or Codex to interview you and draft them, then you review.
Let the agent interview you. You stay the editor.
An empty folder for your workspace. Open the terminal there.
Type claude or codex.
The prompts on the next slides. Fill in the brackets.
It asks one at a time. Short answers are fine.
Read the draft. Correct it. Approve the file.
You know the client. The agent knows how to structure a file. Asking questions one at a time means nothing important is left out, and you never stare at a blank page.
A short interview, then a draft.
An example of the conversation. Ten to fifteen minutes per client is normal.
clients/acme-roofing/AGENTS.md. Two items are marked [VERIFY]. Shall I save it?Set up your workspace.
Run this in an empty folder. It builds the skeleton and your personal rules.
AGENTS.mdwith your working rulesCLAUDE.mdthat points to itclients/and_templates/folders
I am a Unique Genius Strategic Partner. Set up my
AI workspace in this folder.
1. Interview me first, one question at a time,
max 8 questions: my role, my timezone, my
clients' hours, my writing style, and what
you must never do.
2. Write AGENTS.md with my working rules and a
folder map: clients/[client]/projects/.
3. Create CLAUDE.md containing only: @AGENTS.md
4. Create clients/ and _templates/ with a
client-AGENTS.md and project-AGENTS.md that
contain headings only.
Show me each file before you save it.
Create a client file by interview.
Run this from the workspace folder. Swap in your client name.
clients/[client]/AGENTS.md, the client brief- Its
CLAUDE.mdpointer - [VERIFY] tags on anything you were unsure of
Help me create the client file for [Client name].
Interview me one question at a time, max 12:
what they do, my role, who is who and how each
likes updates, tools we use, voice and format
rules, what needs approval, and what to never do.
Then create clients/[client-name]/ with:
- AGENTS.md, using _templates/client-AGENTS.md
- CLAUDE.md containing only: @AGENTS.md
Rules: never write passwords, API keys or ID
numbers. If I give you one, refuse and remind me.
Mark anything I was unsure about as [VERIFY].
Keep AGENTS.md under 80 lines.
Already have notes? Start from them.
Drop your onboarding notes, SOPs or the client brief into context/. The agent drafts from them and only asks about the gaps.
- A draft built from real material
- A list of questions only you can answer
- Fewer typos and missed details
Read every file in clients/[client-name]/context/.
Draft clients/[client-name]/AGENTS.md from them,
using _templates/client-AGENTS.md.
Then list what is still missing or unclear as
numbered questions. Ask me them one at a time and
update the draft as I answer.
Do not copy any passwords, card numbers or ID
numbers from the files. Tell me if you find any so
I can remove them.
Give the client a memory.
Creates the notebook and the rule that makes the agent use it.
MEMORY.mdwith three sections- A rule in AGENTS.md to read it every time
- The agent proposes new lessons, you approve
In clients/[client-name]/, create MEMORY.md with
three sections:
- Decisions (each line dated YYYY-MM-DD)
- Lessons and gotchas
- Preferences we learned
Then add this to that client's AGENTS.md:
"Read MEMORY.md before every task. When we learn
something that will matter next time, propose one
line for MEMORY.md and wait for my OK before
adding it."
Show me both changes before saving.
Turn a task into a project folder.
Paste the task from ClickUp, Slack or email. The agent sets up the job ticket.
AGENTS.md: goal, scope, done whenPLAN.md: proposed steps, not startedSESSION.md: ready for the first handoff
New project for [client-name]. Here is the task:
[paste the task, message or email]
Create clients/[client-name]/projects/
[YYYY-MM-short-name]/ with:
- AGENTS.md: goal, in scope, out of scope and
done when, using _templates/project-AGENTS.md
- PLAN.md: your proposed steps
- SESSION.md: empty Confirmed, Next and
Do not yet sections
Ask me about anything unclear first.
Do not start the work itself.
Same pattern, whoever you work for.
Supporting clients
clients/ ├── acme-roofing/ │ ├── AGENTS.md MEMORY.md │ └── projects/ └── bright-dental/ ├── AGENTS.md MEMORY.md └── projects/
One folder per client. Never mix two clients.
Inside one company
areas/ ├── sales/ │ ├── AGENTS.md MEMORY.md │ └── projects/ └── operations/ ├── AGENTS.md MEMORY.md └── projects/
One folder per department or area. The company rules live in the top AGENTS.md.
Tip: in the prompts, swap "client" for "area" and the agent builds the company version.
The agent drafts. You sign off.
- Facts are right: names, roles, tools, timezones
- No secrets: no passwords, keys, card or ID numbers
- Rules are specific: "Bullets only, end of day" beats "be clear"
- Short: AGENTS.md under about 80 lines, the rest in
context/ - [VERIFY] items: confirmed with the client or removed
Read AGENTS.md and MEMORY.md.
In five bullets: who this client
is, who I report to, how they
like updates, and the two rules
I must never break.
Do not change any files.
Vague answer? The file is too thin. Add detail and ask again.
Work in sessions
The files are the memory. Sessions are the workdays. Here is how to start, pause and pick up without losing anything.
One conversation, one task, one folder.
It has a limit
A session can only hold so much. Very long ones get summarised and details fall out. Fresh sessions are sharper.
Start in the right place
Open the terminal inside the project folder, then start the agent. That is how all four layers load.
One task per session
New task, new session. Mixing a report, a workflow and an email in one chat is how clients get mixed up.
# Always start like this $ cd ug-workspace/clients/acme-roofing/projects/2026-10-nurture-build $ claude # or: codex
SESSION.md: three sections, every time.
Tomorrow's session, or a teammate, reads this first. No re-explaining, no repeated work.
Confirmed
What is done, with proof: file names, IDs, test results.
Next
The single next step. One line.
Do not yet
What must wait, and why. Protects you from a rushed restart.
Update SESSION.md with Confirmed (with
evidence), Next (one step) and Do not yet.
Keep it short.
$ claude --continue # last session here $ claude --resume # choose from a list $ codex resume # Codex equivalent
Seven steps, every task.
cd into the project folder, start the agent.
"Read AGENTS.md and SESSION.md. Where are we?"
Ask for a plan first. No edits yet.
You read it, correct it, say go.
The agent works. You approve each change.
Check the real result, not the summary.
Update SESSION.md. Close the session.
Step 4. An unapproved plan is how agents build the wrong thing fast. Claude Code has a plan mode for exactly this: press Shift+Tab to cycle into it.
Rules before tools.
- Passwords, API keys, login details
- Card or bank account numbers
- SSNs, tax IDs, government IDs
- Medical details with names attached
- Anything the client said to keep off AI
- Get the client's written OK before pointing AI at their data
- One client per folder, one client per session
- Keep approval prompts on. Read each change before you accept it
- Treat every output as a draft until you have checked it
- Note AI-assisted work honestly in your EOD
Six ways beginners lose a day.
Starting in the wrong folder
The agent sees no client file, so it guesses.
One giant AGENTS.md
Move reference material into context/ and link to it.
Rules only in the chat
If you said it twice, it belongs in a file.
Never ending a session
Long sessions get blurry. Hand off and start fresh.
Skipping SESSION.md
Tomorrow you repeat or undo yesterday's work.
Secrets in files
Use the password manager. Files can be shared, synced and read.
Build your workspace with the agent.
Use your real assigned client. No sensitive data, just the facts you already know.
- 1Make a folder called
ug-workspace, open the terminal in it, startclaudeorcodex. - 2Run Prompt 1 and answer the workspace questions.
- 3Run Prompt 2 for your client and review the draft.
- 4Run Prompt 3 to add MEMORY.md.
- 5Prove it. Start a new session in the client folder and run the five-bullet test.
Four prompts for every working day.
Read AGENTS.md and SESSION.md.
Tell me where we are and the next step.
Do not change any files yet.
Write a plan in PLAN.md for this task.
List what you will change and how we test it.
Wait for my approval.
Add this as a standing rule in the client
AGENTS.md: [rule]. Show me the edit.
Update SESSION.md: Confirmed (with evidence),
Next (one step), Do not yet. Keep it short.
Structure once.
Every session starts smart.
Questions?