Skip to content

feat: In-CLI performance monitoring dashboard (/perf command) #22483

@1nonlyasta

Description

@1nonlyasta

What would you like to be added?

An in-CLI performance monitoring dashboard accessible via a /perf slash command with subcommands:

  • /perf — Session timing overview, memory summary, tool/API aggregate stats
  • /perf memory — Detailed heap/RSS breakdown with utilization bars and warnings
  • /perf tools — Per-tool execution table (calls, avg latency, success rate)
  • /perf api — Per-model API latency and token usage breakdown
  • /perf export — JSON performance report for CI integration or external analysis

The CLI already has a robust telemetry backend (memory monitor, startup profiler,
OpenTelemetry metrics in packages/core/src/telemetry/) but none of these insights
are surfaced to users. This feature bridges that gap using an Ink-based dashboard
component, following the same patterns as the existing /stats command.

Why is this needed?

  1. Contributors can identify performance regressions during development without
    external profiling tools
  2. Users get visibility into what's consuming time — API calls vs tool execution
  3. CI integration potential for automated regression detection across releases
  4. Complements the existing /stats command with performance-specific views
  5. Aligns with GSoC 2026 Project Idea Configure linter + prettier. #5: "Performance Monitoring and Optimization Dashboard"

I have a working prototype ready and would love to contribute this as a Draft PR.
Happy to adjust the approach based on maintainer feedback.

Additional context

Technical approach follows existing patterns from statsCommand.ts and StatsDisplay.tsx.
Uses SessionMetrics from uiTelemetryService + process.memoryUsage() for real-time data.
New Ink component PerfDisplay.tsx with themed tabular output.

I have a working prototype and am happy to submit it as a Draft PR for review.

Metadata

Metadata

Assignees

Labels

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions