gza-task-debug

gza-task-debug is a skill for Claude Code, Codex from mhawthorne/gza. It costs 31 tokens per session (2,538 once invoked), scanned A, original, MIT.

A diagnostic tool for failed Gza tasks. It examines task details, logs, code changes, repeated agent behavior, and comparisons with recently completed tasks.

In plain words
What is it for?
Investigating failed or maximum-turn tasks and producing recommendations for fixing the underlying issue. It requires a full task ID, such as gza-1234.
Why use it?
It helps identify whether a failure came from a loop, an implementation change, or another task-running problem.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/mhawthorne/gza/gza-task-debug
Any agent
npx skills add mhawthorne/gza --skill gza-task-debug
Clone the repo
git clone --depth 1 https://github.com/mhawthorne/gza

Made for: Claude Code, Codex.

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 gza-task-debug

README.md
[![agentmods](https://agentmods.dev/badge/skills/mhawthorne/gza/gza-task-debug.svg)](https://agentmods.dev/skills/mhawthorne/gza/gza-task-debug)
Your own site
<a href="https://agentmods.dev/skills/mhawthorne/gza/gza-task-debug"><img src="https://agentmods.dev/badge/skills/mhawthorne/gza/gza-task-debug.svg" alt="Measured on agentmods" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,538 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00031 $0.02538
Opus 5 $0.00015 $0.01269
Sonnet 5 $0.00006 $0.00508
Haiku 4.5 $0.00003 $0.00254

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

Security

Grade A, and why

gza-task-debug 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.

src/gza/skills/gza-task-debug/SKILL.md · 270 lines

How it starts

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

Gza Task Debug

Diagnose why a gza task failed by analyzing logs, detecting agent loops, comparing against baselines, and providing actionable recommendations.

Process

Step 1: Get task ID

The user should provide a full prefixed task ID (for example, gza-1234). Extract it from the input.

Step 2: Query task from database

Run a Python one-liner to get all task details as JSON:

uv run python -c "from gza.db import get_task; import json; print(json.dumps(get_task(<ID>), indent=2, default=str))"

Note the following fields for analysis:

  • status — should be failed or max_turns (or possibly completed if user suspects partial failure)
  • num_turns — number of agent turns used
  • duration_seconds — total wall-clock time
  • cost_usd — API cost
  • log_file — provider conversation transcript path; also inspect the sibling <stem>.ops.jsonl file for runner lifecycle, preflight, command, outcome, and stats events
  • report_file — path to the report (if any)
  • branch — git branch the task worked on

Step 3: Baseline comparison

Compare the failed task's metrics against the last 20 completed tasks:

uv run python -c "from gza.db import get_baseline_stats; import json; print(json.dumps(get_baseline_stats(20)))"

Calculate how far the failed task deviates:

  • If num_turns is 2x+ the average → flag as high turns
  • If cost_usd is 3x+ the average → flag as high cost
  • Report the ratio (e.g., "3.2x more turns than average completed tasks")

Step 4: Loop detection from logs

Do NOT just read the tail — scan the full log for repeated patterns.

If log_file is set, run these grep-based checks against the conversation log first. Then inspect the sibling ops log for infrastructure/preflight/outcome clues:

ops_log="${log_file%.log}.ops.jsonl"

Repeated file opens (same file opened 5+ times):

grep -o 'Reading file: [^ ]*\|reading.*["\x27][^"'\'']*["\x27]\|open.*["\x27][^"'\'']*["\x27]' <log_file> | sort | uniq -c | sort -rn | head -20

Read the full file on GitHub · 270 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 · 270 lines · 31 tokens per session scan A e95164cab70b

Subscribe to this mod's changes

gza-task-debug is a skill published in the GitHub repository mhawthorne/gza (12 stars, last pushed today), licensed MIT. It adds 31 tokens to every session and 2,538 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-08-30.

Related

Other skills, from other repositories

html-ppt-hermes-cyber-terminal

OpenDesign + BYOK: choosing and wiring your own model, hands-on — cost, quality, and the routing decision. Built as a decision-grade AI literacy deck for engineers, IT, applied-AI teams.

nexu-io/open-design · 53 tokens

development

开发语言能力索引。Python、Go、Rust、TypeScript、Java、C++、Shell。当用户提到编程、开发、代码、语言时路由到此。.

fengshao1227/ccg-workflow · 41 tokens

post-build-flow

Handles workflow verification and setup after build-workflow succeeds, or when the message contains workflow-verification-follow-up or workflow-setup-required. Load after direct builds, when verificationReadiness requires action, or on orchestrator verify/setup follow-up turns.

n8n-io/n8n · 53 tokens

n8n:create-pr

Creates GitHub pull requests with properly formatted titles that pass the check-pr-title CI validation. Use when creating PRs, submitting changes for review, or when the user says /pr or asks to create a pull request.

n8n-io/n8n · 50 tokens

n8n:reproduce-bug

Reproduce a bug from a Linear ticket with a failing test. Expects the full ticket context (title, description, comments) to be provided as input.

n8n-io/n8n · 41 tokens

debugging-executions

Debug failed or wrong-output workflow executions using executions tools. Load when the user reports execution failures, unexpected node output, empty parameter values after a successful run, or a node showing a red or failed expression error.

n8n-io/n8n · 48 tokens