audit-agent-speed
Skill9 starsChanged 42 days agoMITView on GitHub
Measure and fix a slow coding-agent setup: status line, hooks, instruction bloat, effort, worktree pile-up, antivirus and indexer scans. Use when "Claude is slow" or "CPU is pinned". App speed → audit-performance.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- kensaurus/skillsword for word, first seen Oct 1, 2026
Other versions1 project uses a version of this.
Word for word · 1
- kensaurus/skills★ 9100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository165 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/approved-plan-execution.mdcCursor rule
- .cursor/rules/skill-workflows.mdcCursor rule
- .cursor/rules/verification-before-completion.mdcCursor rule
- llms.txtllms.txt
- audit-accessibilitySkill
- audit-analyticsSkill
- audit-auth-flowsSkill
- audit-backend-architectureSkill
- audit-bundle-sizeSkill
- audit-cicdSkill
- audit-codemod-safetySkill
- audit-code-qualitySkill
- audit-code-reviewSkill
- audit-db-schemaSkill
- audit-doctrineSkill
- audit-env-paritySkill
- audit-fe-apiSkill
- audit-gate-logicSkill
- audit-i18nSkill
- audit-infra-costSkill
- audit-langfuse-llmSkill
- audit-llm-securitySkill
- audit-monetization-iapSkill
- audit-payment-systemSkill
- audit-performanceSkill
- audit-realworldSkill
- audit-registry-listingSkill
- audit-resilienceSkill
- audit-responsiveSkill
- audit-securitySkill
- audit-skill-conflictsSkill
- audit-ui-statesSkill
- audit-uiux-design-systemSkill
- audit-ux-journeysSkill
- audit-uxSkill
- backend-db-performanceSkill
- backend-error-handlingSkill
- backend-observabilitySkill
- backend-patternsSkill
- backend-realtimeSkill
- burndown-fullSkill
- complete-everythingSkill
- data-pipelineSkill
- data-visualizationSkill
- debug-errorSkill
- debug-fe-be-integrationSkill
- debug-sentry-monitorSkill
- deploy-npmSkill
- deploy-verifySkill
- design-apiSkill
- design-canvasSkill
- design-emailSkill
- design-frontendSkill
- design-generative-artSkill
- design-mobile-firstSkill
- design-motionSkill
- design-prdSkill
- design-systemSkill
- design-themeSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 95
Stop, plain stdout goes to the debug log only, so the agent never sees the errors while every turn waits.
- Very specific: line 110
Keep each CLAUDE.md under ~200 lines.
- Very specific: line 147
Antivirus: prefer a Dev Drive with Defender performance mode over exclusions.
- Distinctive: line 166
Before reporting, fail the run if any of these are true:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
audit-agent-speed — Make the agent setup fast again
Degree of freedom: MIXED — measurement commands [LOW freedom — run
exactly]; which fixes to recommend [HIGH freedom].
Audit-and-fix exception. Report first, then fix. Apply local, reversible fixes right away. Ask before anything that needs admin rights, touches committed config, deletes data, or changes a user preference (effort, model).
Most of an agent's turn is model time on the provider's servers, and no local tuning changes that. This skill wins back the local part: hooks, tools, builds, git, terminal rendering, and a CPU that other processes keep pinned.
This skill vs neighbors
| Skill | Owns |
| audit-agent-speed (this) | The agent host: Claude Code/Cursor config, hooks, status line, worktrees, OS scanners |
audit-performance | The product's runtime speed (Core Web Vitals, bundles, queries) |
workflow-environment-ready | Proving tools and verify commands work before a long run |
iterate-agent-harness | Turning an agent failure into a guard with a regression test |
How to reason
- Observe: measure CPU per process before blaming anything. Quote the numbers.
- Interpret: per-call cost × call rate × concurrent sessions. A 100 ms hook on every tool call across 3 agents matters; a 2 s Stop hook that runs once doesn't.
- Classify: fix now (local, reversible) / ask (admin, committed, preference) / leave.
- Verify: re-measure after each fix and report each change's effect separately.
Worked example
Observe: total CPU 100% with 3 sessions. Per-process sampling:
ccusage×5 at 49%,wmiprvse8%,MsMpEng3%. Interpret: the status line runsccusage statuslineevery 10 s per session; each run re-reads ~10 GB of transcripts, and slow runs pile up. Classify: fix now. Remove the widget (back up the config first). Verify: noccusagespawned in 2 min; total 53–72% → later ~30% as agent jobs finished (report the workload change separately from the fix).
Phase 0 — Measure (run exactly)
Windows (includes protected processes such as Defender):
$c = Get-Counter '\Process(*)\% Processor Time' -SampleInterval 5 -MaxSamples 1 -ErrorAction SilentlyContinue
$cores = (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors
$c.CounterSamples | Where-Object { $_.InstanceName -notin '_total','idle' -and $_.Status -eq 0 } |
Group-Object { $_.InstanceName -replace '#\d+$','' } |
ForEach-Object { [pscustomobject]@{ Name=$_.Name; Count=$_.Count; Cpu=[math]::Round((($_.Group | Measure-Object CookedValue -Sum).Sum)/$cores,1) } } |
Sort-Object Cpu -Descending | Select-Object -First 15macOS / Linux: ps -eo pcpu,comm --sort=-pcpu | head -20 (macOS: ps -Ao pcpu,comm -r | head -20).
Take 3–4 samples over ~30 s. Avoid heavy Get-CimInstance Win32_Process
loops while measuring; they inflate wmiprvse themselves.
Phase 1 — Status line
- A status line runs on every assistant message (debounced at 300 ms).
statusLine.refreshIntervaladds timed runs on top; leave it unset unless a widget needs a clock. - Widgets that re-read transcripts on every render (
ccusage statusline, transcript-parsing HUDs) scale with transcript volume × sessions. Prefer widgets that only read the JSON Claude Code passes on stdin (cost, context window, rate limits). Keepccusageas an on-demand CLI. - Cache slow git calls (ccstatusline:
gitCacheTtlSeconds≥ 30). - Source: https://code.claude.com/docs/en/statusline
Phase 2 — Hooks
Inventory every hook in ~/.claude/settings.json and each repo's
.claude/settings.json, then time each one (echo '{}' | <command>).
- Per-tool-call hooks (
PreToolUsewith matcher*,PostToolUseonEdit|Write) spawn a process per call. Narrow withmatcheror theiffield (permission-rule syntax) so non-matching calls never spawn. - Per-edit lint/format that blocks for seconds duplicates
lint-stagedat commit and rewrites files under the agent (forcing re-reads). Remove it when pre-commit already runseslint --fix. - Synchronous Stop typecheck is invisible cost. For most events, including
Stop, plain stdout goes to the debug log only, so the agent never sees the
errors while every turn waits. Replace it with
scripts/stop-typecheck.mjs registered with
asyncRewake: true: background, skip-if-unchanged, wakes the agent only on a new error set. Copy it to<repo>/.claude/hooks/and pass the repo's typecheck script name. - Source: https://code.claude.com/docs/en/hooks (Exit code 0,
async,asyncRewake,if)
Phase 3 — Instruction files and search scope
- AGENTS.md is skipped when any CLAUDE.md exists in the working directory or
above it, which includes a parent folder holding all your repos. Load both
with user settings
"pluginConfigs": { "agents-md@builtin": { "options": { "instructionFiles": "claude-md-and-agents-md" } } }(ignored in project settings). Source: https://code.claude.com/docs/en/memory - Keep each CLAUDE.md under ~200 lines;
@importsload at launch and don't save context. Run/doctor prompt-auditto find bloat. - Worktree folders inside the repo that are not gitignored (
.worktrees/) make every Grep/Glob walk each copy and return duplicate hits. Add them to.git/info/exclude(local, no commit) or.gitignore. Check:git check-ignore -v .worktrees/xand comparerg --files | wc -lbefore and after.
Phase 4 — Effort and models
- Lower effort is faster and cheaper; Opus 5.5 defaults to
medium. A globalxhighslows every routine turn. Suggesthigh(or the default) with/effort xhighfor hard tasks. On Opus 5.5, changing effort keeps the prompt cache. - The built-in Explore agent inherits the main model. A user agent named
Explorewithmodel: haikuoverrides it for fast, cheap searches. - Fast mode (
/fast): up to 2.5× faster output at a higher per-token price, billed from usage credits on subscriptions; enable at session start. - These are preferences: recommend, then ask. Sources: https://code.claude.com/docs/en/model-config, https://code.claude.com/docs/en/sub-agents, https://code.claude.com/docs/en/fast-mode
Phase 5 — Worktree pile-up
Agents create worktrees faster than anyone removes them. Inventory with
git worktree list --porcelain per repo and classify:
- KEEP: uncommitted changes, locked, path in a running process's command
line, or activity in the last 24 h. Measure activity from
HEADandlogs/HEADmtimes in the worktree's git dir, notindex:git statusrewrites the index and makes every worktree look fresh. - SAFE: clean, idle, and either merged into the default branch or its PR
branch is
[gone]on the remote (squash merges). - REVIEW: clean, but holds commits not on the default branch.
Report the counts and list; remove SAFE ones only on approval, with
git worktree remove (never --force).
Phase 6 — Operating system (Windows examples)
- Antivirus: prefer a Dev Drive with Defender performance mode over
exclusions. Process exclusions (
node.exe,git.exe) skip scanning of everything those processes write, so flag them as risk, not as a speed fix. Source: https://learn.microsoft.com/en-us/windows/dev-drive/ - Search indexer: exclude the repos folder via Settings → Privacy &
security → Searching Windows → Add an excluded folder. The
PreventIndexingCertainPathspolicy key was observed to be ignored on Windows 11 Home; verify any exclusion with a probe file. - Vendor utilities that query WMI on every process start (observed:
Alienware Command Center's
AWCC.SCSubAgent, ~8% CPU) scale with agent process churn. Attributewmiprvseload by enabling theMicrosoft-Windows-WMI-Activity/Tracechannel for ~20 s (admin) and groupingClientProcessId. Killing the sub-agent doesn't stick if a service respawns it; the fix is uninstalling the utility, which is the owner's call. - Power plan on AC and Best performance; background terminals are throttled harder on battery.
Self-critique
Before reporting, fail the run if any of these are true:
- A cause was named without a per-process measurement behind it
- A fix was credited with a drop that a workload change explains
- A hook or setting was changed without timing it before and after
- A worktree, exclusion, or user preference was changed without approval
- An exclusion or policy was reported as working without a probe that proves it
Report
| # | Finding | Measured | Fix | Status (fixed / ask / leave) |Then a before/after CPU table, the list of changed files with backups, and what's left for the owner (admin prompts, committed config, preferences).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

