lights-hooks

lights-hooks is a skill for Claude Code from fengyiqicoder/Lights. It costs 93 tokens per session (949 once invoked), scanned B, original, MIT.

A setup guide that connects Lights, a macOS menu-bar app showing Claude Code's activity as a traffic light, to Claude Code's settings.

In plain words
What is it for?
It checks that Lights is running, backs up settings.json, and adds the required lifecycle hooks while preserving existing hooks.
Why use it?
It removes the need to configure activity signals by hand and helps the traffic light reflect whether Claude Code is working, waiting for input, idle, or off.

Skill for Claude Code

Written for Claude Code: UserPromptSubmit hook event. Also seen: reads .claude/ paths; names the AskUserQuestion tool; mentions Claude Code.

Good fit It checks that Lights is running, backs up settings.json, and adds the required lifecycle hooks while preserving existing hooks.

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

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 lights-hooks

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/fengyiqicoder/lights/skill"><img src="https://agentmods.dev/badge/skills/fengyiqicoder/lights/skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 949 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 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.00093 $0.00949
Opus 5.5 $0.00037 $0.00380
Sonnet 5.5 $0.00019 $0.00190
Haiku 4.5 $0.00009 $0.00095

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

Security

Grade B, and why

lights-hooks scanned grade B with 2 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.

Reads agent configuration directoriesmediumAgent snooping

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

cp ~/.claude/settings.json ~/.claude/settings.json.bak-lights-$TS

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

correctly, Claude Code fires curl requests on lifecycle events and the
skill/SKILL.md · 117 lines

How it starts

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

Install Lights Hooks for Claude Code

Lights listens on http://127.0.0.1:9876 for state signals. When configured correctly, Claude Code fires curl requests on lifecycle events and the floating traffic light reflects current activity.

Step 1 — Verify Lights is running

Run:

curl -s --max-time 1 http://127.0.0.1:9876/status

Expected output: idle, executing, permission, or off.

If the curl fails or hangs:

  • Tell the user: "Lights app isn't running. Launch /Applications/Lights.app (or open Lights.app from the source repo) and then re-invoke this skill."
  • Stop. Do not proceed with config changes.

Step 2 — Back up settings.json

TS=$(date +%Y%m%d-%H%M%S)
cp ~/.claude/settings.json ~/.claude/settings.json.bak-lights-$TS

Step 3 — Merge the hooks

Read ~/.claude/settings.json as JSON. Ensure the top-level hooks key exists (create as {} if missing). For each of the five events below, add a new hook entry — preserve any existing hooks the user has.

Idempotency rule

Before adding each hook, scan all existing commands in the target event array. If any command already contains 9876/<endpoint> for that endpoint, skip — do not duplicate.

Hooks to add

All commands share these properties:

  • type: "command"
  • timeout: 2000
  • Stream output to /dev/null, suffix || true so a missing Lights never blocks Claude Code
Event Matcher Endpoint
UserPromptSubmit (none) /executing
Notification (none) /permission
Stop (none) /idle
PreToolUse AskUserQuestion|ExitPlanMode /permission
PostToolUse AskUserQuestion|ExitPlanMode /executing

Command template:

curl -s --max-time 1 http://127.0.0.1:9876/<endpoint> >/dev/null 2>&1 || true

Merge structure

Each event in hooks is an array of entries. Each entry has:

  • optional matcher (regex)
  • hooks: array of {type, command, timeout} objects

When adding to an event:

  1. If an entry with the same matcher already exists → append the new hook to that entry's hooks array.
  2. Otherwise → create a new entry with the matcher + the single hook.

Read the full file on GitHub · 117 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 117 lines · 93 tokens per session scan B 97bffa6ab98b

Subscribe to this mod's changes

lights-hooks is a skill published in the GitHub repository fengyiqicoder/Lights (5 stars, last pushed 5mo ago), licensed MIT. It adds 93 tokens to every session and 949 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it B with 2 findings (reads agent configuration directories, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.