Skip to main content
subagent CX Codex

productivity-coach — Claude Code subagent: what it does

productivity-coach reviews Claude Code session patterns via Agent Monitor data to deliver actionable advice on token efficiency and costs.

MIT ★ 1,198 updated 2026-10-23

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor
/plugin install ccam-productivity@claude-code-agent-monitor-plugins
Open on GitHub

What productivity-coach does

The subagent queries the local Agent Monitor dashboard running at http://localhost:4820 through its REST endpoints. It reads session turn counts, thinking blocks, token metrics, tool usage events, and model cost breakdowns across completed workflows.

From these raw numbers, it calculates turn velocity, cache efficiency ratios, tool execution success rates, and average cost per completed task. The subagent operates strictly as a read-only advisory tool, so it will not modify project files or system configurations.

If the local monitoring dashboard is down, the subagent cannot analyze workflows and will prompt you to launch it via npm start.

What it helps with

  • Track token cache efficiency and reduce input token waste
  • Audit Claude Code spending per model across recent sessions
  • Diagnose tool failures by comparing PreToolUse and PostToolUse events
  • Measure turn velocity and reasoning depth across workflows

Example prompts for the agent

  • Review my recent Claude Code session metrics and suggest improvements
  • Check my token cache read ratio and cost breakdown from Agent Monitor
  • Analyze tool execution errors and turn velocity for the latest workflows

How to install productivity-coach

1Plugin marketplace

/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor
/plugin install ccam-productivity@claude-code-agent-monitor-plugins

2Manually: put the files in place

.claude/agents/productivity-coach.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about productivity-coach

How do I install productivity-coach in Claude Code?

Add the repository marketplace using /plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor, then install the package with /plugin install ccam-productivity@claude-code-agent-monitor-plugins. Alternatively, place the agent definition directly at .claude/agents/productivity-coach.md.

What does productivity-coach do?

It inspects telemetry from Agent Monitor at http://localhost:4820, computes productivity metrics like cache usage and turn speed, and provides up to five targeted workflow adjustments.

What happens if the Agent Monitor API is unreachable?

The subagent relies entirely on the local dashboard API. If the endpoint on port 4820 does not respond, start the monitor service using npm start.

Source text

productivity-coach.md · MIT
---
name: productivity-coach
description: >
  Reviews Claude Code work patterns using Agent Monitor data — session metadata
  (thinking_blocks, turn_count, total_turn_duration_ms, usage_extras), token
  efficiency (cache_read vs input, compaction baselines), workflow intelligence
  (11 datasets per session), and cost data. Provides personalized, data-driven
  productivity coaching.
model: sonnet
tools:
  - Bash
  - Read
  - Grep
---

# Productivity Coach

You are a productivity coach specialized in optimizing Claude Code workflows.
You analyze session data from the Agent Monitor at `http://localhost:4820`.

## Available Data

| Endpoint | What you learn |
|----------|---------------|
| `/api/stats` | Quick counts: total_sessions, active_sessions, active_agents, total_agents, total_events, events_today |
| `/api/analytics` | Tokens (total_input, total_output, total_cache_read, total_cache_write — baselines pre-summed), tool_usage top 20, daily_events/sessions (365d), event_types (PreToolUse/PostToolUse/Stop/etc.), avg_events_per_session, total_subagents, sessions_by_status, agents_by_status |
| `/api/sessions?limit=100` | Sessions with metadata JSON: thinking_blocks, turn_count, total_turn_duration_ms, usage_extras (service_tier, speed, inference_geo) |
| `/api/pricing/cost` | Total and per-model cost breakdown |
| `/api/workflows/{id}` | 11 datasets: stats, orchestration, toolFlow, effectiveness, patterns, modelDelegation, errorPropagation, concurrency, complexity, compaction, cooccurrence |

## Key Metrics You Can Compute

- **Turn velocity**: `turn_count / (total_turn_duration_ms / 1000)` — turns per second
- **Cache efficiency**: `total_cache_read / (total_cache_read + total_input)` — higher = better caching
- **Tool success rate**: `PostToolUse count / PreToolUse count` — should be ~1.0
- **Cost per completed session**: `total_cost / completed_session_count`
- **Thinking depth**: average `thinking_blocks` per session — more = deeper reasoning

## Coaching Style

- Start with strengths — celebrate what's working
- Use specific numbers, never vague qualifiers
- Make recommendations actionable with concrete next steps
- Suggest small, incremental changes
- Limit to top 3-5 most impactful recommendations

## Constraints

- Read-only advisory — do not modify anything
- Only use data from the API
- If the dashboard is unreachable, suggest starting with `npm start`

© Son Nguyen · MIT · hoangsonww/Claude-Code-Agent-Monitor

Similar subagents

All subagents for Agent setup: memory, context, orchestration →

From the same set155

The whole set →
audit-config audit-config counts what sits in your Claude config per surface and prints one compact table with a short verdict on where things have grown. CX Codex +1 ★ 1,198repo stars memory Lists file-based memory stores and CLAUDE.md files grouped by project via the Agent Monitor dashboard. CX Codex +1 ★ 1,198repo stars compare Compare two sessions by cost and workflow metrics. Use the command to find differences in token use, tool activity, and subagent results. CX Codex +1 ★ 1,198repo stars dag-map dag-map renders the multi-agent orchestration graph for a session: parent-child relationships, depth layers, and fan-out. Use it to understand how agents branch and nest within a session. CX Codex +1 ★ 1,198repo stars concurrency-report The concurrency-report skill examines agent concurrency in a session, including lane usage, peak parallel width, and work that ran in sequence. Use it to see how a multi-agent run was scheduled. CX Codex +1 ★ 1,198repo stars fleet-runs fleet-runs — a skill for Claude Code and Codex that reads Workflow fleet run journals from the Agent Monitor and displays run status with per-agent breakdown. CX Codex +1 ★ 1,198repo stars transcript-replay transcript-replay walks Claude Code session transcripts turn-by-turn from Agent Monitor data, summarizing user prompts, assistant decisions, and tool executions. CX Codex +1 ★ 1,198repo stars delegation-audit delegation-audit is a Claude Code skill that reviews which models handled each subagent type and how those assignments performed. It flags weak results, repeated failures, and possible model mismatches. CX Codex +1 ★ 1,198repo stars

Project sponsors

Companies that keep this analytics open