Claude Code for Data Engineers: Install, Set Up and Your First Data Project (Claude for Data Engineers Part 1)

Claude for Data Engineers · Part 1 of 10

In this post we are going to cover how to install Claude Code, sign in, and use it on a first small data project. We open a sales project, ask Claude what it does, create a CLAUDE.md file with /init, let Claude write and run a Python and DuckDB script, and the last step is checking the numbers with a second query.

Claude Code is a coding agent. It reads your project, edits files and runs commands, and you stay in control of what it does. For a data engineer that means it can look at your CSV files, your SQL and your scripts, write new code that follows your rules, and run it right there in your folder. Every command output in this post comes from really running the code.

Part 1 of the Claude for Data Engineers series on TechBrothersIT.

Let's create some sample data

Our project is called sales-pipeline. It is a small reporting repo for an online shop: a readme, a requirements.txt that pins DuckDB, two CSV exports with 16 orders and 6 customers, and one SQL query that totals the orders by status. There is no Python code yet. Here are all the starting files.

README.md
# sales-pipeline

Daily sales reporting for the online shop.

- data/  raw CSV exports from the shop
- sql/   reporting queries
requirements.txt
duckdb==2.0.0
data/orders.csv
order_id,order_date,customer_id,status,amount
5001,2026-10-01,C01,completed,120.00
5002,2026-10-01,C02,completed,75.50
5003,2026-10-02,C03,cancelled,200.00
5004,2026-10-02,C01,completed,42.00
5005,2026-10-03,C04,completed,310.00
5006,2026-10-03,C05,refunded,89.99
5007,2026-10-04,C02,completed,150.00
5008,2026-10-04,C06,completed,64.25
5009,2026-10-05,C03,completed,99.00
5010,2026-10-05,C04,cancelled,45.00
5011,2026-10-06,C05,completed,210.00
5012,2026-10-06,C06,completed,38.75
5013,2026-10-07,C01,completed,500.00
5014,2026-10-07,C02,refunded,60.00
5015,2026-10-08,C03,completed,85.50
5016,2026-10-08,C04,completed,130.00
data/customers.csv
customer_id,name,country
C01,Ava Patel,USA
C02,Liam Chen,Canada
C03,Sofia Rossi,USA
C04,Noah Weber,Germany
C05,Mia Santos,Canada
C06,Omar Haddad,Germany
sql/orders_by_status.sql
-- Orders and amount per status
SELECT status,
       count(*)    AS orders,
       sum(amount) AS amount
FROM read_csv('data/orders.csv', header = true)
GROUP BY status
ORDER BY status;

Step 1: Where Claude Code lives

Before we install anything, let's see where Claude Code shows up and what you need to use it.

Claude Code
Reads your project, edits files, runs commands. You approve what it does.

In the Claude app, the Code item in the sidebar opens Claude Code. There is also an extension for VS Code and a plugin for JetBrains IDEs. In this series we work mostly in the terminal, because that is where the commands and their output are easiest to follow.

To use Claude Code you need a Pro, Max, Ultra, Team or Enterprise plan, or a Console account. The free plan does not include Claude Code. On Pro and Max, the Claude app and Claude Code share the same usage limits, so a long coding session also counts against your chat limits.

Your sidebar may look a little different from mine, because a new layout is rolling out. The Code item is still the way in.

Step 2: Install Claude Code

Now let's install it. There is one command for each system.

INSTALL

One command, then a new terminal

WhereRun this
macOS, Linux, WSLcurl -fsSL https://claude.ai/install.sh | bash
Windows PowerShellirm https://claude.ai/install.ps1 | iex
Windows CMDcurl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
New terminal: checkclaude --version
Health checkclaude doctor

On a Mac, on Linux, or inside WSL on Windows, run the curl command. It downloads the native installer and runs it. In Windows PowerShell use the irm command, and in the Windows command prompt use the third one.

The installer shows no progress while it downloads, so give it a moment. When it finishes, open a new terminal and run claude --version. If something looks wrong, claude doctor runs a quick health check without starting a session.

