Skip to main content
command CX Codex

whats-next · hoangsonww — Claude Code command: what it does, how to install

The whats-next command for Claude Code checks active Agent Monitor sessions and recent errors to suggest the next coding step.

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 whats-next does

The command talks to a local Agent Monitor instance running at http://localhost:4820. It pulls the last twenty entries from /api/sessions?limit=20 to spot tasks with running, error, or abandoned states. For each unfinished entry, it inspects the final events via /api/events?session_id=<id>.

It parses the last tool_name, recent summaries, and traces like APIError or Compaction. After reading the log, it prints a prioritized list of three to five items containing the project path, status, and an actionable suggestion to resume, debug, or close out the task.

Without an active monitor on http://localhost:4820 the request fails immediately, so start the dashboard beforehand with npm start in the monitor repository root. You can also pass a project folder argument to limit the audit to a single repository.

What it helps with

  • locate recent agent errors across unfinished runs
  • pick up interrupted coding sessions without rereading logs
  • scope pending tasks to a specific project folder
  • decide whether to debug an error or re-run after compaction

Example prompts for the agent

  • /whats-next
  • /whats-next ./backend
  • Check Agent Monitor and suggest what to work on next

How to install whats-next

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/commands/whats-next.md

Call it with /whats-next. For all projects use ~/.claude/commands/

Questions about whats-next

How to install whats-next in Claude Code?

Add the marketplace source and install the package by running /plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor followed by /plugin install ccam-productivity@claude-code-agent-monitor-plugins. Alternatively, place the file directly at .claude/commands/whats-next.md.

What does whats-next do?

It queries the local Agent Monitor API, checks unfinished agent sessions, and outputs an actionable list prioritizing unresolved errors and abandoned work.

What is required to run whats-next?

The command requires the Agent Monitor service on http://localhost:4820. If the dashboard is unreachable, launch it by running npm start from the repository root.

Source text

whats-next.md · MIT
---
description: Suggest the next action from your most recent in-progress sessions and recent errors.
argument-hint: "[project-path]"
---

Recommend what to pick up next, using 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 project path (`cwd`) to scope the suggestion to one project; otherwise consider all recent work.

1. Fetch recent sessions: `curl -s 'http://localhost:4820/api/sessions?limit=20'` (already sorted most-recently-updated first).
2. For the most recent unfinished sessions (`status` of `running`, `error`, or `abandoned`), fetch their events to see where they left off:
   `curl -s 'http://localhost:4820/api/events?session_id=<id>'` — look at the last few events (last `tool_name`, `summary`, and any `APIError` / `Compaction` event types).

Print a short, prioritized "Next up" list (top 3–5 items). For each item give:

- The project (`cwd`) and session status.
- What it was last doing (from the final events / last tool used).
- A concrete suggested next action (resume, debug the error, re-run after compaction, or close out).

Put unresolved errors and abandoned-mid-task sessions at the top. Keep it to one screen and cite only data returned by the API.

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

Similar slash commands

All slash commands for Agent setup: memory, context, orchestration →

whats-next by other authors comes first.

From the same set155

The whole set →

Project sponsors

Companies that keep this analytics open