Skip to main content

Syntax

Description

The stats command provides detailed metrics and analytics about your sudocode project, including:
  • Entity counts: Total specs and issues
  • Issue breakdowns: Counts by status, ready/blocked analysis
  • Relationship metrics: Total relationships and counts by type
  • Recent activity: Updates, creations, and closures in the last 7 days
This command is perfect for:
  • Project health analysis
  • Understanding project structure
  • Tracking activity trends
  • Generating reports
  • Identifying patterns
For a quick overview, use status instead. Use stats when you need detailed metrics and analytics.

Examples

Basic Statistics

Get project statistics:

JSON Output

Get detailed machine-readable output:

Statistics Explained

Specs Section

  • Total - Number of specification documents in the project

Issues Section

  • Total - All issues across all statuses
  • By Status - Breakdown by each status:
    • open - Not yet started
    • in_progress - Currently being worked on
    • blocked - Cannot proceed due to dependencies
    • needs_review - Completed but awaiting review
    • closed - Completed and accepted
  • Ready - Issues with no blockers, available to start
  • Blocked - Issues with active blocking dependencies

Relationships Section

  • Total - All typed relationships in the project
  • By type - Count for each relationship type:
    • blocks - Blocking dependencies
    • implements - Issue implements spec
    • depends-on - Technical dependencies
    • references - Cross-references
    • related - General associations
    • discovered-from - Feedback origin (if present)

Recent Activity Section

  • specs_updated - Specs modified in last 7 days
  • issues_updated - Issues modified in last 7 days (any field)
  • issues_created - New issues created in last 7 days
  • issues_closed - Issues completed in last 7 days

Common Workflows

Monthly Project Review

1

Generate statistics

2

Analyze metrics

Review:
  • Completion rate (closed vs total)
  • Bottlenecks (blocked count)
  • Activity trends (recent activity)
  • Relationship complexity (total relationships)
3

Generate report

Save to file:

Project Health Dashboard

Create a comprehensive dashboard:

Compare Project Phases

Track metrics over time:

Interpreting Metrics

Completion Rate

Calculate progress:
Healthy range: 40-70% for active projects
  • <40%: Early phase or new issues being added rapidly
  • 40-70%: Active development
  • >70%: Mature project or nearing completion

Bottleneck Indicator

Check blocked ratio:
Healthy range: <20% blocked
  • <10%: Good flow
  • 10-20%: Some dependencies, manageable
  • >20%: Excessive blocking, review dependencies

Activity Level

Assess project velocity:
Interpretation:
  • Velocity: How fast work is completed
  • Burn rate: Net progress (closed - created)
    • Positive: Reducing backlog
    • Zero: Steady state
    • Negative: Backlog growing

Relationship Density

Measure interconnectedness:
Interpretation:
  • <1: Simple, loosely coupled
  • 1-2: Moderate coupling, healthy
  • >2: High coupling, complex dependencies

Scripting Examples

Trend Analysis

Track metrics over time:

Automated Alerts

Set up threshold alerts:

Relationship Report

Analyze dependency patterns:

Common Questions

  • status: Quick overview, minimal info, focused on current state
  • stats: Detailed metrics, relationship counts, recent activity trends
Use status for daily checks, stats for analysis and reporting.
Recent activity looks at the last 7 days based on updated_at, created_at, and closed_at timestamps.
Each relationship is counted once, but bidirectional relationships (like blocks) create two entries in the database. The count reflects total relationship records.
Not currently through the CLI. The 7-day window is hardcoded. For custom ranges, query the JSONL files directly or use the database.
No, archived issues and specs are excluded from all counts.
Yes:

Troubleshooting

Cause: No data in database or not in project directorySolution:
  1. Verify you’re in project root
  2. Check .sudocode/ directory exists
  3. Run sync:
Cause: Timestamps may be from initial import, not actual activitySolution: Verify with:
Check specific issue timestamps.
Cause: May be counting both directions of bidirectional relationshipsSolution: Use --json output to inspect by_type breakdown and verify against your expectations.
Cause: Changes not committed to database or timestamps outdatedSolution:

status

Quick project overview

ready

Find ready work

blocked

Find blocked issues

issue list

List all issues

spec list

List all specs

Next Steps

1

Review statistics

2

Identify concerns

Look for:
  • High blocked count
  • Low ready count
  • Stagnant activity
  • High relationship density
3

Take action

Based on findings:
  • Unblock issues
  • Create new work
  • Review dependencies
  • Adjust priorities
4

Track over time

Save stats snapshots: