agent-history

agent-history is a command for Claude Code from dwmkerr/claude-toolkit. It costs 8 tokens per session (636 once invoked), scanned A, original, MIT.

A command that lists the coding agents used during the current Claude Code session.

In plain words
What is it for?
Use it to see which agents ran, when they ran, and what tasks they were given.
Why use it?
It makes the session's delegated work visible without requiring you to inspect the full session file.

Command for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the toolkit plugin — 15 skills, 3 commands, 1 agent shipped together

Good fit Use it to see which agents ran, when they ran, and what tasks they were given.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add dwmkerr/claude-toolkit
Claude Code
/plugin install toolkit

Made for: Claude Code.

Or install toolkit, the plugin that ships this one along with the rest of its 15 skills, 3 commands, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-history

README.md
[![agentmods](https://agentmods.dev/badge/commands/dwmkerr/claude-toolkit/agent-history/github.svg)](https://agentmods.dev/commands/dwmkerr/claude-toolkit/agent-history)
Your own site
<a href="https://agentmods.dev/commands/dwmkerr/claude-toolkit/agent-history"><img src="https://agentmods.dev/badge/commands/dwmkerr/claude-toolkit/agent-history/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agent-history

Your own site · 80×15
<a href="https://agentmods.dev/commands/dwmkerr/claude-toolkit/agent-history"><img src="https://agentmods.dev/badge/commands/dwmkerr/claude-toolkit/agent-history.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 636 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00008 $0.00636
Opus 5 $0.00004 $0.00318
Sonnet 5 $0.00002 $0.00127
Haiku 4.5 $0.00001 $0.00064

Measured 8d ago against content hash 5dbabcd3b0ad, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

agent-history scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/toolkit/commands/agent-history.md · 93 lines

How it starts

The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent History

Show which agents were spawned during the current Claude Code session.

CRITICAL: Do NOT read the session file directly - it's too large. Use the Bash tool to run grepsession.sh which filters efficiently.

Instructions

  1. Use Bash to run grepsession.sh

    ${CLAUDE_PLUGIN_ROOT}/scripts/grepsession.sh '"name":"Task"'
    

    This outputs matching lines with line numbers from the current session.

  2. Parse the output

    Each line is JSONL with this structure:

    {
      "type": "assistant",
      "timestamp": "2025-01-05T09:23:15.123Z",
      "message": {
        "content": [
          {
            "type": "tool_use",
            "name": "Task",
            "input": {
              "description": "Research Claude plugins",
              "subagent_type": "dwmkerr:researcher",
              "prompt": "..."
            }
          }
        ]
      }
    }
    

    Extract:

    • Line number: from grep prefix (e.g., 1247:{...})
    • Time: from .timestamp
    • Agent: from .message.content[].input.subagent_type
    • Description: from .message.content[].input.description
  3. If you need more context

    ${CLAUDE_PLUGIN_ROOT}/scripts/grepsession.sh '"name":"Task"' -C 5
    

    Or use Read tool with offset/limit on the session file.

  4. To find what triggered each agent

    Look for the most recent user message before each agent. User messages have this structure:

    {
      "type": "user",
      "timestamp": "2025-01-05T09:23:00.000Z",
      "message": {
        "content": "are there github repos showing how to check skills?"
      }
    }
    
  5. Display results

    Format timestamps as relative time (e.g., "3m ago", "1h ago", "2d ago").

    ## Agents Spawned This Session
    
    | Line | When     | Agent          | Task                         | Triggered By               |
    |------|----------|----------------|------------------------------|----------------------------|
    | 1247 | 2h ago   | researcher     | Research Claude plugins      | "are there github repos..."
    | 1389 | 1h ago   | researcher     | Clone and examine repo       | "are there github repos..."
    
    **Total**: 2 agents spawned
    

Read the full file on GitHub · 93 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 93 lines · 8 tokens per session scan A 5dbabcd3b0ad

Subscribe to this mod's changes

agent-history is a command published in the GitHub repository dwmkerr/claude-toolkit (23 stars, last pushed 2d ago), licensed MIT. It adds 8 tokens to every session and 636 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.