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:Unique identifier for the session in format:
{tool}-{provider}-{pid}-{timestamp}Active provider name (AWS Bedrock, Google Vertex AI, Anthropic API, etc.)
Authentication method being used (API key, AWS credentials, subscription, etc.)
Primary model ID for interactive work
Model ID for background operations (usually Haiku)
AI tool being used (typically
cc for Claude Code)Cloud region (for AWS/GCP providers)
Project ID (for Google Vertex AI)
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 multipleai 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:- Created when you run
aiwith a script or enter interactive mode - Tracked in
~/.ai-runner/sessions/ - Cleaned up automatically on exit
- Isolated - each session has its own environment variables
Session Information Files
Session data is stored in:- Provider name and configuration
- Model IDs
- Authentication method
- Session metadata
Exit Cleanup
When anai session exits:
- Session info file is deleted from
~/.ai-runner/sessions/ - Environment variables are restored to original state
- Provider cleanup hooks run (if defined)
- Temporary files are removed
No Sessions Running
Multiple Parallel Sessions
You can run multipleai sessions in parallel: