cd /news/artificial-intelligence/i-made-claude-lock-me-out-of-coding-… · home topics artificial-intelligence article
[ARTICLE · art-67594] src=dev.to ↗ pub= topic=artificial-intelligence verified=true sentiment=· neutral

I Made Claude Lock Me Out of Coding Until I Drink Water

A developer built an MCP server for Claude that enforces hydration checks via webcam, using YOLOv8 nano to detect a cup or bottle every 30 minutes. If the state is 'locked,' Claude refuses to help with coding. The system runs fully locally and includes a stale-data fallback and manual unlock.

read1 min views1 publishedJul 21, 2026

I have a bad habit: multi-hour coding sessions where I completely forget to drink water. So I built a small MCP server for Claude that enforces hydration checks via webcam.

How it works

A background script (watcher.py) checks the webcam every 30 minutes using YOLOv8 nano — a small, fast, fully local object detector — looking for a cup or bottle. The result gets written to a state file. An MCP server exposes a check_hydration_status() tool that Claude is instructed to call before responding; if the state is "locked," Claude refuses to help.

Is this real enforcement?

No, and I want to be honest about that. Claude follows this because it's told to, not because anything technically blocks it from responding. You can absolutely tell it to ignore the check. It's an accountability nudge, not a hard lock.

The part I actually cared about getting right

I didn't want a crashed webcam script to leave me stuck. So the MCP server checks the timestamp on the last reading — if it's more than an hour old, it reports the data as stale instead of trusting a dead lock. There's also a manual --unlock flag as a hard reset.

Privacy

Everything runs locally. The webcam frame never leaves your machine, and Claude never sees the image, only a short text status.

Repo: https://github.com/ayaanrustagi/hydration-hostage Curious if anyone's built similar "self-accountability via local tool" setups for Claude or other agents.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @claude 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-made-claude-lock-m…] indexed:0 read:1min 2026-07-21 ·