Dex runs on Claude Code, Anthropic's AI assistant — a general-purpose agent that can read files, run tools, and hold a working conversation about your world. You can use Dex happily without ever thinking about this layer. But understanding it pays twice: you'll get more out of Dex, and you'll have learned — hands-on, through real work — how AI agents actually function. That fluency is becoming a career skill in its own right.
This page is the honest, jargon-minimal tour. (For an interactive version using your own last conversation as the example, run /xray inside Dex.)
The four ideas that explain almost everything
1. The AI forgets everything between conversations. Each session starts blank. There's no little database of "things it knows about you" inside the model. Everything Dex appears to remember, it re-reads from your files at the right moment. Once you know this, the golden rule follows: if it matters, make sure it's written down — say it in conversation and Dex will file it.
2. Every conversation has a budget. A session has a finite working memory — the "context window." Think of it as a desk: files, instructions, and conversation all take up space, and an overloaded desk makes for worse work. This is why Dex loads skills only when invoked, injects context about people only when relevant, and runs big jobs like the morning plan in a separate workspace. When a very long session starts feeling vague, that's the desk overflowing — starting a fresh one costs nothing, because memory lives in files, not the conversation.
3. Instructions shape everything. Before you type a word, the assistant reads its standing instructions — for Dex, that's CLAUDE.md plus your profile. This "system prompt" is why Dex behaves like Dex and not like a generic chatbot. It's also your leverage: change the instructions, change the behavior, permanently. That's all personalization is.
4. Tools turn talk into action. On its own, a language model can only produce text. Everything real — reading your calendar, creating a task, searching your notes — happens through tools the assistant is allowed to call. Dex's tools come from MCP servers (the open Model Context Protocol standard). The design principle worth internalizing: let AI decide, let deterministic tools execute. The AI chooses what task to create; a validated program guarantees the IDs, syncing, and bookkeeping are exact. When you see Dex ask permission before running something — that's the tool layer's safety model working as intended.
What happens when you hit Enter
The full loop, demystified:
- Your message joins the context — along with the standing instructions and whatever the hooks loaded.
- The model thinks and decides: answer directly, or use a tool first?
- Tools run — read the calendar, search the vault — and their results come back into the context.
- The model repeats until it can answer, then writes back to your files if anything changed.
That's the whole magic: text in, reasoning, tool calls, text out. Every AI agent you'll meet in the coming years — in any product — is a variation on this loop.
One message through the machine
-
01 Your message"what's slipping this week?" joins the context
-
02 Standing instructionsCLAUDE.md and your profile shape how it thinks
-
03 Tool callsreads Week_Priorities.md, scans open tasks, checks the calendar
-
04 Reasoningcompares plans against reality, notices the gaps
-
05 Answer + write-backtells you, and files anything worth remembering
CLAUDE.md — the most important file you own
Of everything in your vault, one file punches furthest above its weight: CLAUDE.md, the standing instructions read at the start of every conversation. It's the difference between an assistant that knows you and a stranger with good manners. Learning to tend it is the highest-leverage skill in this whole guide.
What earns a place in it. Every line is read every time, so every line must pay rent:
- Who you are and what you're actually trying to achieve — lead with this.
- How you like to work: tone, format, what to always do, what to never do.
- The vocabulary of your world — "when I say 'the board', I mean the advisory board."
- Pointers to deeper context ("industry beliefs live in Industry_Truths.md") rather than the deep context itself.
What doesn't belong. Long reference material (link to it instead — the assistant reads files on demand), anything that changes weekly (that's what your priorities files are for), passwords or keys (never), and flattering fictions about how you wish you worked — the file steers real behavior, so honesty beats aspiration.
The Dex nuance: Dex manages most of its own CLAUDE.md — the system behaviors, your profile section — and updates it during upgrades. Your personal lines go inside the protected USER_EXTENSIONS block, which survives every update untouched. Edit there freely; let Dex own the rest.
The file drifts as your job changes, so audit it occasionally:
Review the USER_EXTENSIONS block in my CLAUDE.md against best practice. Line by line: is anything vague, stale, contradicted by how I actually work lately, or wasting its place? Does it lead with who I am and what I'm trying to achieve? Propose a tighter version, show me what you'd cut and why, and check it against my recent session learnings for anything important I've told you that never made it into the file.
Make it your own: that last clause is the compounding move — corrections you made in passing get promoted into permanent instructions.
And its cousin: AGENTS.md
As AI assistants multiplied, the industry converged on a vendor-neutral version of the same idea: AGENTS.md, one instructions file that any coding agent — not just Claude — looks for. The concept is identical: standing context, read at startup, shaping behavior. Claude Code reads CLAUDE.md; many other tools (Cursor's agent, OpenAI's Codex, and a growing list) read AGENTS.md. In Dex you don't need to think about this — CLAUDE.md is the file that matters here. But when you meet AGENTS.md elsewhere, you already know exactly what it is, and teams often keep the two in sync so every assistant gets the same briefing. One skill, every tool.
Hooks — the most underrated feature in Claude Code
If CLAUDE.md is the file people underuse, hooks are the feature people underuse. A hook is a small script that runs automatically at a fixed moment in the assistant's life — no AI judgment involved, which is exactly the point: hooks are guaranteed. The AI might forget an instruction buried in a long conversation; a hook fires every single time. The craft of a great setup is choosing what should be probabilistic (the AI decides) and what should be law (a hook enforces).
Dex leans on them everywhere: your priorities load at session start because of a hook; person context appears when a file mentions someone because of a hook. Here are the core moments you can hang automation on, with the kind of thing each is for (the full catalog is larger still — from "a watched file changed" to "context is about to be compacted"):
| The moment | Fires when… | What you could hang on it |
|---|---|---|
| Session start | a new conversation opens | load today's priorities, surface overnight changes, remind about the thing you always forget |
| Prompt submitted | you send a message | stamp today's date and context in, so "tomorrow" never gets miscalculated |
| Before a tool runs | the assistant is about to act | guardrails: block edits to a folder, require confirmation for anything touching a certain file |
| After a tool runs | an action just completed | enrichment: when a file mentioning a customer is read, inject their history automatically |
| Notification | the assistant needs your attention | route it somewhere you'll actually see — a ping, a sound, your phone |
| Stop | the assistant finishes responding | quality gates: check nothing was left half-done, capture learnings from the session |
| Session end | the conversation closes | housekeeping: archive, sync, tidy — the cleanup you'd never do manually |
Two honest notes: hooks run real scripts on your machine, so only install ones you understand or trust — and they're the one part of this guide where a technical friend (or Dex itself) writing the script for you is normal. The full reference — every event, with configuration examples — lives in Anthropic's hooks documentation.
The Dex-native way in — describe the automation in plain English and let Dex do the wiring:
I want something to happen automatically every time [MOMENT — e.g. "I start a session" / "a file about a customer is read" / "you finish responding"]. Specifically: [WHAT]. Design the hook for me: which hook event fits, what the script should do, and any risks. Show me the plan, build it, then prove it fires by triggering the moment once.
Make it your own: start with a session-start hook that shows the one thing you always wish you'd remembered — yesterday's unfinished Must, the promise coming due. One guaranteed reminder beats a hundred good intentions.
Scheduled automation — and the safety-net trick
Hooks fire when you do something. The other half of automation is things that should happen on a schedule — a daily meeting sync at 5pm, a weekly digest on Monday mornings — whether or not you're in a chat.
Computers have had this for decades: cron is the classic scheduler, and on the Mac the native version is launchd, configured by small files called plists. You don't need to learn any of that syntax — you just describe the schedule in chat:
I want [JOB — e.g. "my meeting sync" / "a Monday-morning digest of the week ahead"] to run automatically at [TIME/FREQUENCY] on my Mac. Set up the scheduled job for me — explain what you're creating and where it lives, create it, then prove it works by running it once now. Also tell me how to see it, pause it, and remove it later.
Dex uses this machinery itself: meeting sync, its nightly self-test, and its learning reviews all run as scheduled jobs on your Mac.
The problem: laptops close
Schedulers have a quiet failure mode: the job only fires if your Mac is awake at the scheduled moment. Lid closed at 5pm? The sync just doesn't happen — and nothing tells you. Miss a few and your "automated" system is silently three days stale.
The fix: make session start your sweeper
Here's the trick worth stealing, and it composes the two ideas on this page. Every scheduled job leaves a timestamp — "last ran: …" — in a small marker file. Then a session-start hook checks the markers: next time you open a chat, for each job it asks did this run when it should have? Already ran → do nothing, silently. Missed → run it now (or flag it). Your most reliable habit — opening a chat — becomes the guarantee behind every automation you own.
The sweeper pattern
-
01 Scheduled jobruns at 5pm — when it does, it stamps "last ran" in a marker file
-
02 Laptop closed5pm passes in a backpack — no run, no stamp, no error
-
03 You open a chatthe session-start hook fires, as it always does
-
04 The sweephook compares each marker against its schedule — anything missed?
-
05 Catch-upthe stale job runs now; up-to-date jobs are left alone
The beauty is that it's self-healing and silent: no missed-job anxiety, no cron debugging, and no noise when everything worked. Dex ships with this pattern built in — its daily checks are throttled by marker files exactly this way — but the pattern is yours to reuse for anything:
Look at every scheduled job we've set up together. Give each one a "last ran" marker if it doesn't have one, then extend my session-start hook into a sweeper: on every new session, check each marker against its schedule, run anything that was missed, and stay completely silent when everything is on time. Show me the plan first, then build it, then test it by faking one stale marker.
Make it your own: the sweep mindset generalizes beyond your laptop — "what should have happened that didn't?" is the same question /dex-doctor asks about the whole system. Automation you can trust isn't automation that never fails; it's automation that notices when it did.
A few practical fluencies
- Slash commands are just packaged instructions.
/daily-planloads a recipe file and follows it. You can read every recipe, and write your own. - Be direct about what you want. These systems respond to clarity, not politeness rituals. "Rewrite this shorter, punchier, no bullet points" beats "could you maybe improve this?"
- Correct it — out loud. When Dex gets something wrong, saying why does double duty: it fixes the moment, and captured learnings make the correction stick.
- Trust, but inspect. AI is probabilistic — mostly right, occasionally confidently wrong. Dex's design accepts this: important operations run through deterministic tools, claims trace back to files, and
/xrayshows the machinery. Skepticism is a supported workflow, not an insult. - Approve permissions thoughtfully, once. Claude Code asks before touching new things. In your own vault, it's fine to approve routine file edits durably — that's what the permission system is for.
Why this transfers
Every hour in Dex is practice in the durable skills of AI-native work: writing instructions that shape behavior, giving agents the right context, splitting judgment (AI) from execution (tools), and verifying instead of blindly trusting. Dex just happens to teach them while doing your actual job.
Want to go deeper on the engine itself? Anthropic's Claude Code documentation at code.claude.com/docs covers all of it — and inside Dex, /xray ai, /xray dex, and /xray boot each unpack a layer of the machine, live, on your own data.
Don't just read this — paste it into your own Dex and it becomes a lesson about your actual work.
First, fetch and read the page I'm referring to: https://heydex.ai/help/claude-code-primer.md I just read the Dex Guide's page on how Claude Code works — the memory model, the context window, instructions, tools, hooks, and scheduled automation. Make it concrete with OUR session: x-ray what's in your context right now, which instructions are shaping you, which tools you've called and why, and which hooks fired. Then flip it — quiz me with three questions to check I actually understood, and correct anything I get wrong. Finish with the one concept from this page most worth me knowing cold, given how I use you.