OmniscioSubagent examplesPerformance profiler
A performance profiler subagent
Profiling is the job that produces the most output for the least answer: a heap of stack samples and a single line that matters. That is the definition of a subagent's work, and the reason the report — not the profile — is the deliverable.
Anthropic's own framing is a side task that would flood the main conversation with material you will not reference again. A profile is exactly that material, and the summary is the one function that is slow.
Checked against Anthropic's Claude Code documentation on November 25, 2026. By the Omniscio team. Updated .
When Claude delegates to it
The description names the moment: something is slow and the cause is not yet known. That is narrower than it looks — a known cause needs a fix, not a profiler, and a profiler asked to fix things becomes an unmeasured refactor.
Ask by name with the symptom: "use the performance-profiler subagent, the import job takes forty minutes". Budget the runs at the same time: three runs of a forty-minute job is two hours before the profile even starts. The transcript shows the delegation row and the report beneath it, and /tasks opens the subagent's own transcript.
It cannot see your conversation, so give it the command that reproduces the slowness, or the file that runs it. An agent without a reproduction can only read code and speculate.
The file
Save this as .claude/agents/performance-profiler.md, creating the .claude/agents/ folder if the project has none yet. Steps 2 and 3 are the lines to change for your stack: the run count is a trade against how long each run takes, and the profiler command is different for Python, Node, Go and the JVM.
---
name: performance-profiler
description: Measures where time or memory goes before proposing any change, and reports the baseline, the profile and the numbers after the change. Use when something is slow and the cause is not yet known.
tools: Read, Grep, Glob, Bash
model: sonnet
---
You measure performance. You do not change code; you report what you measured and what you would try.
1. Reproduce it first. Run the command the task names, or find it in package.json or the Makefile.
If you cannot reproduce the slowness, stop and report that: an unmeasured fix is a guess.
2. Take a baseline: run the slow path at least 3 times and record every run, not only the best.
State the machine, the data size and the commit.
3. Profile the path, not a function in isolation. Use the profiler your ecosystem has: perf,
py-spy, clinic, node --prof, the JVM profiler, or the project's own timing output.
4. Name the hot path: the function, the query, the allocation. Give its share of total time or
memory, from the profile, not from reading the code.
5. Check the obvious causes before the clever ones: an N+1 query, a loop that re-reads a file, a
missing index, work repeated per item that could happen once.
6. Propose the smallest change that removes the hot path, with the expected gain and the risk.
If the profile does not justify any change, say so.
Report:
- The reproduction command and the baseline numbers, with the spread between runs.
- The profile excerpt, with the hot path marked.
- The proposal, the expected gain and what could break.
- What you could not measure.
Never quote a number you did not observe. Never describe an optimisation as faster without a
second measurement.What each field does
name
The identifier, at most 256 characters, no colon. Hooks receive it as agent_type.
description
The routing rule. "Something is slow and the cause is not yet known" is what keeps this agent off a task that already has a diagnosis, and the phrase "before proposing any change" is the promise that makes its reports trustworthy. Every description is loaded so Claude knows what it can delegate to, and the total is counted at startup.
tools
Read, Grep and Glob to find the path being timed; Bash to run it and the profiler. No Edit and no Write, so the output is a report rather than a patch. Omitting the field entirely would inherit every tool available to subagents, which is the opposite of this list.
Bash can still write, so this is a fence with a gate rather than a wall. If the risk matters, the answer is a permission rule in your settings, not a longer prompt.
model
The aliases are sonnet, opus, haiku and fable, a full model ID, or inherit. The file sets sonnet because profiling is dominated by running commands and reading output, and the cost stays the same whatever the session runs on. inherit instead takes the main conversation's model, or the spawning agent's model when this one is nested.
Project file or user file
Project. The reproduction command, the profiler and the data size are all specific to this repository, and a user-level copy would carry one project's Makefile target into every other project. Where both share a name, the project's wins.
.claude/agents/is the project's and is usually committed, so the measurement rules are shared and reviewed.~/.claude/agents/is yours and available in every project.- Duplicate names in one directory mean one file never loads;
/doctorreports the pair.
Confirm Claude picked it up
- No restart. Both directories are watched and an edit is picked up within a few seconds, except for a folder added with
--add-diror a session started with--disable-slash-commands. - Ask by name on a path you can time yourself, and compare its baseline with yours. A wild baseline is usually a cold cache or a different data size, and the report should say which.
/tasksshows the run and the model, confirming themodelline (v2.1.242 or later)./agentsprints the reminder to manage agents through Claude or the folders; the wizard was v2.1.197 and earlier.- The transcript holds the delegation row, and the report carries the commands and numbers.
When it goes wrong
- It optimises without measuring. The failure this agent exists to prevent. If the report has no baseline, the change is a guess; send it back.
- The benchmark does not match production. A thousand-row fixture benchmarks a thousand-row problem. Step 2 asks for the data size in the report for exactly this reason.
- It reports one run. One fast run out of five is noise. Every run is recorded and the spread is reported, so an improvement has to beat the spread.
- It edits anyway. It has
Bash, so a determined agent can change a file. Keep the report-only instruction in the body and review the diff; the tool list is not a permission boundary on its own. - It never launches. A
toolsentry that resolves to nothing is usually refused with an error naming the entries; an empty list, or onedisallowedToolsempties, launches with no tools.
Adapting it to your stack
- Name the profiler and the command. "Use the profiler" is a different instruction in every ecosystem.
- Set a run budget: three runs of a two-minute job is six minutes, which is fine; three runs of a forty-minute import is a decision, not a detail.
- Add your own usual suspects — the ORM query, the synchronous call in a handler, the log line inside the loop — because they are the ones your team actually hits.
- Ask for the profile artifact path, so the next person can look at the raw samples rather than the summary.
The other files are on the subagent examples page, and the subagents guide covers what a subagent costs and what it inherits.
Sources
- Anthropic's Create custom subagents, for the file format, the frontmatter reference, the tool rules, the delegation rules and what a subagent is for, read November 25, 2026.
- Anthropic's error reference, for the zero-tools refusal and its exceptions, read November 25, 2026.
- Anthropic's commands reference, for
/agentsand/tasks, read November 25, 2026.
The agent file and its report shape were written for this site. The fields and their behaviour are Anthropic's and were read from the pages above on the same day. The agent was not run against a live repository here.
Common questions
Why should the profiler not edit code?
Because an optimisation made without a measurement is a guess, and a guess in the branch looks like a considered change. The agent reports the evidence and the smallest change; you apply it with the numbers in front of you.
What should a performance report contain?
The reproduction command, the baseline with the machine and the run count, the profile that shows the hot path, the proposed change, and the number after it. A report without a baseline cannot tell an improvement from noise.
Can it run a profiler?
Yes, with Bash in its tools and the profiler installed: perf, py-spy, clinic, node --prof, or your project's timing script. Without Bash it can only read code and reason, which is the guessing this agent replaces.
How do I keep a benchmark from lying?
Benchmark the path a user takes, on data the size of production, more than once, and report the spread rather than the best run. A micro-benchmark measures the function, not the request.
Measure, then change
Omniscio is a desktop app for running Claude Code and other coding agents side by side, with one list of sessions and one inbox, so an agent only interrupts you when a decision needs you.
The features page lists what is in it today, pricing covers the plans, and you can download it for Windows, macOS or Linux.