os-hooks

os-hooks is a command for Claude Code from CronusL-1141/AI-company. It costs 17 tokens per session (641 once invoked), scanned B, original, MIT.

A command for checking and repairing Claude Code Hooks, which are scripts Claude Code runs when certain events happen. It checks the global hook settings, the repository definitions, and the installed runtime scripts.

In plain words
What is it for?
Use it to view hook registration status or repair the global registration with `/os-hooks` and `/os-hooks repair`. It also runs a consistency check after repair.
Why use it?
It helps find missing, duplicated, or inconsistent hooks, including project settings that could cause an event to run twice.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; mentions Claude Code.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 scripts/check_hook_surface.py.

Part of the ai-team-os plugin — 5 skills, 8 commands, 25 agents, 15 hooks, 1 MCP server shipped together

Good fit Use it to view hook registration status or repair the global registration with /os-hooks and /os-hooks repair. It also runs a consistency check after repair.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/CronusL-1141/AI-company
agentmods
npx agentmods add commands/cronusl-1141/ai-company/os-hooks

Made for: Claude Code.

Or install ai-team-os, the plugin that ships this one along with the rest of its 5 skills, 8 commands, 25 agents, 15 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for os-hooks

README.md
[![agentmods](https://agentmods.dev/badge/commands/cronusl-1141/ai-company/os-hooks/github.svg)](https://agentmods.dev/commands/cronusl-1141/ai-company/os-hooks)
Your own site
<a href="https://agentmods.dev/commands/cronusl-1141/ai-company/os-hooks"><img src="https://agentmods.dev/badge/commands/cronusl-1141/ai-company/os-hooks/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for os-hooks

Your own site · 80×15
<a href="https://agentmods.dev/commands/cronusl-1141/ai-company/os-hooks"><img src="https://agentmods.dev/badge/commands/cronusl-1141/ai-company/os-hooks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 641 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00017 $0.00641
Opus 5 $0.00009 $0.00320
Sonnet 5 $0.00003 $0.00128
Haiku 4.5 $0.00002 $0.00064

Measured 12d ago against content hash 0284fc5d0eb6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade B, and why

os-hooks scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

AI Team OS 的 hook **全部注册在全局 `~/.claude/settings.json`**,由仓库根的
plugin/commands/os-hooks.md · 67 lines

What it actually says

/os-hooks — Hook 注册面查看

你需要帮助用户查看 AI Team OS 的 Claude Code Hooks 注册状态。

只有一个注册面

AI Team OS 的 hook 全部注册在全局 ~/.claude/settings.json,由仓库根的 install.py 写入,事件面以 plugin/hooks/hooks.json 为准(数量以该文件实测为准)。 脚本运行期副本在 ~/.claude/hooks/ai-team-os/

不要向项目级 .claude/settings.local.json 写 AI Team OS 的 hook——与全局链并存会让每个事件双发。

用法

  • /os-hooks — 查看当前注册状态
  • /os-hooks repair — 重装/修复注册面

操作流程

无参数:查看状态

  1. 读取 ~/.claude/settings.jsonhooks 段,列出事件与 matcher。
  2. 跑一次三方一致性机检(注册面是否与仓库定义对得上):
    python3 scripts/check_hook_surface.py
    
  3. 确认运行期脚本目录存在且非空:~/.claude/hooks/ai-team-os/
  4. 如果用户项目里存在 .claude/settings.local.json 且其 hooks 段含 send_event.py,那是会造成事件双发的残留:先把内容展示给用户, 征得同意后再删掉该 hooks 段。

repair 模式

  1. 说明将要改动 ~/.claude/settings.json(先备份)。
  2. 执行:
    python3 install.py --update
    
    该命令按脚本名白名单清理我方旧条目后按 HOOK_SURFACE 重建, 外来 hook(用户自己的守卫脚本等)会被原样保留。
  3. 复跑 python3 scripts/check_hook_surface.py 确认全绿。

输出格式

状态查看

## Hooks 注册状态

注册面: ~/.claude/settings.json(全局,唯一)
已注册 <N> 个事件 / <M> 条(按实读列出事件名)

运行期脚本: ~/.claude/hooks/ai-team-os/(<K> 个)
API 目标: http://localhost:<api_port.txt>/api/hooks/event
三方一致性机检: ✅ install.py ↔ hooks.json ↔ README

注意

  • 所有输出使用中文
  • 改动 ~/.claude/settings.json 前必须备份,并保留外来 hook 条目
  • 确保 API 服务已启动:/os-up
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 67 lines · 17 tokens per session scan B 0284fc5d0eb6

Subscribe to this mod's changes

os-hooks is a command published in the GitHub repository CronusL-1141/AI-company (357 stars, last pushed today), licensed MIT. It adds 17 tokens to every session and 641 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.