agentleFS
ethosagentethosagent/ethos/.agents/skills/session-audit/SKILL.md

session-audit

Skill22 starsChanged 9 days agoMITView on GitHub

Analyze the current Claude Code session transcript for execution failures, classify errors, and suggest CLAUDE.md rules or settings.json hooks. Use on "audit this session", "what failed", "analyze errors", "what went wrong".

  • Installs packages

9 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the parse script:

    line 13

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Session Audit

Analyze the current Claude Code session for execution failures and present a structured report.

Phase 1 — Parse transcript

Run the parse script:

python3 "$(dirname "$0")/scripts/parse-transcript"

The script outputs JSON:

{
  "session": "<path>",
  "total_tool_calls": 42,
  "failures": [
    {
      "category": "git-state",
      "count": 1,
      "examples": ["fatal: 'messaging-queue-background' is already used by worktree at ..."],
      "suggestion": {
        "type": "claude_md",
        "rule": "Before any `git worktree add` or `git checkout -b`, first run `git worktree list` and `git branch --list <name>` to verify the target does not already exist."
      }
    }
  ]
}

Phase 2 — Present the report

For each failure in the output, format it as:

## <CATEGORY> (<count> occurrence(s))

**What failed:**
> <example snippet — first 200 chars>

**Suggested fix:**
<type: CLAUDE.md rule | settings.json hook>
<the rule or hook config>

Categories and their fix types:

  • git-state → CLAUDE.md rule about verifying git state before operations
  • typecheck → CLAUDE.md rule to always run pnpm typecheck before declaring done
  • lint → settings.json Stop hook: cd <project> && pnpm lint 2>&1 | grep "error" | grep -v WARN || true
  • build → CLAUDE.md rule to run pnpm build in affected package before reporting complete
  • test → CLAUDE.md rule to run pnpm test before declaring done
  • dependency → CLAUDE.md rule to run pnpm install && pnpm typecheck after package changes
  • permission → CLAUDE.md rule: never bypass hooks with --no-verify; investigate root cause
  • runtime → CLAUDE.md rule to check ~/.ethos/logs/errors.jsonl for context
  • exit-code → no rule (informational only)

Show the full report and stop. Do not ask to apply anything.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.