hook

hook is a skill for Claude Code from darkroomengineering/cc-settings. It costs 39 tokens per session (919 once invoked), scanned A, original, MIT.

A guide for creating reusable React hooks, which are functions that share component behavior such as authentication or scrolling.

In plain words
What is it for?
Use it when extracting reusable logic from a React component or creating a new hook such as useAuth or useScroll.
Why use it?
It removes the guesswork around where to place a hook and which project conventions to follow in Next.js and React Router projects.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions Codex.

Part of the darkroom plugin — 23 skills, 10 agents, 4 hooks shipped together

Good fit Use it when extracting reusable logic from a React component or creating a new hook such as useAuth or useScroll.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/darkroomengineering/cc-settings/hook
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 darkroomengineering/cc-settings --skill hook
Clone the repo
git clone --depth 1 https://github.com/darkroomengineering/cc-settings

Made for: Claude Code.

Or install darkroom, the plugin that ships this one along with the rest of its 23 skills, 10 agents, 4 hooks.

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 hook

README.md
[![agentmods](https://agentmods.dev/badge/skills/darkroomengineering/cc-settings/hook/github.svg)](https://agentmods.dev/skills/darkroomengineering/cc-settings/hook)
Your own site
<a href="https://agentmods.dev/skills/darkroomengineering/cc-settings/hook"><img src="https://agentmods.dev/badge/skills/darkroomengineering/cc-settings/hook/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 hook

Your own site · 80×15
<a href="https://agentmods.dev/skills/darkroomengineering/cc-settings/hook"><img src="https://agentmods.dev/badge/skills/darkroomengineering/cc-settings/hook.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 919 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 pass 7 Sept 2026
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.00039 $0.00919
Opus 5.5 $0.00016 $0.00368
Sonnet 5.5 $0.00008 $0.00184
Haiku 4.5 $0.00004 $0.00092

Measured 4d ago against content hash 0c16c55c9730, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

hook 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 4d 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.

skills/hook/SKILL.md · 94 lines

How it starts

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

Create Custom Hook

Create a custom React hook following Darkroom conventions. The hook itself is stack-agnostic — what differs between satus and novus is the path alias.

Step 1 — Check existing abstractions

Apply the Laziness Ladder before scaffolding, even when the request proposes a hook name. Search project hooks, utilities, and callers by behavior and related terms; read matching implementations to check their contract and import path. Prefer a matching project hook, including wrappers around hamo, over direct dependency calls or a new wrapper. If one fits, use it and stop here.

For example, in Satus, search for useDeviceDetection, isDesktop, and media-query usage before adding useIsDesktop or repeating a breakpoint string. When the local contract matches the requirement, use const { isDesktop } = useDeviceDetection() with the verified local import. Check breakpoint semantics and server/initial render behavior; do not assume every media query means the same thing.

If no project abstraction fits, check runtime/platform APIs and installed dependencies. For common hook behavior, check installed hamo hooks using the documentation procedure below. Before creating a hook, name the implementations checked and the behavior they lack; then continue only for that gap.

Step 2 — Detect stack

Read package.json:

  • dependencies.next → satus / Next.js (path alias @/, hooks require a 'use client' boundary)
  • dependencies["react-router"] → novus / React Router (path alias ~/, components isomorphic)

Step 3 — Choose location

Stack Hook path
satus lib/hooks/<name>.ts
novus hooks/<name>.ts (novus puts hooks/ at the project root)

Confirm by checking the existing lib/hooks/ or hooks/ directory structure if either pattern is unclear from package.json alone.

Step 4 — Emit template

// lib/hooks/<name>.ts (novus: hooks/<name>.ts)
'use client' // satus only, hooks live in the client boundary; novus is isomorphic, omit it
// Client Components can prerender on the server. Read browser APIs in effects
// or event handlers, with the same initial state on the server and browser.

import { useState, useEffect } from 'react'

interface Use<Name>Options {
  // Hook configuration options
}

interface Use<Name>Return {
  // Return type definition
}

export function use<Name>(options?: Use<Name>Options): Use<Name>Return {
  // Implementation
  return {
    // Return values
  }
}

Read the full file on GitHub · 94 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. 4d ago Changed · -44 lines 0c16c55c9730
  2. 25d ago Changed · +9 lines 650e2e5d2d88
  3. 1mo ago Changed · -3 tokens per session 8fe290c958f9
  4. 1mo ago Changed · +9 lines 340069076cb9
  5. 1mo ago First seen · 120 lines · 42 tokens per session scan A b46341b0c8f9

Subscribe to this mod's changes

hook is a skill published in the GitHub repository darkroomengineering/cc-settings (52 stars, last pushed yesterday), licensed MIT. It adds 39 tokens to every session and 919 once invoked, about $0.0002 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

Other skills, from other repositories

vercel-react-best-practices

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance…

artivilla/agents-config · 67 tokens

vercel-composition-patterns

React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.

artivilla/agents-config · 58 tokens

next-best-practices

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling.

artivilla/agents-config · 38 tokens

frontend-ui-dark-ts

Build dark-themed React applications using Tailwind CSS with custom theming, glassmorphism effects, and Framer Motion animations. Use when creating dashboards, admin panels, or data-rich interfaces with a refined dark aesthetic.

microsoft/skills · 48 tokens

zustand-store-ts

Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state/action separation. Use when building React state management, creating global stores, or implementing reactive state patterns with Zustand.

microsoft/skills · 42 tokens

airflow-plugins

Builds Airflow 3.1+ plugins that embed FastAPI apps, custom UI pages, React components, middleware, macros, and operator links directly into the Airflow UI. Use when building anything custom inside Airflow 3.1+ that involves Python and a browser-facing interface - creating an Airflow plugin, adding a custom UI page or…

astronomer/agents · 147 tokens