Skip to content
Productivity
Skill

/xray

Explain what just happened under the hood — the context, MCP tools, and hooks behind Dex's last response — as AI education. Use when the user says 'how did you do that', 'what just happened', 'explain the mechanics'. Not for a system health check; use `dex-doctor`.

From plugin
dex
51099 skills28 agents24 commands1 MCP

Claude Code

$ npx -y skills add davekilleen/Dex --skill xray --agent claude-code

SKILL.md

xray.SKILL.md
name: xray
description: "Explain what just happened under the hood — the context, MCP tools, and hooks behind Dex's last response — as AI education. Use when the user says 'how did you do that', 'what just happened', 'explain the mechanics'. Not for a system health check; use `dex-doctor`."

/xray - The AI Education Experience

**Default behavior:** Explain what just happened in THIS conversation — the specific tools, files, and context that were used, with educational explanations of WHY.

**With qualifiers:** Deep dive into specific topics (AI fundamentals, Dex architecture, how to extend).

---

Philosophy

The best way to learn is by examining what just happened, not abstract concepts. When you run `/xray`:

1. **Show the work** - What tools ran, what files were read/written 2. **Explain why** - Why each action was necessary 3. **Connect to concepts** - Link specific actions to how AI/Dex works 4. **Empower extension** - "You could customize this by..."

**The outcome:** Users learn AI by examining their own conversations, then go deeper if curious.

**Tone:** Like a senior engineer doing a code review of what just happened. "Here's what I did and why."

---

Step 1: Determine Mode

Default (no arguments): "This Conversation"

When user just says `/xray` with no qualifier: → **Immediately explain what happened in this conversation** → Don't show a menu, just show the work

With qualifiers: Specific topics

| Command | What it does | |---------|--------------| | `/xray` | (default) Explain what just happened in this chat | | `/xray ai` or `/xray fundamentals` | First principles: context windows, tokens, statelessness | | `/xray dex` or `/xray architecture` | How Dex works: CLAUDE.md, hooks, MCPs, skills | | `/xray boot` or `/xray session start` | The session startup sequence | | `/xray extend` or `/xray customize` | How to customize and build on Dex yourself |

---

DEFAULT MODE: This Conversation (Show Your Work)

**This is the primary mode.** When user runs `/xray`, explain what happened.

Step 1: Analyze the conversation

Look at the current conversation and identify: 1. What files were read 2. What files were written/modified 3. What tools/MCPs were used 4. What context was loaded at session start (check for `<previous_session_memories>` etc.) 5. Key decision points in the AI's reasoning

Step 2: Present as educational walkthrough

Output format:

## 🔬 X-Ray: What Just Happened

Let me explain what happened under the hood in our conversation.

---

### 📖 The Story of This Chat

Here's what I did, step by step:

**1. Session Started**
Before you typed anything, the system loaded:
- `CLAUDE.md` (~X tokens) — My personality, your preferences, available tools
- Session memories from earlier today — [list what was injected]
- [Any other context visible from hooks]

**Why this matters:** Without those session memories, I'd have no idea about 
[specific context]. That came from a **session hook** that runs before you type.

**2. You Asked: "[summarize their first message]"**

To respond, I:
- Read `[file 1]` — Because [reason]
- Read `[file 2]` — To check [what]
- Used [tool/MCP] — To [action]

**Why these files?** Your CLAUDE.md tells me where to look. It says [quote relevant 
instruction]. Without those instructions, I wouldn't know your file structure.

**3. [Continue for each major exchange in the conversation]**

---

### 🔧 Tools Used This Session

| Tool | Times Used | What For |
|------|------------|----------|
| `read` | X | Reading vault files |
| `write` | X | Creating new content |
| `edit` | X | Updating existing files |
| `bash` | X | Running commands |
| [other tools] | X | [purpose] |

**Why tools matter:** Without tools, I can only generate text. Tools let me 
actually DO things — read your files, write new ones, check your calendar, etc.

