Skip to main content

Fleet monitoring for Claude Code sessions - TUI dashboard, MCP server, and terminal focus

Project description

Claude Fleet Monitor

Fleet monitoring for Claude Code sessions. See all your running sessions at a glance, get notified when one needs input, and jump to the right terminal tab instantly.

Features

  • TUI Dashboard -- live view of all Claude Code sessions with status, detail, and age
  • Process Discovery -- finds running sessions via /proc even before hooks fire
  • MCP Server -- any Claude session can query fleet status programmatically
  • Terminal Focus -- switch to a session's Konsole tab (or raise its window on other terminals) by name or PID
  • Desktop Notifications -- notify-send alerts when a session has been idle for over 2 minutes
  • Hooks Integration -- Claude Code hooks emit real-time status (running, idle, error) as sessions interact

Install

pip install claude-fleet-monitor
claude-fleet install

Or install from source:

git clone https://github.com/andre-motta/claude-fleet-monitor.git
cd claude-fleet-monitor
pip install .
claude-fleet install

Restart your Claude Code sessions after installing to activate hooks.

Dependencies

  • jq -- JSON processing in hook/monitor scripts
  • python3 >= 3.10
  • uv -- for running the MCP server

Optional:

  • qdbus -- Konsole tab switching (KDE)
  • xdotool -- generic window focus (X11)
  • notify-send -- desktop notifications

Usage

TUI Dashboard

claude-fleet monitor              # default 2s refresh
claude-fleet monitor --refresh 5  # 5s refresh

Or run the script directly:

~/.claude/bin/fleet-monitor.sh

Focus a Session

claude-fleet focus autofix         # by repo name
claude-fleet focus 2467709         # by PID
claude-fleet focus proc-2467709    # by session ID

On Konsole: switches to the exact tab. On other terminals: raises the window.

Quick Status (no TUI)

claude-fleet status

MCP Tools

Any Claude Code session with the fleet MCP server can use these tools:

Tool Description
fleet_status All sessions with summary counts
fleet_session Single session detail by ID or prefix
fleet_sessions_needing_attention Sessions idle over 2 minutes
fleet_focus Focus terminal tab for a session
fleet_cleanup Remove stale ended session files

Just ask Claude: "what sessions are running?" or "focus on the autofix session".

How It Works

Claude Code Session A --\                                      <-- MCP server
Claude Code Session B ---|-- hooks --> ~/.claude/fleet/*.json  <-- TUI monitor
Claude Code Session C --/                                      <-- fleet-focus
  1. Hooks in ~/.claude/settings.json fire on session events (start, prompt, tool use, stop, end)
  2. Each hook writes/updates a JSON status file in ~/.claude/fleet/
  3. Process discovery also scans /proc for claude processes to find sessions that started before hooks were installed
  4. The TUI monitor, MCP server, and CLI all read these status files

Session States

State Meaning
STARTED Session just began
RUNNING Processing a prompt or using tools
IDLE Finished responding, waiting for input
ERROR Turn failed (API error)
ENDED Session closed
DISCOVERED Found via process scan, no hook data yet

Configuration

Environment Variables

Variable Default Description
FLEET_DIR ~/.claude/fleet Directory for session status files

Uninstall

claude-fleet uninstall              # removes everything including data
claude-fleet uninstall --keep-data  # keeps ~/.claude/fleet/

Publishing

This project uses trusted publishing via GitHub Actions. To release:

git tag v0.1.0
git push origin v0.1.0

The workflow builds and publishes to PyPI automatically.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_fleet_monitor-0.1.2.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_fleet_monitor-0.1.2-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file claude_fleet_monitor-0.1.2.tar.gz.

File metadata

  • Download URL: claude_fleet_monitor-0.1.2.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for claude_fleet_monitor-0.1.2.tar.gz
Algorithm Hash digest
SHA256 67138692b678d65da76dbeccc6b81d53b39acb08289e936395b64726783ec389
MD5 30c1177aded1f81fd14d78be57b51c9e
BLAKE2b-256 c9cd3f4aa28fd5f43d2612f7d396ddf809746b144dfeb3252fc2bc035918d351

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_fleet_monitor-0.1.2.tar.gz:

Publisher: publish.yml on andre-motta/claude-fleet-monitor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file claude_fleet_monitor-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_fleet_monitor-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7141e317eb737e18f1e49c8997bde1e45791cca5d7e16ca1748e094e6c195f07
MD5 d6f6c68c5af64ca9dd6cb9d69707cc8a
BLAKE2b-256 bd8128bf7254e85f6c63206a80262aaeed6e150a74f81d6fa0baa746050e419f

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_fleet_monitor-0.1.2-py3-none-any.whl:

Publisher: publish.yml on andre-motta/claude-fleet-monitor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page