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

> Source: <https://dev.to/ayaanrustagi/i-made-claude-lock-me-out-of-coding-until-i-drink-water-71>
> Published: 2026-07-21 20:17:22+00:00

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](https://github.com/ayaanrustagi/hydration-hostage)

Curious if anyone's built similar "self-accountability via local tool" setups for Claude or other agents.