You can also install with Homebrew, WinGet, or npm with Node 22 or newer. The native install updates itself in the background, so you do not have to think about upgrades.

Tip

If you install with npm, never use sudo with it.

Step 3: Sign in

Next, we sign in. Go to your project folder and run claude. The first time, Claude Code asks you to log in and your browser opens.

FIRST RUN

Sign in once, in the browser

  • cd into your project, run claude
  • Claude Code asks you to log in: the browser opens
  • Sign in with your Claude account (or a Console account)
  • No browser? Press c to copy the login URL
  • Login successful: press Enter
  • ANTHROPIC_API_KEY set? It bills the API. unset it, check /status

Sign in with your Claude account, or with a Console account if your team uses the API. If the browser does not open, press c to copy the login link and paste it into your browser yourself. When you see Login successful, press Enter and you are in.

Tip

If your shell has ANTHROPIC_API_KEY set, Claude Code asks whether to use it. If you say yes, you pay through the API, not your plan. Unset that key if you want to use your subscription, and check with /status.

Step 4: First launch

Here is the first launch in our sales project. We open a terminal in the sales-pipeline folder and type claude.

Claude Code first asks if we trust this folder, because it will be able to read, edit and run files here. This is our own project, so we choose Yes, I trust this folder.

Then the welcome header appears. It shows the Claude Code version, the model and the account, and the folder we are working in. Below it there is a notice: auto mode is now the default permission mode. In auto mode Claude checks each action for risk, runs the ones it sees as lower risk, and blocks the rest.

The status line at the bottom shows the current mode. Shift+Tab cycles through the modes, and we use that in step 7. The prompt line, between the two rules, is where you type. Plain English is fine. A ? on an empty prompt shows the keyboard shortcuts.

Step 5: Ask Claude what the repo does

Our first prompt is a plain question. Let's ask Claude Code to explain the project.

Prompt - type this in Claude Code
what does this project do?

Claude says it will start by listing the files, and it does that with a shell command. Listing files is read only, so it runs without a permission prompt. Here is the command and its real output.

Terminal - the command
find . -type f | sort
Output
./README.md
./data/customers.csv
./data/orders.csv
./requirements.txt
./sql/orders_by_status.sql

That is the whole repo: five files. Then Claude reads README.md, both CSV files and the SQL query, and gives its answer.

Claude replies

This is a small sales reporting project for an online shop:

  • data/orders.csv: 16 orders (date, customer, status, amount)
  • data/customers.csv: 6 customers with their country
  • sql/orders_by_status.sql: a DuckDB query that counts orders and sums the amount per status

There is no Python code yet. requirements.txt pins duckdb==2.0.0.

The answer matches the files: 16 orders, 6 customers, one DuckDB query that counts orders and sums the amount per status, and no Python code yet.

Tip

On a new repo at work, this is the fastest way to get your bearings. Ask what it does, then check the answer against the files yourself.

Step 6: Run /init and create CLAUDE.md

Next is the most useful command on a new project: /init. When we type a slash, the command menu opens and filters as we type. /init initializes a new CLAUDE.md file with documentation about the code.

Slash command - type this in Claude Code
/init

Claude reads the project again, README.md and the SQL query, and writes CLAUDE.md. Here is the full file.

CLAUDE.md
# CLAUDE.md

This file provides guidance to Claude Code
(claude.ai/code) when working with code in this
repository.

## Project

Daily sales reporting for an online shop. Raw CSV
exports in `data/` are queried with DuckDB.

## Layout

- `data/orders.csv`: one row per order (order_id,
  order_date, customer_id, status, amount)
- `data/customers.csv`: customer_id, name, country
- `sql/`: reporting queries in DuckDB SQL

## Commands

- Install: `pip install -r requirements.txt`
- Run a query: `duckdb -f sql/orders_by_status.sql`

## Conventions

- Use DuckDB for queries (version pinned in
  `requirements.txt`).
- Keep reporting SQL in `sql/`, one query per file.

It has what the project is, the layout, the commands to run, and the conventions. Claude Code loads this file at the start of every session, so this is where project knowledge lives.

Now let's add a business rule: revenue only counts completed orders. We do not edit the file ourselves. We just tell Claude.

