neuron-explorer
Steering-first neuron explorer for Qwen3.5-4B: push every MLP neuron, keep every rollout, browse the results
翻译准备中
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证正在加载完整 README。 以下为已保存的摘录。
Flight computer for Claude Code — log rotation, watchdog, crash bundles, and MCP self-awareness.
Claude Guardian is a local reliability layer that keeps Claude Code sessions healthy. It detects log bloat, disk pressure, and hangs before they cause problems, captures evidence when things go wrong, and exposes an MCP server so Claude can self-monitor mid-session.
Rotates old logs (gzip), trims oversized .jsonl/.log files to their last N lines. Every action is logged to a journal file for traceability.
Creates a zip containing:
• summary.json — system info, file siz查看完整 README ↗Flight computer for Claude Code — log rotation, watchdog, crash bundles, and MCP self-awareness.
Claude Guardian is a local reliability layer that keeps Claude Code sessions healthy. It detects log bloat, disk pressure, and hangs before they cause problems, captures evidence when things go wrong, and exposes an MCP server so Claude can self-monitor mid-session.
| Command | Purpose |
|---|---|
preflight | Scan Claude project logs, report oversized dirs/files, optionally auto-fix |
doctor | Generate a diagnostics bundle (zip) with system info, log tails, journal |
run -- <cmd> | Launch any command with watchdog monitoring, auto-bundle on crash/hang |
status | One-shot health check: disk free, log sizes, warnings |
watch | Background daemon: continuous monitoring, incident tracking, budget enforcement |
budget | View and manage the concurrency budget (show/acquire/release) |
mcp | Start MCP server (10 tools) for Claude Code self-monitoring |
npm install -g @mcptoolshop/claude-guardian
Or run directly:
npx @mcptoolshop/claude-guardian preflight
claude-guardian status
=== Claude Guardian Preflight ===
Disk free: 607.13GB [OK]
Claude projects: C:\Users\<you>\.claude\projects
Total size: 1057.14MB
Project directories (by size):
my-project: 1020.41MB
Issues found:
[WARNING] Project log dir is 1020.41MB (limit: 200MB)
[WARNING] File is 33.85MB (limit: 25MB)
[guardian] disk=607.13GB | logs=1057.14MB | issues=2
claude-guardian preflight --fix
Rotates old logs (gzip), trims oversized .jsonl/.log files to their last N lines. Every action is logged to a journal file for traceability.
claude-guardian doctor --out ./bundle.zip
Creates a zip containing:
summary.json — system info, file size report, preflight resultslog-tails/ — last 500 lines of each log filejournal.jsonl — every action the guardian has ever takenprocess.json — snapshot of running Claude processes at bundle timetimeline.json — reconstructed chronological event timelinestate.json — current daemon state (if daemon was running)incidents.jsonl — incident history (if any)claude-guardian run -- claude
claude-guardian run --auto-restart --hang-timeout 120 -- node server.js
The watchdog:
--hang-timeout seconds → captures a doctor bundleRegister the guardian as a local MCP server so Claude can self-monitor:
Add to ~/.claude.json:
{
"mcpServers": {
"guardian": {
"command": "npx",
"args": ["@mcptoolshop/claude-guardian", "mcp"]
}
}
}
Then Claude can call:
| Tool | What it returns |
|---|---|
guardian_status | Disk, logs, processes, hang risk, budget, attention level |
guardian_preflight_fix | Runs log rotation/trimming, returns before/after report |
guardian_doctor | Creates diagnostics bundle (zip), returns path + summary |
guardian_nudge | Safe auto-remediation: fix logs if bloated, capture bundle if needed |
guardian_budget_get | Current concurrency cap, slots in use, active leases |
guardian_budget_acquire | Request concurrency slots (returns lease ID) |
guardian_budget_release | Release a lease when done with heavy work |
guardian_recovery_plan | Step-by-step recovery plan naming exact tools to call |
guardian_preview_ready | Poll a port until the dev server responds (use after preview_start) |
guardian_preview_recover | Diagnose stuck preview sessions, classify project type, guide recovery |
This lets Claude say: "Attention is WARN. Running guardian_nudge, then reducing concurrency."
The guardian_preview_ready and guardian_preview_recover tools solve the race condition where preview_start returns success before the dev server is actually listening — which causes the browser to land on chrome-error:// and get stuck.
Workflow: preview_start → guardian_preview_ready (wait gate) → preview_snapshot
For non-web projects (Tauri, .NET MAUI, CLI tools), guardian_preview_recover detects the project type and returns "skip preview" guidance, avoiding false positives from the built-in preview verification hook.
Three knobs (everything else is hardcoded with sane defaults):
| Flag | Default | Description |
|---|---|---|
--max-log-mb | 200 | Max project log directory size in MB |
--hang-timeout | 300 | Seconds of inactivity before declaring a hang |
--auto-restart | false | Auto-restart on crash/hang |
Plus one hardcoded guardrail:
Claude Guardian is local-only. It has no network listener, no telemetry, and no cloud dependency.
What it reads: ~/.claude/projects/ (log files, sizes, modification times), process list (CPU, memory, uptime, handle counts for Claude-related processes via pidusage).
What it writes: ~/.claude-guardian/ (state.json, budget.json, journal.jsonl, doctor bundles). All files are under the user's home directory.
What it collects in bundles: System info (OS, CPU, memory, disk), log file tails (last 500 lines), process snapshots, and guardian's own journal. No API keys, tokens, credentials, or user content.
Dangerous actions — what Guardian will NOT do:
SIGKILL, no SIGTERM)If process killing or auto-restart is ever added, it will be behind an explicit opt-in flag, documented here, and off by default.
Guardian is hardened for continuous daily use:
withStateLock and withBudgetLock serialize concurrent file I/O, preventing TOCTOU races between the daemon and MCP toolspollInProgress flag so slow polls can't stackMath.max(0, ...) to handle system clock adjustmentsstate.json or budget.json files are backed up and reset with a journal entry for forensicslastEnumerationError instead of silently swallowednpm install
npm run build
npm test
| Category | Score | Notes |
|---|---|---|
| A. Security | 10/10 | SECURITY.md, local-only, no telemetry, no cloud |
| B. Error Handling | 10/10 | GuardianError (code+hint+cause), structured MCP errors, exit codes |
| C. Operator Docs | 10/10 | README, CHANGELOG, HANDBOOK, SHIP_GATE, walkthrough |
| D. Shipping Hygiene | 10/10 | CI + tests (203), dep-audit, npm published |
| E. Identity | 10/10 | Logo, translations, landing page, npm listing |
| Total | 50/50 |
MIT
Built by MCP Tool Shop