guide5 min read

Claude Code Memory Claude Md For Data

Claude Code Memory Claude Md For Data

Claude Code reads `CLAUDE.md` at the start of every session — it is where you document your data stack's conventions, warehouse patterns, and team rules. A well-written CLAUDE.md transforms agent output from generic to team-specific in one read.

CLAUDE.md is the single most important file for making Claude Code useful on data projects. It is where you encode naming conventions, warehouse patterns, team preferences, and safety rules. Skip it and every prompt needs to re-explain your context. Write it well and the agent inherits your tribal knowledge on day one.

What Goes in CLAUDE.md for Data Teams

Your CLAUDE.md should answer five questions that come up in every data engineering prompt: what warehouse are you on, what naming conventions do you use, what testing patterns are required, what cost and safety constraints apply, and what tools are available. Each section gets a few paragraphs, not pages — the agent has to read it every session, so brevity matters.

A good rule of thumb is 500-1500 words for a data team CLAUDE.md. Below 500 and you are not capturing enough context. Above 1500 and the agent spends token budget on memory that could go to actual work.

Warehouse and Stack Section

Start with a brief description of your stack: 'We run Snowflake + dbt on the analytics warehouse with a dev target that uses the dev_dpo database. Our primary DAG orchestrator is Dagster running in Dagster Cloud Hybrid. BI tools are Looker and Mode.' The agent uses this context to pick the right tools for every task.

  • Name the warehouse — Snowflake, BigQuery, Databricks, etc
  • Name the transformation tool — dbt, SQLMesh, SDF
  • Name the orchestrator — Airflow, Dagster, Prefect
  • Name the catalog — DataHub, OpenMetadata, UC
  • Name the BI layer — Looker, Mode, Metabase

Naming Conventions

Every data team has naming rules: stg_ prefix for staging models, fct_ for facts, dim_ for dimensions, rpt_ for reports. Document them explicitly so the agent matches. Include column naming too — is it user_id or userid, is it created_at or creation_date, is it is_active or active_flag?

Naming rules seem trivial but they are where most auto-generated code looks wrong. When Claude Code follows your conventions, its output feels like it came from a senior engineer on your team. When it does not, every PR needs cosmetic fixes that frustrate reviewers.

Testing and Quality Patterns

Document which tests are mandatory on which kinds of models. For example: 'All staging models must have a not_null test on the primary key and a unique test on the natural key. All fact tables must have a relationships test to the corresponding dimension. All source tables must have a freshness rule with a warning at 1 hour and an error at 4 hours.' The agent enforces these on every new model without being asked.

Without CLAUDE.mdWith CLAUDE.md
Generic namingMatches team conventions
Missing testsFull test coverage
Wrong warehouse syntaxCorrect dialect
Uses deprecated toolsUses team-standard tools
Ignores safety rulesHonors safety hooks

Safety and Cost Constraints

Include explicit rules about what the agent must not do: 'Never run DROP, TRUNCATE, or DELETE on production. Always use the dev target for exploratory work. Always add a partition filter when querying tables over 1TB. Always tag queries with query_tag = claude-code.' These rules keep the agent honest even before the hooks kick in.

See AI for data infra or autonomous data engineering for sample CLAUDE.md patterns that work across diverse stacks.

Project Structure

Give the agent a map: 'dbt project is in /dbt, staging models in /dbt/models/staging, marts in /dbt/models/marts. Airflow DAGs in /airflow/dags. Terraform for warehouse infra in /infra.' This saves the agent from having to scan the whole repo on every prompt.

Book a demo to see Data Workers agents consuming a well-crafted CLAUDE.md for automated data engineering workflows.

Cost tracking is the final piece most teams miss until it bites them. Agent-initiated warehouse queries need tagging so they show up in the billing export under a known label. Without the tag, agent spend hides inside the general data team budget and there is no way to track whether the agent is paying for itself. With tagging, you can produce a monthly chart of agent cost versus human hours saved — and the ROI math is usually obvious.

The teams that get the most value from this pairing treat it as a daily-driver rather than a novelty. Every morning starts with the agent pulling recent incidents, surfacing anomalies, and queuing up the highest-leverage work before a human sits down. By the time an engineer opens their laptop, the backlog is already triaged and the obvious fixes are sitting in draft PRs. The shift in cadence is subtle at first and enormous by month three.

Onboarding a new engineer to this workflow takes hours instead of weeks because the agent already knows the conventions documented in your CLAUDE.md. New hires pair with Claude Code on their first ticket, watch how it reasons about the codebase, and absorb the local patterns faster than any wiki could teach them. That accelerated ramp compounds across every hire you make after the agent is installed.

Another pattern worth calling out is the gradual handoff. Teams that trust the agent immediately tend to over-rotate and then pull back after a mistake. Teams that trust it slowly, one workflow at a time, end up with a more durable integration. Start with read-only exploration, graduate to PR generation, graduate to autonomous merges only when the hook coverage is rock solid. Each graduation should be a deliberate decision backed by evidence from the previous phase.

Do not underestimate the cultural change either. Some engineers love working with an agent immediately and never want to go back. Others resist it for months. The resistance is usually not technical — it is about identity and craft. Give engineers room to adapt at their own pace, celebrate the early wins publicly, and let the productivity gains speak for themselves. Coercion backfires; invitation works.

CLAUDE.md is the memory layer that makes Claude Code team-specific. Document your warehouse, conventions, testing rules, safety constraints, and project structure once, and every future prompt benefits. The investment is an hour of writing and returns better agent output forever.

Go from data platform to
agentic platform.

With autonomous AI agents working across your entire data stack — MCP-native, open-source, deployed in minutes.

Book a Demo →

Related Resources