Prompt - type this in Claude Code
Add a business rule to CLAUDE.md: revenue counts only completed orders

Claude edits CLAUDE.md and adds a new Business rules section at the end. Here is the file after the edit.

CLAUDE.md
# CLAUDE.md

This file provides guidance to Claude Code
(claude.ai/code) when working with code in this
repository.

## Project

Daily sales reporting for an online shop. Raw CSV
exports in `data/` are queried with DuckDB.

## Layout

- `data/orders.csv`: one row per order (order_id,
  order_date, customer_id, status, amount)
- `data/customers.csv`: customer_id, name, country
- `sql/`: reporting queries in DuckDB SQL

## Commands

- Install: `pip install -r requirements.txt`
- Run a query: `duckdb -f sql/orders_by_status.sql`

## Conventions

- Use DuckDB for queries (version pinned in
  `requirements.txt`).
- Keep reporting SQL in `sql/`, one query per file.

## Business rules

- Revenue counts only orders with status
  `completed`. Cancelled and refunded orders are
  excluded.
Tip

Review CLAUDE.md like code and commit it, so your whole team gets the same rules.

Step 7: First script and a real run

Now the first real script, written and run by Claude Code. Before we ask, we press Shift+Tab once to switch to manual mode. In manual mode Claude asks before it edits a file, or runs a command that is not read only. That is a good way to learn what it does.

We ask for a script that shows revenue per country from the orders and the customers, and then runs it.

Prompt - type this in Claude Code
Write revenue_by_country.py: revenue per country from orders and customers, then run it

Claude says it will create revenue_by_country.py with DuckDB, and that per CLAUDE.md only completed orders count. It wants to create a new file, so it asks first. We read the file and choose Yes. Next it wants to run the script, so it asks again. This time we choose Yes, and don't ask again for Python commands. Here is the script and the real output of the run.

revenue_by_country.py
import duckdb

con = duckdb.connect()
con.execute("CREATE VIEW orders AS FROM 'data/orders.csv'")
con.execute("CREATE VIEW customers AS FROM 'data/customers.csv'")


def scalar(sql):
    return con.execute(sql).fetchall()[0][0]


total = scalar("SELECT count(*) FROM orders")
done = scalar("SELECT count(*) FROM orders WHERE status = 'completed'")
print(f"Orders read: {total}, completed: {done}")

# Business rule (CLAUDE.md): revenue counts completed orders only
con.sql("""
    SELECT c.country,
           count(*)                AS orders,
           round(sum(o.amount), 2) AS revenue
    FROM orders o
    JOIN customers c USING (customer_id)
    WHERE o.status = 'completed'
    GROUP BY c.country
    ORDER BY revenue DESC
""").show()
Terminal - the command
python revenue_by_country.py
Output
Orders read: 16, completed: 12
┌─────────┬────────┬─────────┐
│ country │ orders │ revenue │
│ varchar │ int64  │ double  │
├─────────┼────────┼─────────┤
│ USA     │      5 │   846.5 │
│ Germany │      4 │   543.0 │
│ Canada  │      3 │   435.5 │
└─────────┴────────┴─────────┘

Look at the WHERE o.status = 'completed' line. Claude used only completed orders because that rule is in CLAUDE.md now. The script read 16 orders, 12 of them completed. The USA is first with 5 orders and 846.5, then Germany with 4 orders and 543.0, then Canada with 3 orders and 435.5.

Tip

Claude runs python revenue_by_country.py. If your system only has python3, use that when you run it yourself, and install the requirements first with pip install -r requirements.txt.

Step 8: Check the numbers

One more habit for real projects: check the numbers with a second query. We ask Claude to compare the script with the status query that was already in the repo.

Prompt - type this in Claude Code
Check it: does the completed total in sql/orders_by_status.sql match the countries?

This is a new command, so in manual mode Claude asks again, and we choose Yes. It runs the existing status query with the DuckDB command line tool. Note that the duckdb command is the DuckDB CLI, which you install separately from the duckdb Python package.

