explaingit

lorenliu13/claude-code-for-hydrology

Analysis updated 2026-06-24

44PythonAudience · researcherComplexity · 2/5LicenseSetup · easy

TLDR

A teaching repo with nine before-and-after Claude Code exercises that use real hydrology tasks like streamflow stats, drought indices, and USGS gauge data.

Mindmap

mindmap
  root((claude-hydrology))
    Inputs
      Vague prompt
      Specific prompt
      USGS data
    Outputs
      Code diff
      Test results
      CLAUDE.md
    Use Cases
      Train water scientists
      Practice prompting
      MCP and subagents
    Tech Stack
      Claude Code
      Python
      pytest
      AWS CLI
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Run nine paired exercises to see how a specific prompt produces better code than a vague one for hydrology tasks.

USE CASE 2

Practice plan mode, /init, and CLAUDE.md generation on a real Python project with tests.

USE CASE 3

Build custom Claude Code skills like /hydro-context and /flow-report for reusable water science knowledge.

USE CASE 4

Orchestrate coder and reviewer subagents to compute SPI drought indices across multiple time scales.

What is it built with?

Claude CodePythonpytestAWS CLIMCP

How does it compare?

lorenliu13/claude-code-for-hydrologyarccalc/dwmfixegocs-400k/dataset
Stars444345
LanguagePythonPythonPython
Setup difficultyeasyeasymoderate
Complexity2/52/54/5
Audienceresearchergeneralresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Needs Claude Code installed via npm, Python 3.10 or newer, and an Anthropic plan or API key.

MIT lets you use, modify, and ship this for any purpose, commercial or not, as long as you keep the copyright notice.

In plain English

Claude Code for Hydrology is a teaching repository aimed at water scientists and researchers who want to use Claude Code more effectively. Claude Code is a command line tool from Anthropic that lets the user pair with the Claude model on real code. The exercises in this repo use real hydrology topics such as streamflow analysis, drought indices, model performance metrics, and USGS gauge data, so the reader practices prompting on examples close to their day job. Each exercise shows a before and after prompt pattern. The reader first runs a vague prompt and sees what Claude produces, then clears the chat context, runs a more specific prompt, and compares the two outputs. The difference between the two is treated as the lesson. The repo lists nine numbered exercises grouped into foundations and workflows. Foundations are explore then plan then code with plan mode, naming specific files and symptoms in prompts, giving Claude tests so it can check its own work, and using /init to generate a CLAUDE.md file that gives Claude persistent project context. The hydrology tasks tied to these include adding a function to compute Q90 and Q95 exceedance flows, fixing a swapped mean and std in the Standardized Precipitation Index, and implementing the Nash Sutcliffe and Kling Gupta efficiency metrics. The workflow exercises cover making custom skills like /hydro-context and /flow-report for reusable domain knowledge, orchestrating a coder subagent and a reviewer subagent in sequence, using the AWS CLI from inside Claude to fetch public hydrology datasets, calling the USGS NWIS API through an MCP fetch server, and spawning parallel subagents to compute SPI drought indices at multiple time scales and aggregate them with a reporter subagent. Prerequisites are Claude Code installed through npm, Python 3.10 or newer, and a terminal. Each exercise folder has a test file you can run with pytest. The repo is MIT licensed.

Copy-paste prompts

Prompt 1
Walk me through exercise 3 of claude-code-for-hydrology and write the Q90 and Q95 exceedance flow function, then run the pytest file.
Prompt 2
Use the SPI exercise from claude-code-for-hydrology to fix the swapped mean and std in my own drought index code.
Prompt 3
Set up an MCP fetch server in Claude Code to pull USGS NWIS gauge data following the recipe in claude-code-for-hydrology.
Prompt 4
Adapt the parallel subagent SPI exercise from claude-code-for-hydrology to compute Standardized Streamflow Index at 1, 3, 6, and 12 month windows.

Frequently asked questions

What is claude-code-for-hydrology?

A teaching repo with nine before-and-after Claude Code exercises that use real hydrology tasks like streamflow stats, drought indices, and USGS gauge data.

What language is claude-code-for-hydrology written in?

Mainly Python. The stack also includes Claude Code, Python, pytest.

What license does claude-code-for-hydrology use?

MIT lets you use, modify, and ship this for any purpose, commercial or not, as long as you keep the copyright notice.

How hard is claude-code-for-hydrology to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is claude-code-for-hydrology for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.