How to Build a Personal Context Layer with Claude, Codex, and Obsidian
A practical framework for using folders, Markdown, per-project agent contracts, and Obsidian as a durable local context layer.
Most people still use AI like a chat utility. They open a window, paste some material, get an answer back, and move on.
That works for one-off tasks. It is thin support for work that needs to stay organized, reviewed later, or handed back to the same model a week from now.
A more durable pattern is to keep the working context in a folder you own: notes, briefs, transcripts, source files, drafts, templates, and outputs, with an agent working on top of that structure. This is close to what Simon Willison calls context engineering: the useful work is not only prompt wording, but assembling the right instructions, state, tools, and history around the model.
Treat the file system as the source of truth
Each client, project, workstream, or research area gets its own folder. The folder becomes the workspace. The chat thread becomes one interface into it, not the place where the work lives.
When the files live locally, you keep ownership of the material and the structure around it. You can inspect the source notes, rename them, version them, archive them, or hand them to a different model without rebuilding the context from scratch.
This is where the current tool stack is already pointing. OpenAI documents Codex and project instruction files for local work, while Anthropic documents user and project settings, hooks, subagents, and MCP as the way Claude Code carries local rules and tool access into work. Obsidian fits the same pattern because it works on normal Markdown files and folders instead of a proprietary backend.
Keep the architecture simple
Start with one parent context folder and a small set of child folders underneath it. The parent layer handles cross-cutting work. The child folders handle domain-specific work.
- Clients/Client-A
- Clients/Client-B
- Projects/Context-Layer-Playbook
- Research/AI-Infra
- Personal/Daily-Briefs
Each child folder should have its own local contract. In Codex that is usually AGENTS.md. In Claude Code the same role can be split across project settings, hooks, subagents, and connected tools. The important part is not the file name. The important part is that each folder carries its own rules, summaries, and conventions with it.
The parent layer should stay narrow. It can roll up weekly status, compile monthly summaries, surface open actions, keep naming rules consistent, and route new material into the right child folder. It should not try to own every local decision inside every project.
Make Markdown the working format
For most intermediate work, Markdown is the best default. It is readable in any editor, easy to diff, easy to search, and easy for agents to rewrite safely.
That makes it a good home for meeting notes, daily briefs, research summaries, action logs, working outlines, dashboards, and recurring reports. A lot of knowledge work does not need to start in Word or PowerPoint. It can stay in Markdown until there is a real delivery reason to export it.
Obsidian is useful here because it can work directly on an existing folder of notes, stores notes as normal files, supports internal links with automatic link updates on rename, and uses properties in frontmatter when you need light structure. That is enough to give the folder a usable interface without making Obsidian the system of record.
Eric J. Ma has written about arriving at a similar place from the knowledge-management side: once the notes are already plain text and local, agent workflows stop feeling bolted on and start feeling native to the material itself.
Use the contract for operations, not philosophy
A project contract should be operational. It should tell the agent what the folder is for and how to behave inside it.
- what the folder covers
- which language and tone to use
- how to name files
- where transcripts, briefs, notes, and raw inputs go
- which summaries or dashboards should stay current
- which outputs should be generated regularly
- what should never be modified without confirmation
A simple child folder can stay plain.
- AGENTS.md
- 00_inbox/
- 01_briefs/
- 02_meetings/
- 03_research/
- 04_deliverables/
- 05_templates/
- 06_data/
- 07_archive/
- dashboard.md
- project_summary.md
Once that scaffold exists, the agent can do real maintenance work inside the folder: rename files, summarize calls, extract actions, update dashboards, and draft deliverables against the right template.
Design intake before you design automation
A context layer goes stale when new material enters too slowly or lands in the wrong place.
There are three reliable intake paths.
- manual save into the right folder
- pasted material that the agent classifies and saves
- connected retrieval through hooks, MCP servers, or app connectors
The important part is that new inputs do not stay marooned in chat or inboxes. They need to land in the project folder, get renamed, get summarized, and show up in the notes and rollups that people actually use.
A practical starting workflow
- Create one root folder with a small number of top-level buckets such as Clients, Projects, Research, Personal, and Orchestrator.
- Pick one child folder. Do not start with your whole digital life.
- Use the Context Layer Generator to create the kickoff prompt for that folder.
- Paste that prompt into Claude Code or Codex and have the agent inspect what is already there, create the local contract, build the folder structure, define note templates, and populate the first dashboard or summary notes.
- Make Markdown the working format for notes, briefs, summaries, and logs.
- Open the same folder in Obsidian so the notes, links, and properties become easy to browse.
- Add the parent orchestrator only after two or three child folders are already stable.
What to avoid
- a single giant contract that tries to govern every domain of work
- a workflow that treats chat history as the main memory layer
- early jumps to databases or custom apps before the folders are doing useful work
- pushing every file type through the same process
- automations that ingest material without leaving clean files behind
The goal is not to build an elaborate second brain. The goal is to keep active work in a structure that both you and the agent can read, maintain, and reuse.
Sources
- Simon Willison on context engineering
- OpenAI on Codex and project instruction files
- OpenAI on using Codex in local workflows
- Anthropic on Claude Code settings
- Anthropic on Claude Code hooks
- Anthropic on Claude Code subagents
- Anthropic on Claude Code MCP
- Obsidian on how it stores data
- Obsidian on internal links
- Obsidian on properties
- Eric J. Ma on plain-text notes, Obsidian, and agentic writing workflows
Keep Up
Get the next guide by email
Practical notes, frameworks, and new tools from applied AI work. Occasional only.
Related entries
A Practical Guide to Entity Resolution
A general guide to matching messy records into governed entities, with blocking, scoring, selective review, clustering, survivorship, and evidence-first reference tables.
A Context Layer for Teams
Most teams already have the raw material for a context layer in Drive, Slack, and scattered transcripts; the hard part is turning that sprawl into a shared record that people and agents can use without rebuilding the history each time.
What TurboQuant Is and Why It Matters
Google’s new TurboQuant method compresses key-value cache and search vectors more aggressively by cutting quantization overhead, which could make long-context inference and retrieval cheaper and faster.