coding-agents-hooks-authoring

coding-agents-hooks-authoring is a skill for Claude Code from griddynamics/rosetta. It costs 31 tokens per session (1,327 once invoked), scanned A, original, Apache-2.0.

A guide for creating and testing Rosetta hooks, which are small programs that react to coding-agent or editor events.

In plain words
What is it for?
Use it to add hooks, register new tool-event categories, fix hooks that do not run, and test their build setup.
Why use it?
It explains where hooks and their helper files belong and how they are included in builds for five coding tools.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: mentions Codex.

Good fit Use it to add hooks, register new tool-event categories, fix hooks that do not run, and test their build setup.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/griddynamics/rosetta/coding-agents-hooks-authoring
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add griddynamics/rosetta --skill coding-agents-hooks-authoring
Clone the repo
git clone --depth 1 https://github.com/griddynamics/rosetta

Made for: Claude Code.

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 coding-agents-hooks-authoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/griddynamics/rosetta/coding-agents-hooks-authoring/github.svg)](https://agentmods.dev/skills/griddynamics/rosetta/coding-agents-hooks-authoring)
Your own site
<a href="https://agentmods.dev/skills/griddynamics/rosetta/coding-agents-hooks-authoring"><img src="https://agentmods.dev/badge/skills/griddynamics/rosetta/coding-agents-hooks-authoring/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 coding-agents-hooks-authoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/griddynamics/rosetta/coding-agents-hooks-authoring"><img src="https://agentmods.dev/badge/skills/griddynamics/rosetta/coding-agents-hooks-authoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,327 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 40
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 65
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
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.00031 $0.01327
Opus 5.5 $0.00012 $0.00531
Sonnet 5.5 $0.00006 $0.00265
Haiku 4.5 $0.00003 $0.00133

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

Security

Grade A, and why

coding-agents-hooks-authoring 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.

instructions/r2/core/skills/coding-agents-hooks-authoring/SKILL.md · 89 lines

How it starts

The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.

<hooks_authoring>

Hook entry rule

Only files that export defineHook(…) AND call runAsCli(hook, module) belong directly in src/hooks/src/hooks/. Every .ts at the top level of that directory becomes a standalone CJS bundle distributed to all 5 IDEs (claude, codex, copilot, cursor, windsurf). Helper/data files without runAsCli belong in a named subdirectory: src/hooks/src/hooks/<feature>/.

Helper placement

  • Feature-local helpers → src/hooks/src/hooks/<feature>/ (e.g. src/hooks/src/hooks/dangerous-actions/patterns.ts).
  • Cross-hook runtime helpers → src/hooks/src/runtime/.

Build is non-recursive

src/hooks/scripts/build-bundles.mjs:24 uses readdirSync(hooksDir).filter(f => f.endsWith('.ts')). There is no { recursive: true }. Subdirectories are invisible to the bundler. Adding a top-level .ts without runAsCli produces a dead bundle for all 5 IDEs.

Adding a SemanticKind

When a hook needs a new tool category (e.g. mcp-call):

  1. src/hooks/src/runtime/ide-registry.ts — add a row to TOOL_KINDS with all 5 IDE columns (null where the event doesn't exist). SemanticKind = keyof typeof TOOL_KINDS so TypeScript enforces coverage.
  2. src/hooks/src/runtime/ide-rows/<ide>.ts — if the kind requires special logic (e.g. prefix-match for mcp__.*), add a conditional branch at the top of lookupToolKind in the IDE-row file before the table loop. Table-driven lookup alone cannot handle open-ended tool name patterns.
  3. Hook entry — add the new kind to def.on.toolKinds.
  4. Matcher in hooks.json.tmpl — widen to include new tool names/patterns.

Order matters: run-hook.ts:98 gates on toolKinds before calling run(ctx). Matcher passes the event in; toolKinds must include the mapped kind or the call is dropped silently.

Registration

Every new hook must appear in every plugin's hooks.json. The canonical source is plugins/core-claude/hooks/hooks.json.tmpl (and equivalent templates in other plugins). Direct edits to generated hooks.json files are overwritten on the next npx rosettify-plugins run.

Read the full file on GitHub · 89 lines

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 First seen · 89 lines · 31 tokens per session scan A 8ba3d34dfc53

Subscribe to this mod's changes

coding-agents-hooks-authoring is a skill published in the GitHub repository griddynamics/rosetta (360 stars, last pushed yesterday), licensed Apache-2.0. It adds 31 tokens to every session and 1,327 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.