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 skills add yeaight7/agent-powerups --skill agent-session-forensicsgit clone --depth 1 https://github.com/yeaight7/agent-powerupsWrote 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.
[](https://agentmods.dev/skills/yeaight7/agent-powerups/agent-session-forensics)<a href="https://agentmods.dev/skills/yeaight7/agent-powerups/agent-session-forensics"><img src="https://agentmods.dev/badge/skills/yeaight7/agent-powerups/agent-session-forensics/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.
<a href="https://agentmods.dev/skills/yeaight7/agent-powerups/agent-session-forensics"><img src="https://agentmods.dev/badge/skills/yeaight7/agent-powerups/agent-session-forensics.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00031 | $0.00685 |
| Opus 5.5 | $0.00012 | $0.00274 |
| Sonnet 5.5 | $0.00006 | $0.00137 |
| Haiku 4.5 | $0.00003 | $0.00068 |
Grade A, and why
agent-session-forensics 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 1mo 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 — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent Session Forensics
When To Use
- Agent session ended mid-tool-call or cannot resume.
- Tool call appears in assistant turn but no corresponding result turn follows.
- Need to correlate tool calls, tool results, and timing metadata.
- Diagnosing slow LLM calls, duplicate user turns, or malformed results.
- Debugging experimental MCP data-layer sessions.
Requirements / Checks
- Locate session directory and history files before editing anything.
- Prefer read-only inspection first.
- Have
jqor equivalent JSON tooling available. - Ask before modifying, truncating, or deleting any session or history file.
Workflow
-
Inventory session files — find metadata, current history, rotated previous history, and related subagent histories.
-
Count and list last turns:
jq 'length' history.json # total messages jq '.[-10:] | .[] | {role, stop_reason}' history.json # last 10 turns jq '.[] | select(.role=="assistant") | .tool_calls[].id' history.json # tool call IDs jq '.[] | select(.role=="user") | .tool_results[]?.tool_call_id' history.json # results -
Correlate tool call IDs — every
tool_callin an assistant turn must have a matchingtool_resultin the immediately following user turn. Find the first gap. -
Check timing for slow calls:
jq '.[] | select(.timing) | {role, duration_ms: .timing.duration_ms}' history.json -
Identify failure pattern — see table below.
-
Repair (if approved) — write a backup first (
cp history.json history.json.bak), then make the smallest possible fix at the last valid correlation boundary.
Common Failure Patterns
| Symptom | Likely cause | Repair |
|---|---|---|
| Tool call with no result turn | Session interrupted mid-tool | Truncate after last matched pair |
| Two consecutive user turns | Duplicate message insertion | Remove the duplicate |
tool_result with no prior tool_call |
Corrupted or manually edited history | Remove orphan result |
Empty content on assistant turn |
Model returned no text + no tools | Usually safe to truncate |
| Session loops without progress | Missing result causes re-prompt | Inject minimal synthetic result |
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 1mo ago First seen · 68 lines · 31 tokens per session scan A 6a0122471198
agent-session-forensics is a skill published in the GitHub repository yeaight7/agent-powerups (8 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 31 tokens to every session and 685 once invoked, about $0.0001 per session on Opus 5.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-09-14.
Other skills, from other repositories
systematic-debugging
4-phase root cause debugging: understand bugs before fixing.
simplify-code
Sequential 3-lens cleanup of recent code changes.
python-debugpy
Debug Python: pdb REPL + debugpy remote (DAP).
node-inspect-debugger
Debug Node.js via --inspect + Chrome DevTools Protocol.
hqe
Comprehensive codebase health auditing, remediation, and verification skill based on the canonical HQE Protocol v5.0.0.
debug-gateway
Load this before concluding a change did not land, and to read what the kirocrew-debug tools actually answered - which question to ask first, the fields that mean the opposite of how they look, and what a 400 / 403 / 404 / 501 from these tools means.