/magician:accelerate [what is slow] [target, e.g. p99<500ms]from magician
Profiles and optimizes performance with a baseline-first approach. Use when something is slow or must hit a latency/throughput target. Guides through defining targets, measuring baselines, and iterating on fixes.
Ships in magician. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Bundled command: if
kgis not found, run it as${CLAUDE_PLUGIN_ROOT}/tools/kgand give subagents that full path. If that is missing too (Claude chat ships no plugin tools), skip thekgsteps and search the code directly.
Profile and optimize performance systematically. No optimization without measurement.
Scale /effort to the optimization scope: low for a single hot path, high for cross-cutting work. (Haiku and the 4.5 generation have no effort axis at all — don't suggest a level there.)
Scope the work with the knowledge graph when the repo is indexed: kg query "<slow area>" to locate the hot code and kg blast/kg neighbors to see what it touches — so you profile and change the right thing, in fewer tokens than grepping.
Ask both questions in one message:
"Before I start profiling, two quick questions:
- What specifically is slow? (page load, API response, query, computation — be as specific as possible)
- What's the acceptable performance target? (e.g., 'under 200ms', 'p99 < 500ms')"
End your turn. Wait for both answers before proceeding to Phase 2. Do not run any benchmarks until you have a defined target.
After the Phase 1 gate (the two target answers — what's slow, and the acceptable target), run Phases 2–5 autonomously: reading, searching, kg query/blast, read-only git, and every profiling read, baseline, and benchmark go ahead without a confirmation question from you. Claude Code still shows its own permission prompt for commands this skill does not pre-approve (benchmarks, profilers) unless the session is in auto mode or the user already allowed them. After baseline + profiling, show the proposed Phase 4 targeted fix ONCE for approval; the bounded evaluator-optimizer loop then iterates without per-round prompts.
Re-gate only on real side effects — applying the fix (file edits) and any git add/commit/push. See lore/autonomy.md.
Measure current performance using the appropriate tool:
API:
wrk -t4 -c100 -d30s http://localhost:8080/api/endpoint
# or: hey -n 1000 -c 50 http://localhost:8080/api/endpoint
Web (browser): Use the Lighthouse CLI if it is already installed (or the project's own Lighthouse script):
lighthouse http://localhost:3000 --output json --output-path baseline.json
Python:
import cProfile, pstats
profiler = cProfile.Profile()
profiler.enable()
# ... run the slow code ...
profiler.disable()
stats = pstats.Stats(profiler).sort_stats('cumulative')
stats.print_stats(20)
Go:
import _ "net/http/pprof"
// Then: go tool pprof http://localhost:6060/debug/pprof/profile
Record baseline numbers.
Use the profiler to identify the actual bottleneck. The bottleneck is where the most time is spent — not the most obvious place.
Fix ONLY the identified bottleneck. Common fixes:
Run the same benchmark as Phase 2. Compare: baseline vs. optimized.
This is a bounded evaluator-optimizer loop: if the target isn't met, return to Phase 3 and attack the next bottleneck — but stop after a few rounds, when a round's marginal gain is negligible, or when the /effort/token budget is exhausted, then report the best result with the target marked met/not-met. Never loop indefinitely. For long benchmarks or load tests, start them with the Bash tool's background option and read the output when Claude Code reports the command finished, instead of blocking the turn.
For a result worth circulating, you can publish the baseline→optimized report as a Claude Code Artifact (a live page on claude.ai, team-co-editable on Team/Enterprise) — offer it, don't create it unprompted. Publishing to a public link (anyone with the URL can view it) is an outward sharing action: confirm it, keep it account-private by default, and never expose proprietary/internal system detail or secrets to a public link.
Dashboard offer. Offer a Dashboard artifact (a page that re-runs its queries) only when both conditions hold:
Ask once, in one sentence, after the Phase 5 report. Do not build it without a yes. Keep it account-private, and never put credentials in the page.
If this skill runs as a dispatched unit and hits something that blocks or degrades the work, do not wait for a human who is not there and do not silently ship a degraded result — return the Obstacles block from lore/obstacles.md (fields: STATUS, OBSTACLE, BLOCKER, SEVERITY, WORKAROUND, RECURRENCE, SCOPE, NEXT) to the caller alongside whatever you completed; interactively, say the same in prose.
"Accelerate complete. Baseline: . Optimized: . Improvement: %. Target <met/not met>."
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
performance-profiling, optimization, latency, throughput, benchmarking
npx claudepluginhub alexander-tyagunov/magician --plugin magician25 skills in this plugin
/almanacOne-time workspace setup; .workspace/, .gitignore, CLAUDE.md, optional AGENTS.md and REVIEW.md. Run once per project./autopsyBlameless post-mortem / RCA; timeline, 5-Whys, action items, committed write-up. Use after an incident or outage./blueprintTurns an approved spec into a TDD task plan, parallelism map and plan.md + plan.html. Use after spec approval, before coding./certifyVerification loop; tests, types, lint, build, Playwright for UI; evidence before success claims. Use to verify a change is green./chronicleSession history, references, context size, learnings. Use to review past sessions, remember or recall a reference, or capture learnings./confluenceConfluence via the bundled CLI; read, search (CQL), summarize, create/update, comment, label. Use for any Confluence page or space request, incl. a remembered space.Other plugins' skills for the same job