Skip to main content

What is a Step Template?

Last updated 5 min read

A step template represents a recurring prompt turn or tool call detected within captured coding agent sessions, such as slash commands and skill invocations in Claude Code. Unlike request templates that classify entire API requests, step templates evaluate within-session actions, tracking execution frequency, subsequent human follow-up turns, and tool-use efficiency.

A step template represents a specific, recurring action detected inside multi-turn coding agent sessions, such as those ingested from Claude Code or Claude Cowork. Rather than evaluating an entire multi-turn interaction as a single unit, step templates isolate individual skills, slash commands, or tool invocations to measure how effectively those steps perform.

Step templates versus LLM request templates

In Coolhand, standard LLM request templates classify top-level API calls or entire conversation sessions. When you send independent completions or group operations into a workload, request templates identify the overall prompt structure and route the entire request.

In contrast, captured coding agent sessions frequently span dozens of turns containing user prompts, model responses, context injections, and tool executions. A single session represents one overarching log, but may contain several distinct developer workflows. Step templates operate within that session log:

  • LLM request templates group and measure whole sessions or individual API requests.
  • Step templates identify and analyze recurring steps—such as invoking a custom skill or running a specific tool—taking place across the turns of a session.

Multiple step templates can match within the same session.

Prompt steps and tool steps

Coolhand distinguishes between two step template types:

  • Prompt step (prompt_step): Matches a specific user turn or skill invocation, such as a custom slash command (for example, /test or /review-pr). Coolhand matches prompt steps using a pattern applied against user turns.
  • Tool step (tool_step): Matches the execution of a specific tool called by the assistant across agent turns.

Once a step template is published, its type is fixed and cannot be changed.

Run efficiency and metrics

Step templates track how often your team uses specific agent skills and what happens after they run. Coolhand aggregates these into run metrics:

  • Activity counts: Each step template reports sessions_count (the number of distinct agent sessions in which the step appeared), occurrences_count (total invocations across all sessions), and last_seen_at.
  • User turns after invocation: For prompt steps, Coolhand measures how many human user turns followed the invocation. Tool results and automated context injections are not counted as human turns. A high number of follow-up turns often indicates that a skill required manual correction or additional steering before completing its task.
  • Interactive vs. automated cohorts: Prompt step efficiency breaks down into cohorts:
    • interactive: Runs where a user continued typing follow-up messages after the step ran.
    • automated: Runs with zero follow-up turns from a human, representing headless execution (such as CI workflows or scripted runs).
    • all: The aggregate across both interactive and automated runs.
  • Tool usage: Step templates report tool_stats, detailing the percentage of runs that utilized specific tools and the average number of calls per run.
  • Assistant requests and tool calls: Coolhand tracks avg_requests and avg_tool_calls occurring during and after the step invocation.

Data availability and limitations

  • Token metrics: Per-turn token distributions (median_tokens, p90_tokens, tokens_per_tool_call) require assistant messages in the captured transcript to report per-message token usage. Because current session transcripts report usage only for the final response, per-turn token metrics are currently null, and tokens_available reports false. Turn counts, request counts, and tool calls remain fully available.
  • Tool steps: Tool steps do not report invocation efficiency cohorts (efficiency is null) because tool calls can occur repeatedly throughout an agent run rather than at a single discrete triggering turn.
  • Data retention: Sessions older than 90 days have their message content removed in accordance with data retention policies. Turn counts and occurrence statistics survive, but content-dependent stats exclude scrubbed sessions.

Querying step templates via API and MCP

You can inspect step templates programmatically using either the REST API or Model Context Protocol (MCP) tools. Both interfaces require your private API key.

REST API

The REST API exposes two read-only endpoints:

  • GET /api/v2/step_templates: Lists published step templates. Accepts optional filters for search (case-insensitive name match) and step_type (prompt_step or tool_step). Add include_metrics=true to include the metrics object (capped at 25 records per page when metrics are requested).
  • GET /api/v2/step_templates/{id}: Retrieves a single step template by its integer ID. Metrics are included by default; pass include_metrics=false to omit them.

Draft or failed step templates return 404 Not Found.

MCP tools

If you interact with Coolhand via an AI agent or development assistant, two MCP tools provide access to step templates:

  • list_step_templates: Lists published step templates for your account, with optional search, step_type, and include_metrics parameters.
  • get_step_template: Retrieves a single step template and its metrics by passing step_template_id.

For more on setting up coding agent ingestion, see How do I capture my agent skills' runs in Coolhand?.

Related articles