GeezerVison is showing github.com — stats --project '' flag does not filter by current project · Issue #9958 · anomalyco/opencode
stats --project '' flag does not filter by current project #9958
Description
Bug Description
The opencode stats --project '' command is documented to filter stats for the current project, but it shows global stats instead.
Steps to Reproduce
-
Navigate to a project directory with OpenCode sessions:
-
Run the stats command with empty project filter:
opencode stats --project ''
Expected Behavior
According to opencode stats --help:
--project filter by project (default: all projects, empty string: current project)
The command should show stats only for sessions in the current project directory.
Actual Behavior
The command shows stats for all 123 sessions globally, regardless of the current directory.
Additional Context
- All sessions appear to have
projectId: "global" when checked via opencode session list --format json
- Even when running from different project directories, the stats remain the same
- Using a full path like
opencode stats --project /path/to/project returns 0 sessions
Environment
- OpenCode version:
1.1.31
- OS: macOS
- Shell: zsh
Possible Cause
It appears that either:
- The project tracking isn't working correctly (all sessions marked as 'global')
- The
--project '' flag filtering logic has a bug
- Projects need to be explicitly initialized with
/init to be tracked properly (not documented)
Would appreciate clarification on the expected behavior and a fix for the filtering.
Reacted by krauhen
Reacted by krauhen
Activity
github-actions commented on Jan 22, 2026
This issue might be a duplicate of existing issues. Please check:
These issues describe similar problems with sessions being mixed across directories and the inability to filter by current project/directory. Your issue specifically focuses on the --project '' flag not filtering by current project, which may be related to these broader project/directory filtering challenges.
Feel free to ignore if your specific case differs from these issues.
Metadata
Metadata
Development
No branches or pull requestsIssue actions