Syntax
Description
Thestats 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
- 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:Expected output
Expected output
JSON Output
Get detailed machine-readable output:JSON output
JSON 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:- <40%: Early phase or new issues being added rapidly
- 40-70%: Active development
- >70%: Mature project or nearing completion
Bottleneck Indicator
Check blocked ratio:- <10%: Good flow
- 10-20%: Some dependencies, manageable
- >20%: Excessive blocking, review dependencies
Activity Level
Assess project velocity:- 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:- <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
What's the difference between stats and status?
What's the difference between stats and status?
- status: Quick overview, minimal info, focused on current state
- stats: Detailed metrics, relationship counts, recent activity trends
status for daily checks, stats for analysis and reporting.How is 'recent activity' calculated?
How is 'recent activity' calculated?
Recent activity looks at the last 7 days based on
updated_at, created_at, and closed_at timestamps.Why might relationship counts seem high?
Why might relationship counts seem high?
Each relationship is counted once, but bidirectional relationships (like blocks) create two entries in the database. The count reflects total relationship records.
Can I customize the recent activity time window?
Can I customize the recent activity time window?
Not currently through the CLI. The 7-day window is hardcoded. For custom ranges, query the JSONL files directly or use the database.
Are archived issues included in counts?
Are archived issues included in counts?
No, archived issues and specs are excluded from all counts.
Can I export stats to a file?
Can I export stats to a file?
Yes:
Troubleshooting
Stats show 0 for everything
Stats show 0 for everything
Cause: No data in database or not in project directorySolution:
- Verify you’re in project root
- Check
.sudocode/directory exists - Run sync:
Recent activity seems inaccurate
Recent activity seems inaccurate
Cause: Timestamps may be from initial import, not actual activitySolution:
Verify with:Check specific issue timestamps.
Relationship counts don't match what I expect
Relationship counts don't match what I expect
Cause: May be counting both directions of bidirectional relationshipsSolution:
Use
--json output to inspect by_type breakdown and verify against your expectations.Activity stats are zero but I've been working
Activity stats are zero but I've been working
Cause: Changes not committed to database or timestamps outdatedSolution:
Related Commands
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:

