harness-profiler
Records every skill, agent, and tool call of a Claude Code session and shows which calls share a context and what each costs in tokens.
At a Glance
harness-profiler core tool released under the MIT License; free to use, copy, modify, and distribute.
Engagement
Available On
Alternatives
Listed Nov 2026
About harness-profiler
harness-profiler is an open-source profiler for Claude Code setups made of skills, subagents, and memory files, created by Aleksandr Furmanov. It records what Claude Code reports through hooks and renders a call tree with timings and token costs, as a text tree or a UML-style sequence diagram. The latest listed release is v0.2.2.
What It Is
harness-profiler is a profiling tool for agentic Claude Code workflows. When a setup does not behave as expected, takes too long, or uses too many tokens, it shows what happened underneath: which skill or subagent was called, in which context, and what each context spent.
How the trace is built
The plugin registers hooks that run after every tool call, when a subagent stops, when a session starts, and around compaction. Each hook appends a JSON line to .harness-profile/<session-id>.jsonl at the git root, and that folder is added to .git/info/exclude so traces stay out of commits. The tree command reads these lines and rebuilds which call started which subagent and which subagent made each call. Token figures (new, cached, output) come from Claude Code's transcript of each context.
Reading the output
The HTML output is a sequence diagram in which each vertical bar is a context, meaning a conversation history the model reads. Subagents and forked skills get their own colors, inline skills appear as diamonds, and non-overlapping contexts share a column. The text tree lists start time, duration with a bar, token counts, name and kind, where the call ran, arguments, and the first line of the result. --verbose adds every tool call, and --branch covers all sessions on a branch.
Setup path
It requires Node 18 or newer and git. It installs as a Claude Code plugin from a marketplace, or on Claude Code on the web by running init claude through npx to commit the hook into the repository. A doctor command checks the installation, and a /show-profile skill renders the profile inside a session. Everything runs locally unless /show-profile is used in a cloud session.
Tradeoffs to know
The README documents several constraints. The trace records token counts, not their content, and the transcript format is undocumented. Inline skill costs are folded into the caller's. Only tool calls the model makes are captured. On Windows the hook needs Git Bash or WSL. Codex is not yet supported.
Community Discussions
Be the first to start a conversation about harness-profiler
Share your experience with harness-profiler, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
harness-profiler core tool released under the MIT License; free to use, copy, modify, and distribute.
- MIT License
- Records skill, agent, and tool calls of a Claude Code session
- Call tree with timings and token costs
- Sequence diagram trace view
- Claude Code plugin or committed hook install
Capabilities
Key Features
- Call tree with timings and token costs for Claude Code sessions
- UML-style sequence diagram where each bar is a context
- Text tree output with duration bars and token columns
- Token breakdown into new, cached, and output tokens
- Verbose mode showing every tool call
- Per-branch and per-session trace selection
- /show-profile skill for rendering the profile in a session
- doctor command to verify installation
- Local JSONL trace storage excluded from git
- Dependency-free single-file implementation
