sdc-diagnose

sdc-diagnose is a skill for Claude Code, Codex from puritysb/AgentDeck. It costs 50 tokens per session (1,352 once invoked), scanned B, original, MIT.

A diagnostic workflow for AgentDeck synchronization problems between Stream Deck displays and agent terminals. It examines cursor positions, options, hooks, logs, and the bridge state machine, which is the code that controls state changes.

In plain words
What is it for?
Use it to inspect bridge journals and logs, diagnose cursor or option synchronization, trace hook ingestion, add focused regression tests, and run the project’s test suite.
Why use it?
It helps find causes of stale displays, false idle states, missed events, and action races by collecting diagnostics and checking known failure patterns.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/puritysb/agentdeck/sdc-diagnose
Any agent
npx skills add puritysb/AgentDeck --skill sdc-diagnose
Clone the repo
git clone --depth 1 https://github.com/puritysb/AgentDeck

Made for: Claude Code, Codex.

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 sdc-diagnose

README.md
[![agentmods](https://agentmods.dev/badge/skills/puritysb/agentdeck/sdc-diagnose.svg)](https://agentmods.dev/skills/puritysb/agentdeck/sdc-diagnose)
Your own site
<a href="https://agentmods.dev/skills/puritysb/agentdeck/sdc-diagnose"><img src="https://agentmods.dev/badge/skills/puritysb/agentdeck/sdc-diagnose.svg" alt="Measured on agentmods" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,352 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
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 $0.00050 $0.01352
Opus 5 $0.00025 $0.00676
Sonnet 5 $0.00010 $0.00270
Haiku 4.5 $0.00005 $0.00135

Measured 3d ago against content hash 2781a32ce703, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

sdc-diagnose 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 3d 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.

Root cause: ~/.codex/config.toml hooks not installed/migrated, or fence corrupted
.agents/skills/sdc-diagnose/SKILL.md · 152 lines

How it starts

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

AgentDeck Diagnostic Skill

Canonical diagnostic procedure for AgentDeck bridge synchronization issues between device displays and agent terminals (cursor desync, false idle, stale options, action dispatch races, hook ingestion gaps, state-machine regressions). This file is the single source of truth — .claude/skills/sdc-diagnose.md is a thin pointer to it.

Step 1: Collect Diagnostic Data

From the repo root, try the live bridge first:

cd /Users/puritysb/github/AgentDeck
agentdeck diag --tail 500 2>/dev/null || echo "Bridge not running — using journal files directly"

If the bridge isn't running, read journal/log files directly:

ls -la ~/.agentdeck/journal/ 2>/dev/null
ls -t ~/.agentdeck/journal/*.jsonl 2>/dev/null | head -1 | xargs tail -500
tail -200 /tmp/sdc-debug.log 2>/dev/null || echo "No debug log found"

If these commands fail because of sandboxing or access to user-local files, request scoped approval before relying on guesses.

Step 2: Analyze for Known Failure Patterns

2a. Cursor Desync

navigate_option followed by a stale cursor_update with conflicting indices.

Pattern: navigate_option cursor=X->Y ... cursor_update cursorIndex=X (reverted)
Root cause: PTY confirmation overwrites optimistic update
Fix: cursor authority system (A3) — optimistic suppresses PTY within 200ms

2b. False Idle

option_prompt followed by idle within 500ms.

Pattern: option_prompt (N options) ... idle_detected (< 500ms gap)
Root cause: Small chunk with "❯ No" misclassified as idle prompt
Fix: Semantic idle check (A2) — only "❯" or ">" as sole non-ws content

2c. Stale Options

option_prompt with missing or non-contiguous indices.

Pattern: option_prompt indices=[0,1,3] (missing 2)
Root cause: Buffer corruption or partial redraw parsed as complete
Fix: Buffer tail re-parse with debounce

2d. Action Dispatch Race

select_option overlapping rapid state transitions.

Pattern: select_option ... state AWAITING->PROCESSING->AWAITING (rapid cycle)
Root cause: Enter sent before arrow navigation completes
Fix: Proportional delay (A4) — 50 + |delta| * 20ms

Read the full file on GitHub · 152 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. 3d ago First seen · 152 lines · 50 tokens per session scan B 2781a32ce703

Subscribe to this mod's changes

sdc-diagnose is a skill published in the GitHub repository puritysb/AgentDeck (212 stars, last pushed 3d ago), licensed MIT. It adds 50 tokens to every session and 1,352 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.