/tq:tq-investigate-incidentsfrom tq
Cross-event diagnosis of recent failed and permission-blocked actions in the tq queue. Clusters incidents by root cause and cross-checks prior remediations for pattern-level fixes.
Ships in tq. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You review recent failed actions and permission denials across the whole queue. The goal is cross-event judgment, not per-event firefighting.
This skill replaces a retired per-event path that auto-generated one follow-up action per failure or per denial. That path ran roughly 150 Claude sessions per month and accumulated remediations (SKILL.md edits, settings tweaks) without ever verifying whether the remediations actually fixed the root cause. The point of doing this in batch is precisely to look across events for patterns that per-event analysis was structurally blind to.
Two shapes:
tq action list --status failed returns these. The result field carries the failure message.done but had tool-use denials along the way. Denial summaries are stamped onto the source action's metadata under the permission_denials key (introduced 2026-05-14, replacing the old auto-generated is_permission_block follow-up).Legacy follow-ups (is_investigate_failure: true, is_permission_block: true) still exist in the DB from before the retirement. Treat them as history: they tell you what was already remediated for past events.
The reason per-event analysis was retired is that it kept producing locally plausible fixes — adding a Bash(...) allowlist entry, tightening a SKILL.md instruction, writing a defensive memory — without ever validating whether the same pattern recurred afterward. So defensive restrictions piled up while the underlying problem (often a harness race, a model/effort mismatch, or a structural permission-matcher quirk) stayed.
Use this skill to do what the per-event path couldn't:
Run the CLI to see what's available, then read what matters:
tq action list --status failed --jq '.[] | {id, task_id, created_at, title, result_head: (.result // "")[0:200]}'
tq action list --jq '.[] | select((.metadata | fromjson? | .permission_denials) != null) | {id, task_id, created_at, title, denials: (.metadata | fromjson? | .permission_denials)}'
Default time window: roughly the last 24 hours when run on a schedule, or whatever window the caller asks for. Don't hold yourself to a strict window — if a cluster clearly extends further back, follow it.
For cross-referencing prior remediations:
tq action list --jq '.[] | select(.metadata | contains("is_investigate_failure") or contains("is_permission_block")) | {id, created_at, title, result_head: (.result // "")[0:300]}'
Use tq search for free-text searches across older history when you suspect a remediation but don't see it in the recent list.
Produce a markdown report. Suggested skeleton — adapt freely:
# Incident review (window: <range>)
## Clusters
### <cluster name> (<count>, e.g. 14×)
- pattern: <what ties them together>
- representative IDs: #N, #M, #...
- prior remediation: <link or "none found">
- recurrence-after-remediation: <yes/no/uncertain>
- assessment: <what this likely is — harness race, model mismatch, structural, ...>
- recommendation: <do nothing / file fix action / flag a prior remediation as ineffective>
## One-offs
- #N: <one-line>
- #M: <one-line>
## Followups created
- action #X: <title> (only if you actually created one)
When recommendation = "file fix action", use tq action create to spawn it. Make the new action's instruction concrete and bounded — that action will run Claude separately, so don't bundle multiple unrelated fixes into one. Default to no follow-up unless the recommendation is high-confidence; over-creation re-introduces the cost problem this skill was built to solve.
Use the built-in --jq flag on tq commands. Don't pipe to external jq / python — piped commands trigger permission prompts that break scheduled runs.
# Good
tq action list --status failed --jq '.[] | select(.created_at > "2026-05-13")'
# Bad — triggers approval prompt
tq action list --status failed | jq '.[] | select(.created_at > "2026-05-13")'
What SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/tq-cancelCancel a tq action with improvement suggestions, then judge task-level completion and propose follow-up actions when work remains/tq-create-actionCreate a tq action (auto-infer instruction or let user specify)/tq-dep-triageRescue tq actions stuck pending forever because a completion dependency ended failed or cancelled. A blocked action is only released when every blocker reaches a successful terminal state, so a failed/cancelled blocker strands the dependent indefinitely. Use this whenever asked to triage blocked/stuck/stalled pending actions, find actions waiting on a dead dependency, audit blocked_by chains, or unblock the dispatch queue — including the scheduled "/tq:dep-triage" run.npx claudepluginhub mh4gf/tq --plugin tqOther plugins' skills for the same job