metrics
The metrics command retrieves and analyzes agent performance data from a stored metrics file, displaying session counts, activity frequency, files modified per session, and recent session history in a formatted table. Use this command to review workflow efficiency, identify patterns in agent behavior, track changes across sessions, and diagnose whether metrics collection is functioning properly in the Claude workflow environment.
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/CloudAI-X/claude-workflow-v2/HEAD/commands/metrics.md -o ~/.claude/commands/metrics.mdmetrics.md
## Context - Metrics file: !`cat .claude/agent-metrics.jsonl 2>/dev/null || echo "NO_METRICS_FILE"` ## Task Analyze the agent performance metrics and present a summary. **If the metrics file does not exist or the context above shows "NO_METRICS_FILE":** Print exactly: "No metrics recorded yet. Metrics are automatically collected after each session." **If metrics data exists**, parse each JSON line and present: 1. **Overview** - Total sessions logged - Sessions in the last 7 days (compare timestamps to now) - Average files changed per session 2. **Recent Sessions** (last 10) Format as a markdown table: | # | Timestamp (UTC) | Files Changed | Commit | Status | | --- | --------------- | ------------- | ------ | ------ | - Show the most recent 10 sessions, newest first - For "Commit", show the short commit message or "—" if none - For "Status", show the duration_hint value 3. **Patterns** - Note any trends (e.g., sessions with many file changes, frequency of commits) - If there are sessions with 0 files changed, note how many were "no-op" sessions Keep the output concise and well-formatted.
Add tests for recently changed files or specified code
Analyzes codebases to understand structure, tech stack, patterns, and conventions. Use when onboarding to a new project, exploring unfamiliar code, or when asked "how does this work?" or "what's the architecture?
System design and architecture planning mode. Focuses on high-level design, trade-offs, and technical decisions before implementation.
Explore the repository with 10 parallel subagents to create comprehensive documentation. Creates CODEBASE.md with full architecture analysis.
Expert code review specialist. Use PROACTIVELY after writing or modifying code, before commits, when asked to review changes, PR review, code quality check, lint, or standards audit. Focuses on quality, security, performance, and maintainability.
Simplifies code after implementation. Reviews recent changes and suggests/applies simplifications while preserving behavior.
Create a conventional commit with auto-generated message
Commit staged changes, push to remote, and create a pull request