A CLAUDE.md for a data repository: what to put in it

After installing Claude Code, /init writes a CLAUDE.md that Claude reads every session. For a data project, five things make it useful: where the data lives, how to run and test, the naming rules, what never to touch, and the numbers that must match.

Short answer: run /init and Claude writes a CLAUDE.md it reads at the start of every session. For a data repository, edit it to cover five things: where the data and schemas live, how to run and test (the exact commands), naming rules, what never to touch (production connections, raw data folders), and reconciliation numbers that must still match after a change. Keep it short; move long details into separate files.

Without notes, every session starts by rediscovering your project: which folder holds the views, which script runs the tests, why there are two date tables. A CLAUDE.md answers that once.

Nothing loads from YouTube until you press play. Then Google receives your IP address and may set its own storage. Narrated with an AI-generated voice. Privacy

What goes in it?

Mapschema/ holds the DDL, sql/ the views, pbi/ the Power BI project, data/ samples only
Run and testthe commands: python -m pytest, sqlcmd -i tests/reconcile.sql
Rulesnaming, DIVIDE in DAX, no SELECT * in views
Neverno writes to prod, no files in raw/, no secrets in code
Must matchthe reconciled totals from finance that no change may move
Five sections of a data CLAUDE.md

What does a short one look like?

# Sales analytics repo

### Map
- schema/: table definitions (read these before writing SQL)
- sql/views/: reporting views, one file per view
- pbi/Sales.SemanticModel/: the Power BI project (PBIP)

### Run and test
- Tests: python -m pytest tests/
- Totals check: sqlcmd -S test-db -i tests/reconcile.sql

### Rules
- Views: no SELECT *, explicit column lists, comment the grain on line 1.
- DAX: DIVIDE for division, VAR for repeated expressions.

### Never
- Never connect to prod-db. Never edit files in raw/.

### Must still match after any change
- 2025 revenue 4,812,300 and 61,904 orders (finance, Jan 2026).

The figures are made up; use your own reconciled numbers.

What comes after the CLAUDE.md?

Two more settings finish the setup: permissions (/permissions) for the commands you trust, like the test command, so Claude stops asking for them; and hooks for rules that must never be skipped, such as running the totals check before every commit. Allow specific commands rather than skipping permissions altogether.

Where can you check this?

Where do you start?

Put your conventions in a skill when they grow, with a skill for DAX conventions, and keep your Power BI files readable for Claude with version control with PBIP.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.