diagnose-hid-keycodes

diagnose-hid-keycodes is a skill for Claude Code from terrylica/cc-skills. It costs 32 tokens per session (2,083 once invoked), scanned B, original, MIT.

A troubleshooting workflow for finding the keyboard signals sent by an unknown USB or Bluetooth button device. It uses Karabiner and its event viewer to display the raw signals instead of trusting labels or manuals.

In plain words
What is it for?
Use it to inspect macro pads, mouse buttons, foot pedals, and other human-interface devices before creating input mappings or documenting them.
Why use it?
Mislabelled or multi-mode devices may send different signals than expected, making button mappings fail. This identifies what the operating system actually receives.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the macro-keyboard plugin — 3 skills shipped together , and of cc-skills

Good fit Use it to inspect macro pads, mouse buttons, foot pedals, and other human-interface devices before creating input mappings or documenting them.

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

Made for: Claude Code.

Or install macro-keyboard, the plugin that ships this one along with the rest of its 3 skills.

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 diagnose-hid-keycodes

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/terrylica/cc-skills/diagnose-hid-keycodes"><img src="https://agentmods.dev/badge/skills/terrylica/cc-skills/diagnose-hid-keycodes.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,083 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. 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 Privilege Escalation · line 134
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
  • medium Privilege Escalation · line 137
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
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.00032 $0.02083
Opus 5 $0.00016 $0.01042
Sonnet 5 $0.00006 $0.00417
Haiku 4.5 $0.00003 $0.00208

Measured 6d ago against content hash 582b77cc605d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade B, and why

diagnose-hid-keycodes 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 6d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

Do NOT query TCC.db or SQLite files under `/Library/Application Support/com.apple.TCC/` to "audit permissions" during this workflow — those queries require sudo and trigger the Touch ID prompt on every invocation. Instea
plugins/macro-keyboard/skills/diagnose-hid-keycodes/SKILL.md · 166 lines

How it starts

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

Diagnose HID Keycodes

Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.

Given an unknown macro pad, mouse button, foot pedal, or HID gadget, find out exactly what each button emits at the OS level — without guessing from labels, vendor docs, or photos. Cheap HID pads frequently ship with arbitrary or mis-labeled keycodes (the Jieli/Free3-P ships with buttons labeled top/middle/bottom emitting Ctrl+C/Ctrl+V/Ctrl+X — which isn't the cut/copy/paste convention; it's hardware-random).

When to Use This Skill

  • A new HID device arrived and you don't know what its buttons emit
  • A pad has multiple firmware modes and you need to map each mode's keycodes
  • A rule isn't firing and you suspect you guessed the wrong from.key_code
  • You need to document a device for a reproducible setup

The Three-Tool Workflow

Tool Purpose
Karabiner ignore: true Make Karabiner observe the device without grabbing it
Karabiner-EventViewer Display raw HID events as text
Quartz screencapture -l Capture EventViewer's window without stealing focus

ignore: true is the key insight: with it enabled, Karabiner doesn't remap anything but still logs the device's events — so you can see the raw keycodes the firmware emits.

Workflow

Step 1 — Identify the device's VID/PID

# USB
ioreg -p IOUSB -l -w 0 | grep -B 2 -A 6 "<product name or partial>"

# Bluetooth (after pairing)
system_profiler SPBluetoothDataType | grep -A 15 "<pad name>"

Record VID/PID in decimal (Karabiner's JSON format).

Step 2 — Add a no-op diagnostic rule (forces Karabiner to grab the device)

Why not just "ignore": true in devices[]? That tells Karabiner to leave the device entirely alone — EventViewer then won't see its events either. ignore: true is for "hands off this device," not "inspect this device."

Read the full file on GitHub · 166 lines

Files

What ships with it

2 files 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. 6d ago First seen · 166 lines · 32 tokens per session scan B 582b77cc605d

Subscribe to this mod's changes

diagnose-hid-keycodes is a skill published in the GitHub repository terrylica/cc-skills (72 stars, last pushed yesterday), licensed MIT. It adds 32 tokens to every session and 2,083 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

Other skills, from other repositories

debug-systematic

Systematic 4-phase debugging methodology for complex, intermittent, or mysterious issues. Use when investigating bugs, race conditions, or unexplained failures.

travisjneuman/.claude · 33 tokens

embedded-iot

Embedded systems firmware, microcontrollers (ESP32, STM32, Arduino, Raspberry Pi), RTOS (FreeRTOS, Zephyr), IoT protocols (MQTT, CoAP, BLE), bare-metal C/C++, and hardware peripheral interfaces (I2C, SPI, UART, GPIO). Use when developing firmware, working with microcontrollers, or building IoT devices.

travisjneuman/.claude · 80 tokens

windows-ops

Comprehensive Windows workstation operations - diagnose slow boot, failing drives, BSOD crashes, startup bloat, event logs. Use for: Windows is slow, slow bootup, won't boot, blue screen, BSOD, kernel crash, drive failing, SMART errors, disk errors, Event 41, Event 129, storahci reset, BugCheck, CRITICALPROCESSDIED…

0xDarkMatter/claude-mods · 176 tokens

backpropagation

Trace runtime bugs back to spec gaps — identify missing acceptance criteria, update specs, generate regression tests, and detect patterns.

LucasDuys/forge · 27 tokens

evidence-driven-debugging

Use during active debugging when you have a hypothesis to test or need to instrument a running system. Activate for keywords like "debug", "instrument", "log", "trace", "breakpoint", "what's happening at runtime", "production behavior". Pair to investigate-root-cause for the doing-it phase. Always record what you…

duthaho/claudekit · 87 tokens

investigate-root-cause

Use when encountering ANY bug, error, test failure, or unexpected behavior. Activate for keywords like "bug", "error", "failing", "broken", "doesn't work", "unexpected", "crash", "exception", "TypeError", "undefined", stack traces, or any error message. Also trigger when tests fail unexpectedly, when behavior differs…

duthaho/claudekit · 121 tokens