Skip to main content
The ai-sessions command displays information about currently running ai sessions, including the provider, model, and session ID.

Syntax

What It Shows

For each active session:
string
Unique identifier for the session in format: {tool}-{provider}-{pid}-{timestamp}
string
Active provider name (AWS Bedrock, Google Vertex AI, Anthropic API, etc.)
string
Authentication method being used (API key, AWS credentials, subscription, etc.)
string
Primary model ID for interactive work
string
Model ID for background operations (usually Haiku)
string
AI tool being used (typically cc for Claude Code)
string
Cloud region (for AWS/GCP providers)
string
Project ID (for Google Vertex AI)
boolean
Whether agent teams are enabled

Example Output

Use Cases

Monitor Active Sessions

See what AI sessions are running and which resources they’re using:

Debug Multiple Sessions

When running multiple ai instances, identify which terminal corresponds to which provider:

Track Resource Usage

Identify sessions using expensive models or cloud resources:

Session Cleanup

Before shutting down, verify all sessions have exited:

Session Lifecycle

Sessions are:
  1. Created when you run ai with a script or enter interactive mode
  2. Tracked in ~/.ai-runner/sessions/
  3. Cleaned up automatically on exit
  4. Isolated - each session has its own environment variables

Session Information Files

Session data is stored in:
These files are automatically created and deleted. They contain:
  • Provider name and configuration
  • Model IDs
  • Authentication method
  • Session metadata

Exit Cleanup

When an ai session exits:
  1. Session info file is deleted from ~/.ai-runner/sessions/
  2. Environment variables are restored to original state
  3. Provider cleanup hooks run (if defined)
  4. Temporary files are removed

No Sessions Running

Multiple Parallel Sessions

You can run multiple ai sessions in parallel:
Each session is independent with its own provider and model configuration.

ai

Start a new AI session

ai-status

Show configuration status