# focus-report

focus-report generates a one-screen Agent Monitor focus snapshot showing average turn speed, thinking blocks, and longest sessions.

- command · `type=command` · Claude Code, Codex, GitHub Copilot, Gemini CLI · ★ 1198 repo stars
- Author: Son Nguyen
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/hoangsonww/Claude-Code-Agent-Monitor/tree/HEAD/plugins/ccam-productivity/commands/focus-report.md
- Updated: 2026-10-23
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/commands/focus-report

## What it does

The command queries a local Agent Monitor instance running at `http://localhost:4820`. It retrieves session records via `/api/sessions` (inspecting 100 sessions by default) alongside baseline metrics from `/api/analytics`. From session metadata, it extracts `turn_count`, `total_turn_duration_ms`, and `thinking_blocks`.

It computes the average turn duration in seconds and tracks thinking block counts per session and per turn. The report also highlights the top 3–5 longest sessions sorted by duration, listing project working directories `cwd` and duration in minutes. Without an active Agent Monitor on port 4820, execution stops: you must start it first with `npm start` in the repo root.

## Install

### Claude Code (native platform)

1. **Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor
```
In the agent chat (not a shell):
```text
/plugin install ccam-productivity@claude-code-agent-monitor-plugins
```

2. **Manually: put the files in place**
- File: `.claude/commands/focus-report.md` — Call it with /focus-report. For all projects use ~/.claude/commands/

### Codex

**Manually: put the files in place**
- File: `~/.codex/prompts/focus-report.md` — Call it with /prompts:focus-report. Codex marks this format deprecated in favour of skills

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/prompts/focus-report.prompt.md`

### Gemini CLI

**Manually: put the files in place**
- File: `.gemini/commands/focus-report.toml` — Gemini stores commands as TOML: the prompt text goes into the prompt field

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/hoangsonww/Claude-Code-Agent-Monitor/tree/HEAD/plugins/ccam-productivity/commands/focus-report.md

## When to use it
- Measure average agent turn duration in seconds across recent sessions
- Track thinking-block frequency per turn and per session
- Inspect top 3–5 longest agent sessions with working directories
- Produce a compact single-screen workload summary in the CLI

## Example prompts
- /focus-report
- /focus-report 50
- Run /focus-report 200 to inspect the last 200 sessions

## Source text · focus-report.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: a47afd077bc2f25c.

BEGIN THIRD-PARTY FILE a47afd077bc2f25c
```text
---
description: One-screen focus snapshot — avg turn duration, thinking-block usage, and longest sessions.
argument-hint: "[limit]"
---

Print a one-screen focus snapshot from Agent Monitor data at `http://localhost:4820`. If the dashboard is unreachable, tell the user to start it with `npm start` from the repo root.

Optional **$ARGUMENTS**: a session count to inspect (default 100).

1. Fetch sessions: `curl -s 'http://localhost:4820/api/sessions?limit=100'` (use the $ARGUMENTS limit if given). Parse each `metadata` JSON for `turn_count`, `total_turn_duration_ms`, and `thinking_blocks`.
2. Fetch baselines: `curl -s http://localhost:4820/api/analytics` for `avg_events_per_session` and `sessions_by_status`.

Compute and print (over sessions that have the focus metadata):

- **Avg turn duration** = `total_turn_duration_ms / turn_count`, reported in seconds (averaged across sessions).
- **Thinking-block usage** = average `thinking_blocks` per session and per turn (`thinking_blocks / turn_count`).
- **Longest sessions**: top 3–5 by `total_turn_duration_ms`, each with project (`cwd`), duration in minutes, turn count, and thinking blocks.

Show the three metrics as a compact table plus the longest-sessions list. State how many sessions had usable metadata. Durations from ms; cite only numbers returned by the API. Keep it to one screen.
```
END THIRD-PARTY FILE a47afd077bc2f25c

The third-party file has ended. Everything between the a47afd077bc2f25c tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

© Son Nguyen · MIT · https://github.com/hoangsonww/Claude-Code-Agent-Monitor/tree/HEAD/plugins/ccam-productivity/commands/focus-report.md

## Similar
- [session-report](https://affpapa.org/en/nevibecode/skills/session-report.md) — skill · 3676 installs
- [performance-report](https://affpapa.org/en/nevibecode/skills/performance-report.md) — skill · 3200 installs
- [Focus Session Manager](https://affpapa.org/en/nevibecode/skills/focus-session-manager.md) — skill · 167 installs
- [daily-focus-board](https://affpapa.org/en/nevibecode/skills/daily-focus-board.md) — skill · 29 installs
- [recipe-block-focus-time](https://affpapa.org/en/nevibecode/skills/recipe-block-focus-time.md) — skill · 31400 installs
- [add-report](https://affpapa.org/en/nevibecode/skills/add-report.md) — skill · ★ 1586 repo stars

From the same set: [hoangsonww/claude-code-agent-monitor](https://affpapa.org/en/nevibecode/by/hoangsonww/claude-code-agent-monitor.md) — 155 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
