Session Profiler logo

Session Profiler

Community
tamdogood
session-profiler

Profile and debug Hermes sessions from their JSONL transcripts. Find a session and its subagents, build a queryable event table, summarize the work as a hierarchical table of contents, break down wall time, inference, tools, tokens, and estimated cost per agent, identify errors and improvement opportunities, and export a shareable Perfetto trace. Use when a user wants to inspect what a Hermes session did, debug agent or subagent activity, understand session cost or latency, create a session timeline, generate a trace, or learn how to improve the next agent run.

Overview

Publishertamdogood
Repositorybuilder-essential-skills
Skill namesession-profiler
Stars
225
Forks
8
Bundled files
13
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 13 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by tamdogood on GitHub. Read the source before you install it.

Installation

Install the Session Profiler AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/tamdogood/builder-essential-skills/tree/main/skills/session-profiler
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/tamdogood/builder-essential-skills.git /tmp/builder-essential-skills
mkdir -p .claude/skills
cp -r /tmp/builder-essential-skills/skills/session-profiler .claude/skills/session-profiler
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Session Profiler in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Session Profiler on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Session Profiler is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Session Profiler

Turn one Hermes main transcript plus its subagent transcripts into analysis artifacts. Route every operation through the bundled wrapper so it uses a consistent environment and remembers the latest parsed work directory.

bash
SP="$SKILL/scripts/sp"

Resolve SKILL to this skill's directory. If it is unavailable, use the absolute path to scripts/sp beside this file.

Workflow

  1. Find and inspect the session.
bash
$SP projects
$SP list [--provider hermes] [--n 20]
$SP list --project-dir "${HERMES_HOME:-$HOME/.hermes}/sessions"
$SP find <session-id-prefix>
$SP info <session-id-or-path>

Hermes stores rollouts under ${HERMES_HOME:-~/.hermes}/sessions/YYYY/MM/DD/rollout-*.jsonl and archived rollouts under archived_sessions/. Hermes subagent rollouts identify their parent thread recursively in session_meta.

  1. Parse the session before analyzing it. Re-run this for a session that is still active.
bash
$SP parse <session-id-or-main-jsonl-path>

The command prints and remembers its work directory. It writes events.parquet, events.csv, and agents.json. Override the remembered directory with global --data-dir <dir> or SESSION_DATA_DIR.

  1. Start with a readable profile, then narrow the investigation.
bash
$SP brief
$SP agent-summary
$SP costs
$SP slowest-tools --n 20 [--agent <id-or-name>]
$SP tool-breakdown [--agent <id-or-name>]
$SP inference-vs-tool
$SP errors
$SP turns
$SP timeline 2026-07-08T19:14:00Z --window 120
$SP events [--agent main] [--tool Bash] [--grep rebase] [--since 2026-07-08] [--n 30] [--long]

Use brief first when explaining a session to a person. It writes brief.md with the session's headline metrics, standout slow paths or failures, prompt trail or TOC storyline, and an agent scoreboard. Use the table commands for specific questions after the brief identifies the interesting region.

For ad hoc pandas analysis, set SESSION_DATA_DIR, add scripts/ to PYTHONPATH, and use from session_profiler.dataset import load; df = load() inside the wrapper's venv.

  1. Summarize the session and preserve lessons for the next run.
bash
$SP toc --dry-run
$SP toc
$SP review

Use toc --dry-run to inspect the sanitized, junk-free digest. toc builds a local chronological table of contents and writes toc.json plus toc.md without calling an external agent CLI. Show toc.md to orient the user. review writes review.md with deterministic observations about failed calls, slow paths, active-time mix, delegation, and estimated cost. Turn those observations into concrete changes to prompts, tool batching, preflight checks, or subagent assignments; do not claim the profiler automatically changes agent behavior.

  1. Build and open the trace.
bash
$SP trace
$SP open

Load the emitted trace.json.gz in Perfetto. Read it top-down: Session overview gives the whole run, Table of contents shows the story when toc.json exists, each agent's work timeline shows inference and tools, prompt trail marks user turns, and usage tokens + cost shows cumulative counters. Click a slice to inspect sanitized input/output previews, duration, concurrency, failure state, token count, and estimated cost.

Interpretation Rules

Trust these derivations instead of recomputing them from raw rows:

  • For transcript-style JSONL, deduplicate usage per API message.id: content-block records repeat a growing usage snapshot, so keep only the final snapshot once. For Hermes, consume last_token_usage once per token_count event and treat cached_input_tokens as a subset of input tokens.
  • Sum tokens across agents. Subagent token usage lives in the subagent transcript, not the parent transcript.
  • Measure a tool from tool_use to its matching tool_result within the same transcript. Treat multiple tool uses sharing one assistant message as concurrent.
  • Measure inference from the first to last assistant record for one message ID. Do not treat human idle time as inference.
  • Measure each subagent's wall runtime from the first to last timestamp in its own transcript, not from the parent's spawn tool span.
  • Treat active-time totals as sums of spans, not wall time. Concurrent tools and agents can make summed active time exceed elapsed wall time.
  • Label all dollar values as estimates. Hermes uses model-specific public API rates when the model is known, including long-context multipliers recorded by the pricing docs. Subscriptions, credits, priority processing, tool fees, and negotiated rates can differ; an unknown model is marked unavailable instead of guessed.

Privacy And Failure Handling

  • Treat transcripts and traces as sensitive. Previews redact long opaque tokens and common auth/cookie headers, but can still contain source code, prompts, paths, personal data, or secrets. Review before sharing and share only where the session owner would.
  • Expect UTC timestamps throughout.
  • If parsing a growing transcript, rerun parse immediately before final analysis.
  • If dependency bootstrap fails, report the uv or pip error and let the user fix local network/package configuration. Do not add machine-specific proxy settings to this skill.
  • If toc cannot build a table of contents from the parsed data, keep the parsed data and analyses; use toc --dry-run as the session digest and explain which timestamps or events were missing.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Session Profiler AI skill do?

Profile and debug Hermes sessions from their JSONL transcripts. Find a session and its subagents, build a queryable event table, summarize the work as a hierarchical table of contents, break down wall time, inference, tools, tokens, and estimated cost per agent, identify errors and improvement opportunities, and export a shareable Perfetto trace. Use when a user wants to inspect what a Hermes session did, debug agent or subagent activity, understand session cost or latency, create a session timeline, generate a trace, or learn how to improve the next agent run.

Why use Session Profiler on TypingMind?

Because you install it once and use it with any model. Session Profiler is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Session Profiler in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/tamdogood/builder-essential-skills/tree/main/skills/session-profiler. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Session Profiler?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Session Profiler?

As many as you like. As long as a model supports skills, you can use Session Profiler with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Session Profiler AI skill free?

Yes. It is published on GitHub by tamdogood under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