os-hooks

os-hooks is a command for Claude Code from CronusL-1141/AI-company. It costs 17 tokens per session (659 once invoked), scanned A, 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, 9 commands, 9 agents, 16 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, 9 commands, 9 agents, 16 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 659 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00659
Opus 5.5 $0.00007 $0.00264
Sonnet 5.5 $0.00003 $0.00132
Haiku 4.5 $0.00002 $0.00066

Measured 1mo ago against content hash 2ae672158ed3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

os-hooks scanned grade A with 0 findings 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 1mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin/commands/os-hooks.md · 57 lines

What it actually says

/os-hooks — Hook 注册面查看

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

只有一个注册面

AI Team OS 的 hook 全部注册在本会话 Claude Code 配置目录的 settings.json(未设 CLAUDE_CONFIG_DIR 时为默认配置目录),由仓库根的 install.py 写入,事件面以 plugin/hooks/hooks.json 为准(数量以该文件实测为准)。脚本运行期副本在该配置目录的 hooks/ai-team-os/。两处的实际位置先跑 aiteam paths 看:claude.settings 与 claude.main_chain_dir。

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

用法

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

操作流程

下面的 scripts/… 与 install.py 都在 AI Team OS 仓库根目录执行。install.py --update 装的是执行它的那份 checkout:先确认它在 master,不要从 .worktrees/ 里跑——旧分支会把 装机面静默装回旧版(安装器照样报 OK),worktree 会把安装钉在要删的目录上。

无参数:查看状态

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

repair 模式

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

注意

  • 改动 settings.json 前必须备份,并保留外来 hook 条目
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. 1mo ago Changed · +2 lines scan B → A 2ae672158ed3
  2. 2mo ago Changed · +4 lines 5583ef7f79eb
  3. 2mo ago Changed · -16 lines 2a93e73f447d
  4. 3mo 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 (383 stars, last pushed 13d ago), licensed MIT. It adds 17 tokens to every session and 659 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

os-hooks compared with commands from other repositories

os-hooks next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
os-hooksCronusL-1141/AI-companyCommand38313d agoMITA17Claude Code
q-researchassafkip/kipi-systemCommand137todayMITA0Claude Code
toolsfirst-fluke/fullstack-starterCommand22715d agoMITA18GitHub Copilot
agent-brain-graphSpillwaveSolutions/agent-brainCommand1222mo agoMITA16Claude Code
relaysaajunaid/caddis-pluginCommand04d agoMITA12GitHub Copilot
new-featuresaajunaid/caddis-pluginCommand04d agoMITA14GitHub Copilot
deploydatabricks-solutions/consortCommand382d agononeA0Claude Code