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.
0 Comments
Log in to join the conversation.No comments yet. Be the first to share your thoughts.