---

### 💡 Key Insight: The Context Window

Everything I "know" right now is what's in the **context window**:

┌─────────────────────────────────────────────────┐ │ What I can see (the context window) │ ├─────────────────────────────────────────────────┤ │ ✓ CLAUDE.md (loaded at start) │ │ ✓ Session memories (injected by hooks) │ │ ✓ Our full conversation so far │ │ ✓ Every file I've read this session │ │ ✓ Every tool result I've received │ ├─────────────────────────────────────────────────┤ │ ✗ Files I haven't read │ │ ✗ Previous sessions (unless summarized) │ │ ✗ Anything not loaded into context │ └─────────────────────────────────────────────────┘


If something isn't in this window, I literally don't know it exists.

---

### 📁 Files Touched This Session

**Read (loaded into my context):**
- `[file]` — [why it was needed]
- [continue for each file]

**Written/Modified:**
- `[file]` — [what was created/changed]
- [continue for each file]

**Why this matters:** Every file I read uses "tokens" (space in the context 
window). I try to read only what's relevant, not everything.

---

### 🎓 Concepts You Just Saw in Action

| What Happened | The Underlying Concept |
|---------------|------------------------|
| I knew about earlier conversations | **Session hooks** inject context at start |
| I read CLAUDE.md first | **System prompt** loads before anything |
| I created files with tools | **Tools** let AI take action, not just talk |
| I followed your file conventions | **CLAUDE.md instructions** define your structure |
| I didn't know about [X] | **Context limitation** — only know what's loaded |

---

### 🔮 What You Could Customize

Based on what just happened:

**1. Add to CLAUDE.md**
If you want me to always [behavior], add it to your `USER_EXTENSIONS` block.

**2. Create a Skill**
If you do [this workflow] often, create a skill to automate it.

**3. Add a Session Hook**
If you always want [context] loaded at start, write a hook that injects it.

---
Read more
@davekilleen
Ships withdex

One personal Dex, built around your work. Keep your priorities, people, meeting notes and tasks in a folder you own. Work with Dex through your AI app to plan the day, prepare for a meeting or follow through on a promise.

51099 skills28 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
510
Star history of davekilleen/Dex on GitHub, a chart by star-history.com

Other skills on dex.

agent-browser

agent-browser

Browser automation using Vercel's agent-browser CLI. Use when you need to interact with web pages, fill forms, take screenshots,…

@davekilleen@davekilleenInstall Skill
agent-native-architecture

agent-native-architect…

Build applications where agents are first-class citizens. Use this skill when designing autonomous agents, creating MCP tools,…

@davekilleen@davekilleenInstall Skill
andrew-kane-gem-writer

andrew-kane-gem-writer

This skill should be used when writing Ruby gems following Andrew Kane's proven patterns and philosophy. It applies when creating…

@davekilleen@davekilleenInstall Skill
brainstorming

brainstorming

This skill should be used before implementing features, building components, or making changes. It guides exploring user intent,…

@davekilleen@davekilleenInstall Skill
compound-docs

compound-docs

Capture solved problems as categorized documentation with YAML frontmatter for fast lookup

@davekilleen@davekilleenInstall Skill
create-agent-skills

create-agent-skills

Expert guidance for creating, writing, and refining Claude Code Skills. Use when working with SKILL.md files, authoring new…

@davekilleen@davekilleenInstall Skill

More skills from other plugins.

i-have-adhd

i-have-adhd

Shape output for a reader with ADHD: lead with the next action, number multi-step work, restate state across turns, suppress…

@ayghri@ayghriInstall Skill
ab-test-analysis

ab-test-analysis

Analyze A/B test results with statistical significance, sample size validation, confidence intervals, and ship/extend/stop…

@phuryn@phurynInstall Skill
distilly

distilly

Set up the owner profile so a personal agent knows who it works for (first-run setup, \"get to know me\"), or distill colleague,…

Questions about xray.

Which coding agents can use xray?
xray installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.