{"slug": "built-a-tracker-to-estimate-water-wastage-when-talking-to-claude", "title": "Built a tracker to estimate water wastage when talking to Claude", "summary": "Developer Piyush Khemka built Sip, a Claude Code status line plugin that estimates the water consumed by each AI prompt in real time. The tool displays per-response and daily water usage alongside cost, rate-limit status, and context window data, aiming to make the hidden environmental cost of large language models visible to users.", "body_md": "Sip is a fun little project built around one question: **how much water does\nit actually take to talk to Claude?** Every prompt takes a sip — literally.\nTraining and running LLMs consumes real water (datacenter cooling +\nelectricity generation), and that cost is normally invisible. Sip is a Claude\nCode status line that puts a number on it, right where you're already\nlooking, updating live as you work.\n\n```\n💧 1.2 mL · 0.5 L today\n```\n\nThat's the headline — this response's estimated water, then today's running total. Sip also shows the useful stuff you'd want from a good status line — session/daily cost, your 5-hour and weekly plan usage (with an emoji so you know at a glance how close you are to a limit), context window usage, model + effort, and your turn count. All local, all free, no extra API calls:\n\n```\n💵 $0.42 ($3.17 today) | ⚠️ 5h 45% (resets in 2h14m) · ✅ 7d 12% (resets in 3d) | 💧 1.2 mL · 0.5 L today | 🧠 50k/200k (25%) | 🤖 opus 4.8 (high effort) | 🔄 Turn: 14\n```\n\n| Segment | Shows |\n|---|---|\n💵 Cost |\nsession cost + today's running total |\n✅Usage |\n5h / 7d plan usage, with a status emoji + reset time |\n💧 Water |\nestimated water this response · today's total |\n🧠 Context |\ntokens used / window size, color-coded |\n🤖 Model & effort |\nshort model name + reasoning effort |\n🔄 Turn |\nreal user turns this session |\n\nUsage status: ✅ `<33%`\n\n· `33–66%`\n\n· 🚨 `67–84%`\n\n· 🚫 `≥85%`\n\n(same\nthresholds color the context segment). The usage segment only appears once\nyour account has rate-limit data — it's simply omitted otherwise, not shown\nwith placeholders.\n\nOn the context %:Sip computes the percentage itself from the same raw token counts shown in`used/total`\n\n(input + cache, over the model's context window — 200k, or 1M on extended-context models) so the two can never visually disagree; it only falls back to Claude Code's own`context_window.used_percentage`\n\nif the window size isn't in the payload. This can still differ from other surfaces that exclude cache or use a different denominator. Set`SIP_DEBUG=/tmp/sip.log`\n\nto capture the exact payload Claude Code sends and see the raw numbers.\n\n`jq`\n\n(`brew install jq`\n\non macOS,`apt-get install jq`\n\non Debian/Ubuntu) and`awk`\n\n(present by default on macOS/Linux).- Claude Code.\n\nTwo steps: **install the plugin**, then **run the setup command**. A plugin\ncan wire itself into the subagent panel automatically, but only you (via a\ncommand) can point Claude Code's *main* status line at it — that's a\none-time, Claude-Code-level setting.\n\nFrom GitHub:\n\n```\nclaude plugin marketplace add piyushkhemka/sip\nclaude plugin install sip\n```\n\nOr from a local checkout:\n\n```\nclaude plugin marketplace add /path/to/sip\nclaude plugin install sip\n```\n\nThis immediately wires up Sip's *subagent* status line (visible in the agent\npanel). Your main status line — the one at the bottom of the screen — isn't\nset yet; that's step 2.\n\nInside Claude Code, run:\n\n```\n/sip-setup\n```\n\nThis installs a stable, self-contained copy of `sip.sh`\n\nto `~/.claude/sip.sh`\n\nand points your `~/.claude/settings.json`\n\nat it (backing up the current file\nfirst). Because the installed copy is location-independent, Sip keeps working\neven if the plugin's versioned cache directory changes on a later update —\njust re-run `/sip-setup`\n\nafter updating the plugin to refresh the copy.\n\nReload Claude Code and you'll see the status line at the bottom of the screen.\n\nSip runs entirely locally and uses **zero API tokens** — nothing it shows,\nincluding usage and water, costs you anything or counts against your plan.\nThe remaining cost is latency, so the script is built to minimize it:\n\n**One** over the session transcript counts real user turns and sums output tokens (for the water estimate) — the payload carries no turn number, so this keeps both accurate and idempotent. It's`awk`\n\npass**skipped entirely** when the transcript hasn't grown since the last render (cached per session by byte size), which is the common case for repeated re-renders with no new messages.**One** parses the payload, derives context/usage percentages, and does the daily cost + water bookkeeping (state read into the same call via`jq`\n\ncall`--slurpfile`\n\n), with every field defensively coerced so a malformed prior record can't corrupt the run.**One tiny atomic write** persists a single`daily.json`\n\nthat self-resets when the local day changes — no per-day files, no cleanup. A lightweight`mkdir`\n\n-based lock (near-zero cost when uncontended) protects it from concurrent Claude Code sessions racing on the same file.- Portable to the\n**bash 3.2** shipped on macOS; only requires`jq`\n\nand`awk`\n\n.\n\nState lives in `${CLAUDE_PLUGIN_DATA:-${XDG_STATE_HOME:-$HOME/.claude}/sip}/daily.json`\n\n,\nalongside a small per-session transcript-scan cache.\n\nSip turns the invisible cost of a response into a number, estimated **locally\nfrom output tokens** (no network calls, still zero API tokens):\n\n```\nwater_mL = output_tokens / 1000 × K        (default K = 1.5 mL per 1,000 output tokens)\n```\n\nOutput tokens drive it because generation (decode) dominates inference energy;\ninput/prefill is far cheaper per token. The default **K = 1.5 mL / 1k output\ntokens** is the *total* footprint (cooling + electricity), derived transparently:\n\n**Energy:**~0.3–0.6 Wh per 1k output tokens — consistent with Google's first-party figure of** 0.24 Wh for a median Gemini text prompt**and GPU decode throughput.** Water intensity:**~1.1 mL/Wh on-site (Google's implied WUE, PUE 1.09) plus ~2 mL/Wh for US grid electricity generation ≈**~3 mL/Wh total**.- ⇒ ~0.4–0.6 Wh × ~3 mL/Wh ≈\n**~1.5 mL per 1k output tokens.**\n\nSanity: a typical response ≈ **1 mL**, a long one a few mL, a heavy day ~100–200\nmL. That sits between Google's **0.26 mL** (on-site only) and the widely-shared\n(and now debunked) **~500 mL \"bottle per query\"** figure, which was a large,\nold GPT-3 worst case.\n\n**This is an estimate, and the honest range is wide (~100×).** Tune it to your\nown assumptions:\n\n```\nexport SIP_WATER_ML_PER_1K_TOKENS=0.5   # conservative, on-site only (Google-scope)\nexport SIP_WATER_ML_PER_1K_TOKENS=1.5   # default, total footprint\n```\n\nWhy not derive it from cost? Price embeds margin and varies by model tier, so it's a noisier proxy for energy than tokens — Sip uses tokens.\n\nSources: [Google Cloud — measuring the environmental impact of AI inference (Aug 2025)](https://cloud.google.com/blog/products/infrastructure/measuring-the-environmental-impact-of-ai-inference)\n· [Li et al., \"Making AI Less Thirsty\" (arXiv 2304.03271)](https://arxiv.org/pdf/2304.03271)\n· [Goedecke, \"Talking to ChatGPT costs 5ml of water, not 500ml\"](https://www.seangoedecke.com/water-impact-of-ai/)\n\nThe 5-hour and 7-day (weekly) percentages are the **same numbers /usage\nshows you** — Claude Code already includes them in every status-line render\n(\n\n`rate_limits.five_hour`\n\n/ `rate_limits.seven_day`\n\n). Sip just reads them\nlocally and prints them; it makes **no extra API calls and adds nothing to your usage**— checking your usage doesn't cost you usage.\n\nEither window can be independently absent (e.g. only `five_hour`\n\npopulated\nyet); Sip shows whichever windows are present and omits the rest.\n\n- Remove the\n`statusLine`\n\nkey from`~/.claude/settings.json`\n\n(or restore a`settings.json.bak.*`\n\nbackup made by`enable.sh`\n\n). `claude plugin uninstall sip`\n\n.\n\nMIT — see [LICENSE](/piyushkhemka/sip/blob/master/LICENSE).", "url": "https://wpnews.pro/news/built-a-tracker-to-estimate-water-wastage-when-talking-to-claude", "canonical_source": "https://github.com/piyushkhemka/sip", "published_at": "2026-07-12 05:01:34+00:00", "updated_at": "2026-07-12 05:35:13.892396+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-ethics", "ai-tools", "ai-infrastructure"], "entities": ["Piyush Khemka", "Claude Code", "Sip", "Anthropic"], "alternates": {"html": "https://wpnews.pro/news/built-a-tracker-to-estimate-water-wastage-when-talking-to-claude", "markdown": "https://wpnews.pro/news/built-a-tracker-to-estimate-water-wastage-when-talking-to-claude.md", "text": "https://wpnews.pro/news/built-a-tracker-to-estimate-water-wastage-when-talking-to-claude.txt", "jsonld": "https://wpnews.pro/news/built-a-tracker-to-estimate-water-wastage-when-talking-to-claude.jsonld"}}