Skip to content

analyst

Cost tracking and learning agent that extracts patterns, maintains institutional memory, and proposes improvements.

Overview

The analyst is the terminal agent in the pipeline — it runs last (Phase 6) and passes to no one. It tracks token usage, generates cost reports, extracts recurring patterns into memory/patterns.json, and maintains lessons learned in memory/lessons.md. Every 10 sessions, it proposes updates to CLAUDE.md based on accumulated patterns (never auto-applies — always proposes for human review).

Quick Reference

Documentation & Management

CapabilityDetails
Cost trackingToken usage per task in memory/cost-log.json
Cost reports/meow:budget — spend by task, agent, model tier, over time
Pattern extractionRecurring issues and solutions in memory/patterns.json
Lessons learnedHuman-readable learnings in memory/lessons.md
CLAUDE.md proposalsAfter 10 sessions, proposes improvements (human-approved)
Cost optimizationIdentifies tasks consistently over-classified to expensive tiers

How to Use

bash
/meow:budget    # view cost report

The analyst also runs automatically at session end (Phase 6).

Under the Hood

Handoff Example

Analyst (session end):
  Token usage this session: 45,000 (Sonnet)
  Patterns found: "auth tests frequently need retry" → saved to patterns.json
  Lesson: "JWT refresh logic requires integration tests, not unit tests"
  Cost note: "3 trivial tasks were classified STANDARD — could be TRIVIAL"

  Sessions since last CLAUDE.md proposal: 8 (2 more until next)

  → No handoff (terminal agent)

Troubleshooting

IssueCauseFix
Memory files corruptedInterrupted session or manual editAnalyst creates fresh files with empty structure
Cost data seems wrongToken counting is approximateAnalyst logs what's available — never fabricates
CLAUDE.md proposal unwantedHappens every 10 sessionsReview and accept/reject — never auto-applied

Released under the MIT License.