Adrienne Vermorel

Your First Hour with Claude Code as an Analytics Engineer

Your First Hour with Claude Code as an Analytics Engineer

I'd been using Cursor for my dbt work, but kept running into situations where the models just didn't quite get what I was trying to do with complex SQL transformations or nested macro logic. Then I tried Claude Code with Sonnet and Opus, and the difference was immediately clear: these models actually understood the nuances of analytics work in a way Cursor's models didn't.

By the end of your first hour with Claude Code, you'll have it installed, authenticated, and you'll have generated at least one useful piece of code. Let's get started.

Installation: One command

curl -fsSL <https://claude.ai/install.sh> | bash

If you're on Windows, you'll need WSL or Git Bash.

Authentication: Two options

Option A: Use your Claude Pro or Max subscription

Run claude and it'll open your browser for OAuth. Sign in with your Claude account. This is simpler to start with, you get the full experience without setting up API billing.

Option B: Use an API key

Set ANTHROPIC_API_KEY in your environment. This is useful for CI/CD and automation, but adds unnecessary setup for your first session. You can switch to this later when you need it.

Note: if you set the environment variable, it takes precedence over your subscription. To use your Claude Pro/Max plan, make sure ANTHROPIC_API_KEY is not set.

Your first interaction

Navigate to your dbt project directory and run:

claude

At the prompt, try:

Explain this project structure and what the main models do

Claude will start reading your files, you'll see it using Read, Grep, sometimes Bash to explore your codebase. It opens your dbt_project.yml, scans your models directory, checks your sources, looks at a few key models.

Then it gives you a summary:

"This is an e-commerce analytics project. You've got base models pulling from Shopify and Stripe, intermediate models handling customer aggregations, and mart models for reporting. Your fact tables are focused on orders and revenue. I can see you're using incremental materialization for the large transaction tables..."

It's reading the actual code and understanding what it does, not just pattern-matching on filenames.

Getting comfortable: The basics

Before generating code, here are the essential commands you'll use regularly.

Changing models when needed

By default, you're using Claude Sonnet 4.5. It handles most analytics work well. For particularly complex problems—debugging intricate incremental models or refactoring nested macro, Opus provides more reasoning power.

/model

This shows available models and lets you switch. Sonnet is the reliable choice for daily work. Opus is slower and more expensive, but useful for difficult problems.

Running bash commands directly

You can run bash commands directly with the ! prefix:

!dbt run -s model_name
!git status
!gcloud auth login

This saves tokens because Claude doesn't have to use the Bash tool—the command runs immediately in your shell. This is particularly useful for:

  • Authentication (like !gcloud auth login before Claude needs to use BigQuery CLI)
  • Quick checks (!dbt ls -s tag:daily)
  • Git operations (!git checkout -b feature/new-model)

The output appears inline, and you can continue the conversation. For analytics engineers working with GCP, running authentication commands this way means Claude can then use gcloud or bq commands in its own work without hitting permission errors.

Setting up your status line

The status line can display useful information below your input, such as current model, git branch, context usage, etc.

/statusline

This opens an interactive setup where you tell Claude what you want to see. You can say something like:

Configure my status line to show: git repo:branch | Model | Context used as % bar

Claude reads your shell configuration and sets it up for you. You'll see something like:

dbt-project:feature/new-attribution | Sonnet 4.5 |[█░░░░░░░░] 6.8%

This shows your project name, current branch, active model and context used. You can customize it later, but I find this basic setup works well for my daily work.

Getting help

/help

Shows all available slash commands and keyboard shortcuts. You can also just ask Claude directly: "How do I undo the last change you made?" or "What models can I use?" The tool is designed to be conversational.

Understanding permission modes

When Claude wants to read a file, write code, or run a command, it asks for permission:

Claude wants to use: Read(models/base/base_orders.sql)
Allow?

You can also press Shift+Tab to cycle through permission modes:

  • Normal mode (default) - Claude asks for permission each time
  • Accept edits mode - Auto-approves file changes, still asks for reads and bash
  • Plan mode - Claude creates a plan without executing, you approve it all at once

For your first session, normal mode lets you see what Claude is doing. Once you're comfortable, accept edits mode reduces interruptions while still showing diffs before changes are made.

Your current mode shows under the status line.

Your first useful output

Find a source table you need to create a base model for. Try this:

Create a base model for [your_source].[your_table] following the patterns in my existing base models

Claude will read your existing base models to understand your patterns, check your sources configuration, and generate the new model following your conventions.

Before writing anything, you'll see a diff. Review it: does it follow your naming conventions? Is it using the same patterns?

If something's off, you can say: "Actually, we always rename id columns to [entity]_id in base models" and Claude will adjust.

The useful part isn't that Claude can write code, it's that it understands your patterns and applies them consistently.

Setting up minimal context: Your first CLAUDE.md

You have two options for setting up project context:

Option A: Let Claude generate it

claude init

Claude will analyze your codebase and generate an initial CLAUDE.md with information it finds: your stack, common patterns, file structure, testing approach. Review what it creates and adjust to match your preferences.

Option B: Create it manually

Create a file called CLAUDE.md at your project root. Start with 5-10 lines of the most important information:

# Analytics Project

## Common Commands
- `dbt run -s model_name` - run specific model
- `dbt test -s model_name` - test specific model
- `dbt docs generate && dbt docs serve` - view docs

## Style
- Use trailing commas in SELECT
- CTEs ordered: imports, logical, final
- Snake_case for all identifiers

## Warehouse
BigQuery

Either way works. claude init gives you a head start, but you'll likely refine it over time as you notice patterns Claude gets wrong or context that's particularly useful.

This gives Claude the context that prevents most "wait, that's not how we do it" moments. You can add more later as you notice patterns Claude gets wrong.

What to try next

Once you've generated your first model, here are three things that give quick results:

"Write tests for [model]"

Claude looks at your schema, identifies primary keys, and generates appropriate tests: uniqueness, not_null, accepted_values where relevant.

"Explain why this model is failing"

Copy the error message into your prompt. Claude will look at the model, trace dependencies, and often identify the issue faster than digging through logs yourself.

"Add documentation to models/marts/mrt__site_performance.yml"

It reads the model, understands what it does, and writes useful descriptions of what the fields mean.

Common first-day issues

Permission prompts getting repetitive?

Hit Shift+Tab to switch to "accept edits" mode. You'll still see diffs, just fewer interruptions.

Claude going off track?

Type /clear and start over. Sometimes conversations drift. Reset and rephrase.

Not sure what's happening?

Use /help or just ask Claude "what are you doing?" or "what tools do you have available?"

Concerned about costs?

If you're using a subscription, costs aren't a concern for learning but you can check your usage with the command /usage. If you're on API, Claude can show token usage and cost in the status line.

The shift in how you work

Using Claude Code changes the nature of the work. Instead of spending 20 minutes writing a base model, you spend 20 minutes building five base models together. Refactoring becomes a conversation: "We need to standardize how we handle customer IDs across these twelve models."

The tool isn't magic. It makes mistakes. You'll review everything it does (and you should). But it shifts the work from "writing boilerplate" to "directing the work and reviewing the output."

That's a much better way to spend your time.

Getting started

Install it, authenticate, run claude in your project directory. Ask it to explain something. Then ask it to build something small. Review the output. Iterate.

You can add more configuration later: hooks, custom commands, advanced permissions. For now, just get that first useful output.

Start with the basics and build from there.