Terminal - the command
duckdb -f sql/orders_by_status.sql
Output
┌───────────┬────────┬────────┐
│  status   │ orders │ amount │
│  varchar  │ int64  │ double │
├───────────┼────────┼────────┤
│ cancelled │      2 │  245.0 │
│ completed │     12 │ 1825.0 │
│ refunded  │      2 │ 149.99 │
└───────────┴────────┴────────┘

The status query shows 12 completed orders for a total of 1825.0, plus 2 cancelled orders for 245.0 and 2 refunded orders for 149.99. Claude adds up the three countries from the script, 846.5 + 543.0 + 435.5, and gets the same 1825.0. So the script and the query agree, and the cancelled and refunded orders were really left out.

Tips for your own repo

Before we finish, here is what to do on your own repo on day one.

DAY ONE

Five habits for a data repo

  • Start claude in the repo root
  • Run /init, review and commit CLAUDE.md
  • Write business rules into CLAUDE.md
  • Use manual mode while you learn
  • Check the numbers with a second query

Start Claude Code in the root folder of the repo, so it sees the whole project. Run /init, then review and commit the CLAUDE.md file. Put your business rules in that file, like which orders count as revenue. Use manual mode while you learn, and read every prompt before you say yes. And ask Claude to check its own numbers with a second query, the same way we did with the status query.

That is it. Claude Code is installed, signed in, and it built and checked our first data script. In the next part we go through every Claude Code concept: plan mode, permission modes, slash commands, context, checkpoints and more.

Key points to remember

  • Install with one command
  • Sign in once in the browser
  • Trust the folder, read the screen
  • Ask what the repo does
  • /init writes CLAUDE.md
  • First script and a real run
  • Check the numbers

The full script

This bash script writes every file Claude wrote, in the same order, and runs every command, so you can reproduce the results without Claude.

Show the full script (every file and every command, in order)
Full script - bash, run it in an empty folder
#!/usr/bin/env bash
# Claude for Data Engineers #1: Claude Code for Data Engineers: Install, Set Up and Your First Data Project
# Rebuilds the demo project without Claude: writes every file Claude wrote, in the same order,
# and runs every command from the video. Run it in an empty folder.
# Tools used in the video: Python 3.13, DuckDB 2.0.0, pandas 3.0.5, PySpark 4.3.0 (local mode, Java 21),
# dbt-core 1.12.6 with dbt-duckdb 1.11.0, PostgreSQL 16. Install the ones this project uses first.
mkdir -p sales-pipeline && cd sales-pipeline

# ---------- starting files ----------
cat > README.md <<'CLAUDE_DE_EOF'
# sales-pipeline

Daily sales reporting for the online shop.

- data/  raw CSV exports from the shop
- sql/   reporting queries
CLAUDE_DE_EOF
cat > requirements.txt <<'CLAUDE_DE_EOF'
duckdb==2.0.0
CLAUDE_DE_EOF
mkdir -p data
cat > data/orders.csv <<'CLAUDE_DE_EOF'
order_id,order_date,customer_id,status,amount
5001,2026-10-01,C01,completed,120.00
5002,2026-10-01,C02,completed,75.50
5003,2026-10-02,C03,cancelled,200.00
5004,2026-10-02,C01,completed,42.00
5005,2026-10-03,C04,completed,310.00
5006,2026-10-03,C05,refunded,89.99
5007,2026-10-04,C02,completed,150.00
5008,2026-10-04,C06,completed,64.25
5009,2026-10-05,C03,completed,99.00
5010,2026-10-05,C04,cancelled,45.00
5011,2026-10-06,C05,completed,210.00
5012,2026-10-06,C06,completed,38.75
5013,2026-10-07,C01,completed,500.00
5014,2026-10-07,C02,refunded,60.00
5015,2026-10-08,C03,completed,85.50
5016,2026-10-08,C04,completed,130.00
CLAUDE_DE_EOF
mkdir -p data
cat > data/customers.csv <<'CLAUDE_DE_EOF'
customer_id,name,country
C01,Ava Patel,USA
C02,Liam Chen,Canada
C03,Sofia Rossi,USA
C04,Noah Weber,Germany
C05,Mia Santos,Canada
C06,Omar Haddad,Germany
CLAUDE_DE_EOF
mkdir -p sql
cat > sql/orders_by_status.sql <<'CLAUDE_DE_EOF'
-- Orders and amount per status
SELECT status,
       count(*)    AS orders,
       sum(amount) AS amount
