agent-log-forensics
Skill6 starsChanged 4 months agoMITView on GitHub
Analyze Claude/Codex logs for behavior patterns, repeated friction, and Toolsmith gaps.
In this repository27 other files it gives its agents.
- agent-skills-agentsAGENTS.md
- agent-skills-claudeCLAUDE.md
- changelog-writerSkill
- chezmoi-driftSkill
- contacts-unifySkill
- decision-logSkill
- dependency-pinningSkill
- django-smoke-alarmSkill
- empathy-auditSkill
- first-contactSkill
- handle-prSkill
- launch-sequenceSkill
- parallel-isolated-app-testingSkill
- post-mortemSkill
- pre-mortemSkill
- profile-meSkill
- ralph-loopSkill
- release-operatorSkill
- remote-host-verifierSkill
- research-personSkill
- scope-hammerSkill
- second-opinionsSkill
- status-copy-trust-auditSkill
- support-stormSkill
- trust-auditSkill
- visual-qa-loopSkill
- wide-open-brainstormSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 7 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Use this when the goal is not one bug fix, but making the human+agent system smarter after observing real sessions.
- Distinctive: line 39
Default to the last 7 days unless the user names a different range.
- Distinctive: line 41
Prefer Toolsmith's built-in scanner when it is installed (optional.
- Very specific: line 49
If the scanner is not installed yet, say that and fall back to a lightweight count of recent ~/.claude/projects//*.jsonl and …
- Distinctive: line 53
Do not paste raw user prompts or full transcript content.
- Distinctive: line 55
Prefer counts, categories, tool names, workspace basenames, and short sanitized examples.
- Distinctive: line 56
Treat shell commands with secrets as sensitive snippets.
- Distinctive: line 98
After listing findings, do one further pass:
- Very specific: line 127
Use scripts/collect_toolsmith_scan.py (relative to this skill directory, via uv run) to run local and remote Toolsmith scans and write a …
- Very specific: line 133
Use remote-host-verifier when comparing a command across local and remote hosts.
- Very specific: line 134
Use skill-creator when turning findings into new skills.
- Very specific: line 135
Use status-copy-trust-audit when confusing CLI output appears repeatedly in logs.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Log Forensics
Use this when the goal is not one bug fix, but making the human+agent system smarter after observing real sessions.
Third-order stance: skip the obvious "agent forgot tool" answer. Ask what hidden loop, missing affordance, brittle instruction, or human workaround made the tool forgettable in the first place. Prefer new mental paths over more reminders.
When to Use
- The user asks whether agents are using a tool, skill, MCP server, or workflow
- The user wants "lost opportunities" where agents should have used better tools
- The user asks for patterns in interactions, repeated frustrations, jank, or productivity bottlenecks
- The user asks "why did that take so many turns?", "why did you struggle?", or "how do we level this up?"
- You need to turn observed behavior into new user-level skills, scripts, or project instructions
When NOT to Use
- One isolated transcript or pasted error is enough
- The user asks for a narrow code change unrelated to agent behavior
- Logs may contain sensitive data and the user did not ask for forensic analysis
<process>Phase 1: Scope the Observation Window
Default to the last 7 days unless the user names a different range. Include remote hosts only when the user names them (an SSH alias they use).
Prefer Toolsmith's built-in scanner when it is installed (optional; skip if absent):
toolsmith scan-agent-logs --days 7 --max-examples 12
toolsmith opportunities --days 7 --max-examples 8
toolsmith scan-agent-logs --days 7 --remote <ssh-host> --max-examples 12If the scanner is not installed yet, say that and fall back to a lightweight count of recent ~/.claude/projects/**/*.jsonl and ~/.codex/sessions/**/*.jsonl files rather than dumping raw prompts.
Phase 2: Preserve Privacy
- Do not paste raw user prompts or full transcript content.
- Redact home paths, secrets, tokens, keys, cookies, project-private filenames when they look sensitive.
- Prefer counts, categories, tool names, workspace basenames, and short sanitized examples.
- Treat shell commands with secrets as sensitive snippets.
Phase 3: Classify Findings
Create five sections:
- Tool adoption — registered vs actually called, by agent/client, with evidence counts.
- Lost opportunities — where the agent used a worse tool. Separate hard misses from candidates.
- Behavior/productivity themes — repeated user frustrations, recurring workflow patterns, and quality gaps.
- Shadow workflows — places the human manually intervened, re-ran commands, pasted exact instructions, or corrected the agent after loops. Treat these as highest-value skill/script candidates.
- Silence anomalies — expected logs, tool calls, or telemetry are missing. Lack of evidence can mean broken instrumentation, not success.
For Toolsmith, classify:
- Hard miss: native
Read/Edit/Write,cat,nl, or broadsed -non >200-line files. - Candidate:
apply_patchon a large file after a search/read could have used anchors, but may still be acceptable. - Positive adoption:
file_skeleton,find_and_anchor,get_function,anchored_read,anchored_edit,symbol_replace.
Phase 4: Convert Observations Into Improvements
For each repeated pattern, propose one of:
- Skill — when judgment, sequencing, or cross-tool behavior matters.
- Script — when the action is deterministic and repeatable.
- Project instruction — when it is repo-specific and should activate automatically.
- Tool/MCP improvement — when missing affordances prevent agents from doing the right thing.
Use this table:
| Signal | Better artifact |
| Same review checklist repeated | Skill |
| Same shell command chain repeated | Script |
| Same repo-specific gotcha repeated | CLAUDE.md / AGENTS.md update |
| Agents know the right thing but forget | Prompt snippet / guardrail |
| Agents cannot inspect evidence cheaply | Toolsmith/MCP feature |
| User manually intervenes after agent loops | Skill or deterministic helper that removes the human bridge |
| Expected telemetry is silent | Logging/instrumentation fix before drawing conclusions |
| Same failure appears across projects | User-level skill plus project opt-out, not per-repo copy-paste |
Phase 5: Third-order Synthesis
After listing findings, do one further pass:
- First-order: what tool or skill should have been used?
- Second-order: why did the agent not choose it under real pressure?
- Third-order: what new path would make the better behavior feel inevitable, delightful, or weirdly obvious next time?
Name the proposed path in memorable language, for example "shadow workflow collector", "silence detector", "release exit-door drill", or "jank weather report".
Phase 6: Write the Report
Store reports in:
- Temporary artifacts: a scratch dir such as
${TMPDIR:-/tmp}/agent-log-forensics/ - Durable reports: the user's notes vault or repo docs if the user asks or the work should guide future sessions
Include:
- Date range and hosts
- What was scanned
- Adoption verdict
- Lost-opportunity examples, sanitized
- Skills/scripts/tools to add next
- Third-order ideas worth trying even if they sound whimsical
- Follow-up observation plan
</process><scripts>Use scripts/collect_toolsmith_scan.py (relative to this skill directory, via uv run) to run local and remote Toolsmith scans and write a combined Markdown report. Pass --notes-dir <dir> to choose the output location (the script default is ~/dev/agent-notes/; pass the user's notes dir or a temp dir instead).
</scripts><interlocks>- Use
remote-host-verifierwhen comparing a command across local and remote hosts. - Use
skill-creatorwhen turning findings into new skills. - Use
status-copy-trust-auditwhen confusing CLI output appears repeatedly in logs. - For a broad synthesis pass before writing new skills, use a strongest-tier in-session subagent (outside CLIs only after asking the user; see the
second-opinionspolicy).
</interlocks>Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

