Home › Python Data & ML › Python data & ML CLAUDE.md

Python data & ML CLAUDE.md

CLAUDE.md for data science / ML repos using pandas or polars, notebooks, and reproducible pipelines.

Claude Code (CLAUDE.md)Python Data & ML

How to use

Save this as CLAUDE.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

CLAUDE.mdDownload  
# CLAUDE.md — Data & ML

## Environment
- `uv sync`; run with `uv run`. Python 3.12.
- Data lives in `data/raw` (read-only, never modify) → `data/processed` (generated).

## Rules
- Exploration can happen in `notebooks/`, but reusable logic must move to `src/` with tests.
- Prefer polars for new code; keep pandas where it already exists. Vectorize — no row-wise `apply` loops on large frames.
- Set random seeds and log them. Every experiment records params + metrics (MLflow or a JSON in `runs/`).
- Never train and evaluate on the same split; check for target leakage before reporting metrics.
- Plots: matplotlib/seaborn with labeled axes and units.
- Large files never go in git; use DVC or `.gitignore`.

## Done means
- `uv run pytest` passes, `uv run ruff check` clean, and results include the exact command to reproduce them.

Related rules

AWS CDK (TypeScript) CLAUDE.md

CLAUDE.md for AWS CDK v2 apps in TypeScript: constructs, least-privilege grants, snapshot tests, and safe deploys.

Claude Code (CLAUDE.md)AWS CDK

Bun runtime CLAUDE.md

CLAUDE.md for TypeScript projects on Bun 1.2+: bun test, Bun.serve, built-in SQLite/Postgres, and bundling.

Claude Code (CLAUDE.md)Bun

Claude Agent SDK CLAUDE.md

CLAUDE.md for building agents with the Claude Agent SDK (Python/TypeScript): options, tools, permissions, and hooks.

Claude Code (CLAUDE.md)LLM apps & agents

Code reviewer subagent (Claude Code)

A Claude Code subagent definition that reviews the current diff for bugs, security, and tests, reporting by severity.

Claude Code (CLAUDE.md)Agent workflows

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.