forense

forense is a command for Claude Code from luanpdd/kit-mcp. It costs 33 tokens per session (2,377 once invoked), scanned A, original, MIT.

A read-only post-mortem investigator for failed or stuck development workflows. A post-mortem examines what happened after a failure using project history, saved work products, and status records.

In plain words
What is it for?
Use it to investigate stalled loops, missing artifacts, abandoned work, crashes, and interruptions, then save a structured findings report.
Why use it?
It helps identify the root cause of a broken workflow without changing the project's source files.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is Cross-ref canônico: [blameless-postmortems](../skills/blameless-postmortems/SKILL.md) skill + [postmortem-writer](../agents/postmortem-writer.md) agent..

Good fit Use it to investigate stalled loops, missing artifacts, abandoned work, crashes, and interruptions, then save a structured findings report.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/luanpdd/kit-mcp
agentmods
npx agentmods add commands/luanpdd/kit-mcp/forense

Made for: Claude Code.

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 forense

README.md
[![agentmods](https://agentmods.dev/badge/commands/luanpdd/kit-mcp/forense.svg)](https://agentmods.dev/commands/luanpdd/kit-mcp/forense)
Your own site
<a href="https://agentmods.dev/commands/luanpdd/kit-mcp/forense"><img src="https://agentmods.dev/badge/commands/luanpdd/kit-mcp/forense.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,377 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.00033 $0.02377
Opus 5 $0.00016 $0.01189
Sonnet 5 $0.00007 $0.00475
Haiku 4.5 $0.00003 $0.00238

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

Security

Grade A, and why

forense 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 4d 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.

kit/commands/forense.md · 177 lines

How it starts

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

Propósito: Diagnosticar workflows com falha ou travados para que o usuário possa entender a causa raiz e tomar ação corretiva. Saída: Relatório forense salvo em .planning/forensics/, apresentado inline, com criação opcional de issue.

<execution_context> @./.claude/framework/workflows/forensics.md </execution_context>

Entrada do usuário:

  • Descrição do problema: $ARGUMENTS (opcional — perguntará se não fornecido)

<success_criteria>

  • Evidências coletadas de todas as fontes de dados disponíveis
  • Pelo menos 4 tipos de anomalia verificados (loop travado, artefatos ausentes, trabalho abandonado, crash/interrupção)
  • Relatório forense estruturado escrito em .planning/forensics/report-{timestamp}.md
  • Relatório apresentado inline com descobertas, anomalias e recomendações
  • Investigação interativa oferecida para análise mais profunda
  • Criação de issue no GitHub oferecida se existirem descobertas acionáveis </success_criteria>

<critical_rules>

  • Investigação somente leitura: Não modificar arquivos fonte do projeto durante forense. Apenas escrever o relatório forense e atualizar rastreamento de sessão no STATE.md.
  • Redigir dados sensíveis: Remover caminhos absolutos, chaves de API, tokens de relatórios e issues.
  • Fundamentar descobertas em evidências: Toda anomalia deve citar commits, arquivos ou dados de estado específicos.
  • Sem especulação sem evidência: Se os dados forem insuficientes, diga isso — não fabrique causas raiz. </critical_rules>

<observability_integration> Integração com Core Analysis Loop (v1.9):

Forense usa skill core-analysis-loop — método científico iterativo (sintoma → hipótese de dados → validação → próxima iteração) em vez de inspeção ad hoc.

Cada anomalia detectada vira hipótese com query de validação:

Tipo de anomalia Hipótese formada Query de validação
Loop travado "phase X stuck há Yh" git log --since="Yh ago" --grep=phase para confirmar zero commits
Artefatos ausentes "PLAN.md ausente em phase X" ls .planning/phases/X-*/X-PLAN-*.md
Trabalho abandonado "branch sem merge nem commit recente" git log -1 <branch> + git status
Crash/interrupção "executor falhou em meio a fase" grep no STATE.md por "in_progress" sem update recente

Skill consultada explicitamente: abrir o arquivo kit/skills/core-analysis-loop/SKILL.md para padrão "documentação da trilha (formato canônico)" — o relatório forense em .planning/forensics/report-<ts>.md segue esse formato com cada hipótese tendo "Query / Resultado / Status (VALIDATED / REFUTED / INCONCLUSIVE)".

REQ: INT-FW-06. </observability_integration>

<sre_integration> Chain /postmortem após Core Analysis Loop (v1.10 — INT-FW-V2-01):

Forense é diagnóstico evidence-based read-only — identifica o o que e o como via método científico (sintoma → hipótese → query → status VALIDATED | REFUTED | INCONCLUSIVE). Quando o Core Analysis Loop fecha com pelo menos uma hipótese VALIDATED apontando para root cause, o próximo passo canônico é postmortem blameless (cap 15 livro Google SRE — Postmortem Culture: Learning from Failure).

Distinção fundamental:

Read the full file on GitHub · 177 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. 4d ago First seen · 177 lines · 33 tokens per session scan A e463925d3eb4

Subscribe to this mod's changes

forense is a command published in the GitHub repository luanpdd/kit-mcp (1 stars, last pushed yesterday), licensed MIT. It adds 33 tokens to every session and 2,377 once invoked, about $0.0002 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-09-03.