FROM read_csv('data/orders.csv', header = true)
GROUP BY status
ORDER BY status;
CLAUDE_DE_EOF

# ---------- step 1: Ask Claude Code what the project does ----------
find . -type f | sort

# ---------- step 2: Run /init to create CLAUDE.md ----------
cat > CLAUDE.md <<'CLAUDE_DE_EOF'
# CLAUDE.md

This file provides guidance to Claude Code
(claude.ai/code) when working with code in this
repository.

## Project

Daily sales reporting for an online shop. Raw CSV
exports in `data/` are queried with DuckDB.

## Layout

- `data/orders.csv`: one row per order (order_id,
  order_date, customer_id, status, amount)
- `data/customers.csv`: customer_id, name, country
- `sql/`: reporting queries in DuckDB SQL

## Commands

- Install: `pip install -r requirements.txt`
- Run a query: `duckdb -f sql/orders_by_status.sql`

## Conventions

- Use DuckDB for queries (version pinned in
  `requirements.txt`).
- Keep reporting SQL in `sql/`, one query per file.
CLAUDE_DE_EOF

# ---------- step 3: Add a business rule to CLAUDE.md ----------
cat > CLAUDE.md <<'CLAUDE_DE_EOF'
# CLAUDE.md

This file provides guidance to Claude Code
(claude.ai/code) when working with code in this
repository.

## Project

Daily sales reporting for an online shop. Raw CSV
exports in `data/` are queried with DuckDB.

## Layout

- `data/orders.csv`: one row per order (order_id,
  order_date, customer_id, status, amount)
- `data/customers.csv`: customer_id, name, country
- `sql/`: reporting queries in DuckDB SQL

## Commands

- Install: `pip install -r requirements.txt`
- Run a query: `duckdb -f sql/orders_by_status.sql`

## Conventions

- Use DuckDB for queries (version pinned in
  `requirements.txt`).
- Keep reporting SQL in `sql/`, one query per file.

## Business rules

- Revenue counts only orders with status
  `completed`. Cancelled and refunded orders are
  excluded.
CLAUDE_DE_EOF

# ---------- step 4: First script: revenue per country, completed orders only ----------
cat > revenue_by_country.py <<'CLAUDE_DE_EOF'
import duckdb

con = duckdb.connect()
con.execute("CREATE VIEW orders AS FROM 'data/orders.csv'")
con.execute("CREATE VIEW customers AS FROM 'data/customers.csv'")


def scalar(sql):
    return con.execute(sql).fetchall()[0][0]


total = scalar("SELECT count(*) FROM orders")
done = scalar("SELECT count(*) FROM orders WHERE status = 'completed'")
print(f"Orders read: {total}, completed: {done}")

# Business rule (CLAUDE.md): revenue counts completed orders only
con.sql(""
    SELECT c.country,
           count(*)                AS orders,
           round(sum(o.amount), 2) AS revenue
    FROM orders o
    JOIN customers c USING (customer_id)
    WHERE o.status = 'completed'
    GROUP BY c.country
    ORDER BY revenue DESC
"").show()
CLAUDE_DE_EOF
python revenue_by_country.py

# ---------- step 5: Check the numbers with the existing SQL query ----------
duckdb -f sql/orders_by_status.sql
Next in this series

Part 2: Every Claude Code Concept Explained (for Data Engineers)

The project and its data are invented for teaching. Every file on this page is the real file from the demo project, and every output is the real output of the command above it, captured when the video was made (each step ran twice in a fresh folder and the outputs were compared). The Claude screens in the video are a simplified recreation for teaching. Always review what Claude changes and runs. Claude plans, features and limits are current as of November 2026; check the official Claude and Claude Code documentation before you rely on them. Part of the Claude for Data Engineers series on TechBrothersIT.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.