Skip to content

Repository files navigation

🛡 Sentinel

A Chrome extension that uses AI to block short-form video doom scrolling on macOS.

Sentinel runs silently in the background. When you open YouTube, it intercepts the video title and asks Claude whether it's worth your time. Mindless content gets blocked. Coding tutorials, lectures, and anything educational gets through. On X.com, it enforces a 5-minute daily scroll limit that gradually slows you down before locking you out entirely.


What it blocks

Platform What's blocked What's allowed
YouTube Shorts, non-work videos (AI-judged) Tutorials, coding, lectures, documentaries
TikTok Everything
Instagram Reels Photos, profiles
X / Twitter Video feed tab, doom-scroll mode Normal browsing (with 5-min limit)

X.com scroll limiter

Time on X.com Behaviour
0 – 2 min Normal
2 – 5 min Scroll progressively slows. A bar shows time remaining
5 min Full stop. Lockout overlay with countdown
+2 hours Timer resets

How it works

You open a YouTube video
        ↓
content.js extracts the title + shows "Evaluating..." overlay
        ↓
background.js calls http://127.0.0.1:54321/judge?title=...
        ↓
native/server.js (always running via macOS LaunchAgent)
  → runs: claude --model claude-haiku-4-5-20251001 -p "ALLOW or BLOCK?"
        ↓
Claude Haiku replies in ~1 second
        ↓
ALLOW → overlay fades, video plays
BLOCK → Sentinel blocked page

No API key needed. Sentinel uses your existing Claude Code installation and its credentials.


Requirements


Installation

git clone https://github.com/shawkatdidar/sentinel.git
cd sentinel
bash native/install.sh

The install script will:

  1. Install npm dependencies and build the extension
  2. Generate the extension icons
  3. Create and load a macOS LaunchAgent so the judge server starts on every login
  4. Print instructions to load the extension in Chrome

Load into Chrome

  1. Open chrome://extensions
  2. Enable Developer mode (top right toggle)
  3. Click Load unpacked → select the dist/ folder inside this repo
  4. Done — Sentinel is active

Customising the judge

Edit the PROMPT function in native/server.js to change what gets blocked or allowed. The default prompt:

  • ALLOW: coding, programming, AI/ML, data science, math, science, DevOps, productivity, finance, business, documentaries, lectures, professional skills
  • BLOCK: reality TV, celebrity gossip, pranks, reaction videos, vlogs, sports highlights, music videos, cooking shows, comedy skits

Restart the server after editing:

launchctl unload ~/Library/LaunchAgents/com.sentinel.judge.plist
launchctl load  ~/Library/LaunchAgents/com.sentinel.judge.plist

Viewing logs

tail -f ~/path/to/sentinel/native/sentinel.log

Project structure

sentinel/
├── manifest.json          Chrome extension manifest (MV3)
├── src/
│   ├── background.ts      Service worker — proxies judge requests
│   ├── content.ts         Injected into YouTube/X/Instagram — overlays + scroll limiter
│   └── blocked.ts         Blocked page logic
├── public/
│   └── blocked.html       The "Sentinel blocked this" page
├── rules/
│   └── rules.json         declarativeNetRequest rules (Shorts, TikTok, Reels)
├── native/
│   ├── server.js          Local HTTP judge server (calls claude CLI)
│   └── install.sh         One-command setup
└── scripts/
    └── generate-icons.js  Generates extension icons (no native deps)

Uninstall

launchctl unload ~/Library/LaunchAgents/com.sentinel.judge.plist
rm ~/Library/LaunchAgents/com.sentinel.judge.plist

Then remove the extension from chrome://extensions.

About

AI-powered Chrome extension that blocks short-form video doom scrolling. Uses Claude Haiku as a local content judge.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages