Skip to content
프로젝트

소개

Block distracting websites unless Claude Code is actively running inference.

개발 도구

이 수치를 측정하는 방법

What you can do

  • Soft blocking — Sites show a modal overlay, not a hard block
  • Real-time updates — No page refresh needed when state changes
  • Multi-session support — Tracks multiple Claude Code instances
  • Emergency bypass — 5-minute bypass, once per day

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Claude Blocker

Block distracting websites unless Claude Code is actively running inference.

The premise is simple: if Claude is working, you should be too. When Claude stops, your distractions come back.

How It Works

┌─────────────────┐     hooks      ┌─────────────────┐    websocket    ┌─────────────────┐
│   Claude Code   │ ─────────────► │  Blocker Server │ ◄─────────────► │ Chrome Extension│
│   (terminal)    │                │  (localhost)    │                 │   (browser)     │
└─────────────────┘                └─────────────────┘                 └─────────────────┘
       │                                   │                                   │
       │ UserPromptSubmit                  │ tracks sessions                   │ blocks sites
       │ PreToolUse                        │ broadcasts state                  │ shows modal
       │ Stop                              │                                   │ bypass button
       └───────────────────────────────────┴───────────────────────────────────┘
  1. Claude Code hooks notify the server when you submit a prompt or when Claude finishes
  2. Blocker server tracks all Claude Code sessions and their working/idle states
  3. Chrome extension blocks configured sites when no session is actively working

Quick Start

1. Install the server

npx claude-blocker --setup

This installs the Claude Code hooks and starts the server. The hooks are configured in ~/.claude/settings.json.

2. Install the Chrome extension

  • Download from Chrome Web Store (coming soon)
  • Or load unpacked from packages/extension/dist

3. Configure blocked sites

Click the extension icon → Settings to add sites you want blocked when Claude is idle.

Default blocked sites: x.com, youtube.com

Server CLI

# Start with auto-setup (recommended for first run)
npx claude-blocker --setup

# Start on custom port
npx claude-blocker --port 9000

# Remove hooks from Claude Code settings
npx claude-blocker --remove

# Show help
npx claude-blocker --help

Features

  • Soft blocking — Sites show a modal overlay, not a hard block
  • Real-time updates — No page refresh needed when state changes
  • Multi-session support — Tracks multiple Claude Code instances
  • Emergency bypass — 5-minute bypass, once per day
  • Configurable sites — Add/remove sites from extension settings
  • Works offline — Blocks everything when server isn't running (safety default)

Requirements

  • Node.js 18+
  • Chrome (or Chromium-based browser)
  • Claude Code

Development

# Clone and install
git clone https://github.com/t3-content/claude-blocker.git
cd claude-blocker
pnpm install

# Build everything
pnpm build

# Development mode
pnpm dev

Project Structure

packages/
├── server/      # Node.js server + CLI (published to npm)
├── extension/   # Chrome extension (Manifest V3)
└── shared/      # Shared TypeScript types

Privacy

  • No data collection — All data stays on your machine
  • Local only — Server runs on localhost, no external connections
  • Chrome sync — Blocked sites list syncs via your Chrome account (if enabled)

See PRIVACY.md for full privacy policy.

License

MIT © Theo Browne

관련 프로젝트 살펴보기

불러오는 중…