# Productivity Score

Calculate a productivity score using actual Agent Monitor metrics, session completion...

- Repository: https://github.com/hoangsonww/Claude-Code-Agent-Monitor (1136 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill productivity-score -g -a claude-code -y`
Codex: `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill productivity-score -g -a codex -y`
Cursor: `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill productivity-score -g -a cursor -y`
Gemini CLI: `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill productivity-score -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor`

## Description

Calculate a productivity score using actual Agent Monitor metrics, session completion rates, cache efficiency (cache_read vs input), compaction pressure (baseline tokens), turn velocity (turn_count / total_turn_duration_ms), tool success ratio (PreToolUse vs PostToolUse), and the workflow intelligence API's complexity and effectiveness scores.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Productivity Score

Calculate a productivity scorecard from the Agent Monitor's real data.

## Input

The user provides: **$ARGUMENTS**

Options: "today", "this week", "last 30 days", a session ID, or "compare" for period comparison.

## Data Sources

| Endpoint | Returns |
|----------|---------|
| `GET /api/analytics` | Token totals (`total_input`, `total_output`, `total_cache_read`, `total_cache_write`, baselines pre-summed), tool_usage top 20, daily_events/sessions, event_types, sessions_by_status, agents_by_status, avg_events_per_session, total_subagents |
| `GET /api/sessions?limit=100` | Sessions with metadata JSON: `thinking_blocks`, `turn_count`, `total_turn_duration_ms`, `usage_extras` (service_tier, speed, inference_geo) |
| `GET /api/pricing/cost` | Total cost with per-model breakdown |
| `GET /api/workflows/{sessionId}` | 11 workflow datasets: stats, orchestration, toolFlow, effectiveness, patterns, modelDelegation, errorPropagation, concurrency, complexity, compaction, cooccurrence |

## Score Components (each 0, 100)

### 1. Completion Rate (20% weight)
From `sessions_by_status`:
- `completed / (completed + error + abandoned) × 100`
- Bonus for high completed-to-active ratio
- Penalty for abandoned sessions (wasted work)

### 2. Token Efficiency (20% weight)
From analytics `tokens` (baselines are pre-summed into totals):
- **Cache hit rate**: `total_cache_read / (total_cache_read + total_input) × 100`
  - Above 60% = excellent, below 30% = poor
- **Output concentration**: `total_output / total_input`, 0.3, 0.8 is balanced

### 3. Tool Effectiveness (20% weight)
From `event_types`:
- **Success ratio**: Count `PostToolUse` / Count `PreToolUse`, should be ~1.0; gap = tool failures
- **API error rate**: Count `APIError` / total events, should be near 0
- From workflow `effectiveness` data: subagent completion rates, task success per type

The rest: https://github.com/hoangsonww/Claude-Code-Agent-Monitor/blob/HEAD/plugins/ccam-analytics/skills/productivity-score/SKILL.md
