automation

Stop Wasting Agent Runs: Analyze Logs for Better AGENTS.md

Learn how gza-log-insights turns agent run logs into actionable workflow improvements, cutting wasted effort and refining your AGENTS.md.

by mhawthorne11 GitHub stars

Where this fits

You've been running your agent on a task set for weeks. Each run feels slightly off—the agent re-reads the same files, asks for clarifications it already had, or tries a fix that failed last time. You suspect the AGENTS.md is missing context, but you can't prove it. That's where gza-log-insights steps in: it mines your gza execution logs (.log and .ops.jsonl) to surface recurring anti-patterns and wasted effort, then suggests concrete edits to your workflow files.

Why agents benefit

  • Detects repeated failures: The skill aggregates patterns across many runs, so it can flag the same error occurring in 80% of sessions—something you'd never spot manually.
  • Quantifies wasted compute: It counts redundant tool calls, re-read files, and failed retries, giving you hard numbers to justify workflow changes.
  • Suggests AGENTS.md updates: Based on observed gaps, it proposes specific additions (e.g., "always check the config schema before parsing") that eliminate the most common mistakes.
  • Works across log formats: Handles both task transcripts and structured ops logs, so you get a unified view of agent behavior.
  • Runs locally with minimal setup: Uses uv run python and standard shell tools—no external services or data exfiltration.

Practical scenarios

Onboarding a new codebase

Your agent keeps struggling with a legacy module. The skill's analysis shows it re-reads the same three files every run because AGENTS.md lacks a summary of their internal APIs. You add a short section, and the next run is 30% faster.

Debugging a flaky test suite

After ten runs, the skill identifies that the agent repeatedly attempts to fix a flaky test by restarting the service, but the real issue is a missing environment variable. You patch the workflow to set it upfront, cutting failed attempts by half.

Refining prompt instructions

You notice the agent often asks for confirmation before running a destructive command. The logs show this happens 15 times per session. You add a rule to AGENTS.md: "For known destructive commands, proceed unless the user explicitly hesitates." The skill confirms the change reduces friction.

Add it to your agent workflow

Install the skill via the OpenAgentSkill CLI:

npx skills add mhawthorne/gza --skill gza-log-insights

Then run it in your agent environment. The skill first locates your log directory and counts available logs:

uv run python -c "

from gza.config import load_config

cfg = load_config()

log_dir = cfg.get_log_dir()

print(str(log_dir))

"

ls | wc -l

If logs exist, it runs a comprehensive analysis script that extracts patterns from the JSONL entries and returns a prioritized list of improvements. You can then apply those suggestions to your AGENTS.md or workflow prompts.

Compare before adopting

Before committing, compare this skill against alternatives like manual log grepping or a custom script. Key checks: quality signals—does it handle your log format and produce actionable output? Maintenance freshness—the repo has 11 stars and is actively updated; check the commit history. Alternatives—some teams prefer a one-off Python script, but this skill is reusable and documented. Workflow fit—it's designed specifically for gza, so if you use a different agent runner, it won't help directly. Also see the skill page on OpenAgentSkill for community feedback and usage examples.

Why it is worth tracking

This skill addresses a pain point every agent developer faces: knowing what your agent actually does wrong. Its quality signals are solid—clear README, focused scope, and a practical analysis script. With only 11 stars, it's early, but the approach is sound and the author is responsive. Track it if you use gza or plan to; evaluate it when your log volume grows beyond manual inspection. As agent workflows mature, log-driven optimization will become standard, and this skill is a solid first step.

Featured Skill

gza-log-insights