Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/lanegrid/agtrace/labgit clone --depth 1 https://github.com/lanegrid/agtraceWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.00556 |
| Opus 5 | $0.00000 | $0.00278 |
| Sonnet 5 | $0.00000 | $0.00111 |
| Haiku 4.5 | $0.00000 | $0.00056 |
Grade A, and why
lab 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 98 lines — stays where its author put it; the contents beside it link to each section on GitHub.
agtrace lab
Advanced history search and analysis for AI coding agent sessions.
Overview
The lab command provides powerful tools for searching and analyzing session history at scale:
- Search across thousands of sessions
- Inspect raw provider events
- Analyze tool usage patterns
Commands
lab grep
Search session history by pattern.
agtrace lab grep <PATTERN> [OPTIONS]
Arguments:
PATTERN- Text or regex pattern to search for in session events
Options:
--json- Output matching events in JSON format--raw- Show raw provider events (before normalization)--limit N- Limit results to N matches--provider <PROVIDER>- Filter by provider (claude_code, codex, gemini)--type <TYPE>- Filter by event type (ToolCall, ToolResult, User, Message, etc.)--tool <TOOL>- Filter by tool name (only for ToolCall events)
Examples:
Search for tool calls:
agtrace lab grep "write_file" --json
Find MCP usage (raw events):
agtrace lab grep "mcp" --raw --limit 1
Search for specific tool usage:
agtrace lab grep "Read" --type ToolCall --limit 5
Use Cases
Analyze Tool Usage Patterns
Find all instances of a specific tool across sessions:
agtrace lab grep "read_file" --json | jq '.[] | {session: .session_id, tool: .tool_name}'
Debug Schema Changes
Inspect raw provider events to understand schema changes:
agtrace lab grep "content_block" --raw --limit 5
Find Specific Agent Behaviors
Search for specific assistant outputs or reasoning:
agtrace lab grep "refactor" --json
Extract Data for Analysis
Export matching events for external analysis:
agtrace lab grep "error" --json > errors.json
python analyze_errors.py errors.json
Performance
lab grep is optimized for searching large log directories:
- Searches are parallelized across sessions
- Raw log files are scanned directly (no intermediate database)
- Matches are streamed incrementally
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.
- 2d ago First seen · 98 lines · 0 tokens per session scan A 1aa101e88764
lab is a command published in the GitHub repository lanegrid/agtrace (59 stars, last pushed 1mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 556 tokens. 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.
Other commands, from other repositories
spec-design
Create comprehensive technical design for a specification.
add-agent
引导新增一个 Agent 适配器。用法 /add-agent.
speckit.opsmill.retrospect
Run a session retrospective that surfaces context-management gaps and routes them to approved follow-up actions.
create-issue
Transform feature descriptions, bug reports, or improvement ideas into well-structured GitHub issues.
pr
Handle the full workflow from current branch state to an open, CI-monitored pull request.
mach12:gh-pr-read
Read a GitHub pull request's title, body, and all top-level PR conversation comments; optionally locate an HTML-marker comment.