debug-perf

A read-only guide for diagnosing performance problems in a terminal user interface, such as freezes, slow updates, or high background CPU use. It uses stall reports and heartbeat logs produced when fleet debugging is enabled.

In plain words
What is it for?
Use it to inspect stall dumps, goroutine activity, CPU and memory usage, slow update warnings, and problems during terminal attachment.
Why use it?
It helps identify whether the interface loop is blocked or another process is consuming resources. It turns performance symptoms into evidence for a likely cause.

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/brizzai/fleet/debug-perf
Any agent
npx skills add brizzai/fleet --skill debug-perf
Clone the repo
git clone --depth 1 https://github.com/brizzai/fleet

Made for: Claude Code, Codex.

Per session 111 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,352 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00111 $0.02352
Opus 5 $0.00056 $0.01176
Sonnet 5 $0.00022 $0.00470
Haiku 4.5 $0.00011 $0.00235

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

Security

Grade A, and why

debug-perf 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 2d 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.

.claude/skills/debug-perf/SKILL.md · 162 lines

How it starts

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

Debug Performance / UI Stalls

Diagnose why the fleet TUI froze, stuttered, or felt laggy by reading the artifacts the perfwatch package writes when FLEET_DEBUG=1 is set. Read-only — report findings and recommend fixes, never edit code.

What perfwatch records

When FLEET_DEBUG=1, internal/perfwatch instruments every Update() call and continuously samples runtime state:

  • Stall dumps~/.config/fleet/stalls/<ts>_update_stall_<msgType>_<ms>ms.txt written automatically when Update() runs longer than 500ms. Re-dumps every 1.5s while still stuck. Contains: in-flight message, recent message ring buffer (last 32 with durations), full goroutine stacks (debug=2), block profile, mutex profile, GC stats.
  • Heartbeat — every 5s in ~/.config/fleet/debug.log: goroutine count, process CPU%, heap KB, total/slow update counts, max update duration. Keeps logging during attach (when the Bubble Tea loop is suspended) so background-worker CPU usage is visible even when the TUI itself isn't running.
  • Slow Update warnings — any Update() ≥100ms gets a perfwatch: slow Update msg=… duration_ms=… WARN line in debug.log even if it didn't trigger a stall dump.
  • SIGUSR1kill -USR1 $(pgrep -f 'fleet$') forces a snapshot on demand. Filename ends in _manual_sigusr1.

Step 0: Verify perfwatch is enabled

If the user hasn't set FLEET_DEBUG, no dumps exist and you can't help. Check:

grep "perfwatch: enabled" ~/.config/fleet/debug.log | tail -1

If empty, instruct the user:

Re-launch with: FLEET_DEBUG=1 ./build/fleet
Reproduce the freeze, then run /debug-perf again.

If the user reports laggy attach but no TUI stall, also tell them: while attach feels laggy, run kill -USR1 $(pgrep -f 'fleet$') from another terminal to force a snapshot of background goroutines. Stalls during attach won't trigger the watchdog (Bubble Tea loop is suspended), so manual snapshots are the only signal.

Step 1: Find the relevant dump

ls -lt ~/.config/fleet/stalls/ | head -20

Read the full file on GitHub · 162 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. 2d ago First seen · 162 lines · 111 tokens per session scan A 1543d4800df9

Subscribe to this mod's changes

debug-perf is a skill published in the GitHub repository brizzai/fleet (52 stars, last pushed 5d ago), licensed Apache-2.0. It adds 111 tokens to every session and 2,352 once invoked, about $0.0006 per session on Opus 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

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

agent-host-chat-contributions

Build and review cross-cutting agent-host chat behavior through lifecycle contributions. Use when adding turn lifecycle side effects, prompt or context injection, restored-history transformation, protocol-action observation, or when reviewing changes that add code to AgentSideEffects or AgentService.

microsoft/vscode · 56 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens