How data teams use Claude Code: SQL, reports, dashboards
LearnOS Team, October 1, 2026 · 5 min read
If you search for how a data team should use Claude Code, most answers fall into two camps. One treats it as an autocomplete for SQL. The other is a software engineering guide that never mentions a warehouse. Both miss what changes for an analytics team. Claude Code is an agent that reads your repository, runs commands, and calls connected tools, so the real questions are what you let it touch and which of your recurring work it should own.
This post covers four workflows an AI or data lead at a mid-market consumer brand can run in the first month, the controls each one needs, and a rollout checklist. The examples use a fictional company, Northpeak Outfitters, an outdoor apparel brand with a small analytics team, a cloud warehouse, and a dbt-style repository of SQL models. At the end we point to a 17-lesson course that teaches the whole setup.
Start with a CLAUDE.md that holds your metric definitions
Every Claude Code session starts with an empty context window. The fix is a
CLAUDE.md file in the repository root, which Claude reads at the start of
every session and which your team shares through version control
(How Claude remembers your project).
Running /init drafts one from the codebase. Anthropic recommends keeping
each file under 200 lines and writing instructions concrete enough to
check.
For a data team, the most useful content is the definitions people argue about. Northpeak's file says that "net revenue" excludes tax, shipping and returns processed within 30 days. It says which schema is the source of truth for orders and that fiscal weeks start on Sunday. It names the test command to run before any model change. Claude can't work these out from the SQL alone.
Workflow 1: Warehouse questions through a read-only connection
Claude Code connects to databases through the Model Context Protocol (MCP). Anthropic's own example adds a PostgreSQL server and then asks questions in plain language, such as "Find customers who haven't made a purchase in 90 days." The docs also tell you to "use a read-only database user in the connection string so the queries Claude runs can't modify data" (Connect Claude Code to tools via MCP).
Northpeak gives Claude a dedicated warehouse
role with read access to the reporting schemas only. Analysts then ask
"why did returns in the footwear category jump in week 37?" and Claude
writes the query, runs it, and explains the result alongside the SQL it
used. The analyst checks the SQL before trusting the number. The same docs
warn that servers which fetch external content can expose you to prompt
injection, so only connect servers you trust. To share one connection
with the team, commit it in a project-scoped .mcp.json.
Workflow 2: Recurring reports as skills
The weekly trading summary eats an analyst's Monday. In Claude Code, the procedure becomes a skill: a SKILL.md
file in .claude/skills/<name>/ that anyone on the team can run as
/weekly-trading (Extend Claude with skills).
A skill can bundle supporting files such as a query file or a report
template. It can also inject live command output into the prompt before
Claude sees it. For a skill that has side effects, such as posting to a
channel, set disable-model-invocation: true so it only runs when a
person calls it.
To run the report without anyone at a keyboard, you have two options:
- From your existing scheduler.
claude -pruns Claude Code non-interactively, and--output-format jsonwith--json-schemareturns output that follows a schema you define, which your pipeline can validate before anything is published (Run Claude Code programmatically). - As a routine. Routines run a saved prompt on a schedule, from an API call, or on GitHub events, on Anthropic-managed cloud infrastructure. They are in research preview, the shortest interval is one hour, and anything a routine does through your connectors appears as you (Automate work with routines). Give a routine only the connectors it needs.
Workflow 3: Dashboards built as code
Most analytics teams have dashboard requests the BI tool can't handle and nobody on the team has the front-end skills to build. Anthropic describes its own data scientists, who did not know TypeScript well, using Claude Code to build complete React apps for visualizing model performance (How Anthropic teams use Claude Code).
At Northpeak, that means a one-page sell-through tracker for the wholesale team, built on a query the team already trusts and kept in the repository so changes get reviewed. Our own rule is that a dashboard built this way reads only from tables that already pass your data tests. Claude Code makes the front end cheap to build, but it doesn't make the numbers right.
Workflow 4: Cleanup scripts and model refactors
Most data backlogs are maintenance: deprecated columns, duplicate staging models, a Python script only one person understands. Start in plan mode, where Claude reads files and runs read-only commands but doesn't edit your source files (Configure permissions). Approve the plan, let it make the change, then have it run your tests before you review the diff.
One gap matters for data work. Permission deny rules such as
Read(./.env) cover Claude's file tools and the file commands it
recognizes in Bash, but not a Python script that opens files itself. For
that, Anthropic points you to the sandbox, which enforces access at the
operating-system level (same page).
A rollout checklist for data leads
This is our own checklist, built from the docs above and from the course's rollout module:
- Credentials first. Read-only warehouse roles for every MCP connection, scoped to the schemas analysts already use.
- Block secrets. Add deny rules for
.envfiles and credential folders, and turn on the sandbox for scripts that touch the filesystem. - Write the CLAUDE.md before the pilot. Metric definitions, source-of-truth tables, and the test command.
- Pilot with three to five analysts on real tickets. Corrections you give twice belong in CLAUDE.md or a skill.
- Enforce with managed settings, not instructions. Anthropic's docs are explicit that CLAUDE.md shapes behavior but is not a hard enforcement layer. Permission rules in managed settings are enforced by the client and can't be overridden by user or project settings (How Claude remembers your project; Configure permissions).
- Automate last. Move a report to
claude -por a routine only after it has run correctly by hand for a few weeks.
Learn it hands-on
Claude Code at Work is a 17-lesson course for engineers, data analysts, and technical leads, and takes about three to four hours. After a short orientation, it runs through four modules: getting started (installing, first session, and the explore, plan, code, verify loop), everyday productivity (prompting, common workflows, and managing context and costs), team workflows (CLAUDE.md, slash commands and skills, MCP, subagents and hooks), and security and rollout (permission modes, reviewing AI-generated code, data handling, and a company-wide rollout plan). The capstone takes 60 to 90 minutes: you ship a real commit to a repository you care about, from a committed CLAUDE.md through plan, implementation, tests and review. The course links to Anthropic's documentation throughout, which remains the source of truth as features change.
