Claude Watch 是一款轻量级终端监控工具,可显示 Claude 进程数量和 VPN 连接状态,并在未检测到 VPN 时自动终止 Claude 进程。

Stars

22

7 天增长

暂无数据

Fork 数

2

开放 Issue

0

开源协议

MIT

最近更新

2026-07-22

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它通过实时的 VPN 检测和进程管理,防止 VPN 断开时 Claude 意外暴露,支持 macOS 和 Windows,并包含 CI 测试。

适合谁使用

  • 本地运行 Claude 并需要 VPN 安全保护的开发者
  • 担心 VPN 断线导致 IP 泄露的远程工作者
  • 希望使用终端监控的 macOS 和 Windows 高级用户
  • 需要自动化管理 Claude 进程的安全意识用户

典型使用场景

  • VPN 意外断开时自动停止所有 Claude 进程
  • 快速查看正在运行的 Claude 进程数量
  • 通过按键手动终止所有 Claude 进程
  • 同时监控 VPN 连接状态与 Claude 进程活动

项目优势

  • 轻量级,仅依赖操作系统内置工具,无需外部依赖
  • 跨平台支持 macOS(Bash)和 Windows(PowerShell)
  • 每两秒实时刷新,不填满终端回滚缓冲区
  • Windows 版本提供非破坏性自检模式,并有 CI 验证

使用前须知

  • 可能误杀命令中包含 'claude' 但非 Claude 本身的进程
  • VPN 检测可能无法覆盖所有 VPN 服务商或自定义配置
  • 没有用户可配置的白名单或黑名单,未检测到 VPN 时始终自动终止

README 快速开始

Claude Watch

Claude Watch is a lightweight, interactive macOS and Windows terminal monitor for Claude processes and VPN connectivity.

Features

  • Refreshes every two seconds without filling Terminal scrollback.
  • Shows the number of running processes whose command contains claude.
  • Detects system-managed VPNs and common third-party VPN adapters.
  • Automatically stops every matching Claude process when no VPN is detected.
  • Lets you manually stop all matching processes by pressing k.
  • Exits cleanly with x, q, or Control-C.

[!WARNING] Claude Watch intentionally terminates processes automatically whenever its VPN checks report no connection. Because matching is case-insensitive and command-line based, it may also stop other processes whose command contains claude.

macOS

Requirements: macOS, its included Bash version, and a Terminal that supports ANSI escape sequences.

Install and run:

git clone https://github.com/omidkorat/claude-watch.git
cd claude-watch
chmod +x claude-watch.sh
./claude-watch.sh

Windows

Requirements: Windows 10 or 11 and Windows PowerShell 5.1 or later.

Clone the repository, open PowerShell in its folder, and run:

powershell -NoProfile -ExecutionPolicy Bypass -File .\claude-watch.ps1

The execution-policy option applies only to that invocation and does not change the system policy.

Controls

  • Press k to stop every detected Claude process.
  • Press x or q to exit.

Status colors

  • Green: VPN connected, or no Claude processes detected.
  • Yellow: Claude is running while a VPN is connected.
  • Red: VPN disconnected, auto-kill armed, or an automatic stop was triggered.

VPN detection on macOS

Claude Watch checks, in order:

  1. Connected VPN services reported by scutil --nc list.
  2. Active utun tunnel interfaces reported by scutil --nwi.
  3. Full-tunnel routes using utun, tun, tap, ppp, or ipsec interfaces, including OpenVPN's 0/1 plus 128/1 routing pattern used by VyprVPN.

Some Apple services and third-party networking tools may also use tunnel interfaces. Review the script's behavior for your setup before relying on it as a security control.

VPN detection on Windows

The PowerShell version checks, in order:

  1. Connected Windows VPN profiles reported by Get-VpnConnection.
  2. Active adapters reported by Get-NetAdapter whose names iden

项目描述

A macOS monitor that protects Claude usage with VPN-aware automatic process control.

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

Korben00
Korben00 GitHub avatar

no-gdid

no-gdid is a PowerShell-based tool to audit and block the Windows Global Device Identifier (GDID), a per-account device ID used by Microsoft and shared with law enforcement, based on verified reverse engineering.

PowerShell
241
LewdM3at
LewdM3at GitHub avatar

PC-Cartridge-System

A hobby project that turns 2.5" SATA SSDs into physical game cartridges for your Steam library, automatically launching games or custom actions when inserted.

PowerShell
219
gd03gd031
gd03gd031 GitHub avatar

Windows-GDID-Changer

A PowerShell script for Windows 10/11 that regenerates the Global Device Identifier (GDID) by removing local session tokens and forcing a new device registration with Microsoft servers.

PowerShell
149