
What CLAUDE.md does
CLAUDE.md is a Markdown file at the root of a repository. Claude Code loads it on the first turn of every conversation. It is the place teams encode the things they would otherwise say out loud to a new contributor: "we use pnpm, never npm", "API routes live under apps/api/src/routes", "prefer named exports".
The job CLAUDE.md does is configuration of agent behavior. It does not, and should not, contain the answers to data questions. It contains the rules the agent should follow when answering anything.
Same idea, other vendors: AGENTS.md (OpenAI Codex) is the equivalent filename. The convention is shared; only the filename differs.
What CHION.md does
CHION.md is the skills-and-truth half of the pair: a compiled bundle of your team's verified PostgreSQL queries, with a shared-rules header — the canonical revenue definition, the active-customer rule, the timezone convention — that every query inherits. Where CLAUDE.md tells the agent how to behave, CHION.md tells it which SQL the business has already agreed on. It is a contract, not a prompt: the answer is the query finance already signed off on.
The full anatomy — the root header, the per-query SKILL.md files, and the Postgres-grounded refresh model — lives in the CHION.md spec.
CLAUDE.md vs CHION.md, side by side
The clearest way to see the difference is to put the two files in adjacent columns and read across each row.
| Facet | CLAUDE.md | CHION.md |
|---|---|---|
| Scope | Repo-wide. One file at the root that every Claude Code conversation loads first. | A bundle of verified SQL skills. One SKILL.md per query your team already trusts, plus a shared CHION.md header. |
| Owner | You (or your engineering team). Hand-edited. Lives next to your source code. | Compiled by Chion from queries promoted in the workspace. Re-emitted every refresh. |
| What it contains | Agent behavior, conventions, project context: "use pnpm", "the API is in /api", "prefer named exports". | A portable SKILL.md per verified query: name, triggers, must-read, the actual SQL, and a short why. |
| Lifecycle | Edited by humans, committed to git, changes when the project changes. | Generated, versioned, supersedable. New verified query in Chion equals a new SKILL.md on next export. |
| Filename convention | CLAUDE.md at repo root. AGENTS.md is the Codex equivalent. Same job. | CHION.md at the root of the exported bundle, with SKILL.md files under personas/<slug>/. |
| When the SQL is wrong, you fix it... | By rewriting the SQL the agent generated. | By promoting a corrected verified query inside Chion. The SKILL.md export updates on next refresh. |
Notice that no row contains overlap. The two files answer different questions — which is why teams who adopt both stop arguing about whether the agent or the data is wrong, and start fixing whichever one actually is.
Using CLAUDE.md and CHION.md together
At runtime, the two files run a tiny relay. CLAUDE.md goes first, because it is loaded before the conversation begins. It teaches the agent your conventions and tells it where to look when a data question appears: "if the user asks about revenue, MRR, or churn, route to the relevant SKILL.md under personas/finance".
When the data question arrives, the agent resolves the matching SKILL.md from the CHION.md bundle. The SQL inside that SKILL.md is the SQL it runs. It does not improvise. It does not pattern-match against a fresh prompt. It executes the verified query — the same query a human on the data team would have written.
CLAUDE.md
Directs the agent. Conventions, routing rules, project context.
CHION.md + SKILL.md
Supplies the verified SQL the agent runs. One SKILL.md per promoted query.
Trusted answer
Behavior plus truth. The agent acts your way and runs your SQL.
For more on how skills get authored on the Claude side of that relay, the claude code skills practical guide walks the SKILL.md authoring convention in depth. This page stays on the file contract itself.
Why SQL needs a CHION.md
CLAUDE.md routes to the answer; CHION.md is the answer.
CLAUDE.md works beautifully for code. "Use pnpm, prefer named exports, the API lives under apps/api" — these are rules a single contributor can write down and the whole team agrees on. SQL is different. The SQL that answers "what is MRR" depends on whether you count annualized contracts, whether refunds inside the period are subtracted, and which timezone the billing day rolls in. Two well-meaning engineers will write two different queries, and both will look correct.
That is the gap CHION.md fills. It is not a second behavior file — it is the place the business writes down which SQL is the answer. A CLAUDE.md telling Claude to "use the team's revenue definition" is a wish. A CHION.md bundle that ships a verified mrr-by-plan/SKILL.md is the definition. The agent stops guessing and starts executing what your finance team already signed off on.
The agent stops guessing and starts executing what your finance team already signed off on.
This is also why CLAUDE.md for SQL alone is incomplete. A CLAUDE.md can route to SQL skills, but it cannot contain them at scale without becoming an unreviewable wall of queries. CHION.md is the file format that lets the SQL live next to the rest of your skills — one SKILL.md per verified query, refreshable from your Chion workspace. You can auto-generate verified SQL skills from a plain-English question, then promote the ones your team trusts.
The SKILL.md export, end to end
SKILL.md export is the operational verb that turns a workspace of verified queries into a folder you can commit. It is intentionally short: four steps, the same every time.
Promote a verified query
In Chion Studio, run a question, verify the SQL is correct, then promote it. Promotion is the act of declaring "this query is the team-approved answer".
Export the bundle
From Skills, run Export. You get a folder: CHION.md at the root, one SKILL.md per promoted query under personas/, and a CLAUDE.md / AGENTS.md mirror so any agent can pick it up.
Drop it into your repo
Commit the folder. Open Claude Code, Codex, or Cursor. The agent reads CLAUDE.md (your behavior rules), then routes to the right SKILL.md (your verified SQL) when a trigger word fires.
Re-export when the database changes
Schema drift is solved by re-running export. The portable SKILL.md set is overwritten in place. Your CLAUDE.md never moves — the two files have separate jobs.
Here is what one of the resulting files looks like. Keep this minimal — a real export contains one file per verified query, but the shape is the same.
---
name: monthly-recurring-revenue-by-plan
description: Use when asked for MRR, ARR, or recurring revenue split by plan on the production Postgres warehouse.
triggers: [mrr, arr, recurring revenue, plan, subscription]
must-read:
- CHION.md
source: chion://verified-queries/finance/mrr-by-plan
verified_at: 2026-05-22
---
# MRR by plan (verified)
Returns monthly recurring revenue grouped by plan_id for the
trailing 13 months. Uses the finance team's canonical revenue
rule from CHION.md (active subscriptions only, excludes refunds
inside the period).
```sql
SELECT date_trunc('month', billed_at) AS month,
plan_id,
SUM(amount_cents) / 100.0 AS mrr
FROM billing.invoice_line_items
WHERE status = 'paid'
AND billed_at >= now() - interval '13 months'
GROUP BY 1, 2
ORDER BY 1, 2;
```The frontmatter is the contract. The body is human-readable context. The SQL block is the verified query Chion will keep in sync on every refresh. This is what we mean by a portable SKILL.md: it travels intact between Claude Code, Codex, and Cursor, with no rewriting.
The full anatomy of the CHION.md root header — including the shared rule layer and the verified query index — lives on the CHION.md reference page.
Quick reference
- CLAUDE.md = agent behavior file. Hand-authored. One per repo.
- CHION.md = verified SQL skills bundle. Compiled from your promoted queries.
- SKILL.md = the open file format inside the CHION.md bundle. One per query.
- SKILL.md export emits a portable SKILL.md set plus CLAUDE.md and AGENTS.md mirrors.
- The two files do not overlap. CLAUDE.md says how to act. CHION.md says what is true.
- sql skills export means: take the queries your team already trusts, package them as SKILL.md, ship them with your repo.
- Postgres claude skills and sql skills for claude are byte-identical SKILL.md files; the label refers to which database they were grounded in.
Frequently asked
What is CLAUDE.md, in one sentence?
CLAUDE.md is a Markdown file at the root of a repository that Claude Code reads on every conversation to learn the project conventions and how the agent should behave inside it.
What is CHION.md, in one sentence?
CHION.md is the root header of a packaged SQL skills bundle Chion exports from your verified queries; it travels with a set of SKILL.md files that contain the actual, team-approved SQL.
Do I need both files?
Yes if you want both halves of the contract. CLAUDE.md tells the agent how to behave in your repo. CHION.md plus its SKILL.md files tell the agent which SQL it is allowed to trust. They do not overlap — they compose.
Is SKILL.md a Chion format or an open one?
SKILL.md is the open agent-skill convention used by Claude Code and others. Chion writes portable SKILL.md files that conform to that convention so the same bytes work in Claude, Codex, and Cursor without modification.
Where does the SQL inside a SKILL.md come from?
From queries your team has explicitly promoted as verified inside Chion. The SKILL.md is a packaging of that query plus its metadata. No model writes the SQL into the file — the verified query is the source of truth.
What about CLAUDE.md vs AGENTS.md?
They are the same idea under different vendor filenames. Claude Code reads CLAUDE.md, OpenAI Codex reads AGENTS.md. The Chion export ships both mirrors so you do not have to pick.
Does the export include Postgres claude skills specifically?
Yes. Because the verified queries originate from a connected Postgres database, every SKILL.md in the bundle is grounded in real Postgres column names, types, and joins — these are postgres claude skills by construction, not by labeling.
What is CLAUDE.md used for?
CLAUDE.md is the configuration file Claude Code reads at the start of every conversation in a repository. Teams use it to encode conventions ("use pnpm", "API routes live under apps/api/src/routes"), routing rules (which folders mean what), and project context the agent would otherwise have to guess at. It is the closest thing to a README written specifically for an agent.
How do I use CLAUDE.md in my repo?
Create a file named CLAUDE.md at the root of the repository, write the rules in plain Markdown (conventions, allowed tools, routing hints), and commit it. Claude Code loads it automatically on the first turn of every conversation in that repo. For SQL specifically, add a one-line routing rule like "for data questions, look under personas/" and pair it with a CHION.md bundle.
Can I put SQL inside CLAUDE.md?
You can, but it stops scaling fast. CLAUDE.md is hand-edited and reviewed in pull requests, so dropping every verified team query into it turns it into an unreviewable wall. The cleaner pattern is CLAUDE.md for SQL at the routing layer only: CLAUDE.md says "for revenue questions, read finance/SKILL.md", and the actual SQL lives in the CHION.md-managed SKILL.md files.
Export a CHION.md bundle from your verified queries.
Connect a read only Postgres role, promote a query you already trust, and run SKILL.md export. The bundle drops into the same repo as your CLAUDE.md.