Bug Report: `sessions.forEach is not a function` error in hive-mind sessions command
- Dominant language
- TypeScript
- Stars
- 72.7k
- Forks
- 8.6k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 83
Description
### Description
The `claude-flow hive-mind sessions` command throws an error in version v2.0.0-alpha.72:
```
Error: sessions.forEach is not a function
```
### Steps to Reproduce
1. Install claude-flow alpha version: `npx claude-flow@alpha --version` (shows v2.0.0-alpha.72)
2. Have existing hive-mind sessions in `.hive-mind/sessions/` directory
3. Run: `npx claude-flow@alpha hive-mind sessions`
4. Observe the error
### Expected Behavior
The command should list all hive-mind sessions or show "No active or paused sessions found" if none exist.
### Actual Behavior
The command throws: `Error: sessions.forEach is not a function`
### Environment
- claude-flow version: v2.0.0-alpha.72
- OS: Linux 5.15.0-144-generic
- Node version: v20.19.4
- NPM version: 11.4.2
### Additional Context
- The bug appears to be a regression between alpha.53 and alpha.72
- Version alpha.53 works correctly: `npx claude-flow@2.0.0-alpha.53 hive-mind sessions`
- Session files exist and are valid JSON in `.hive-mind/sessions/`
- The error suggests the code is trying to call `.forEach()` on a non-array value
(Bug report prepared by Claude Code :)
Contributor guide
Research direction
Start at the `hive-mind sessions` command and inspect how JSON files in `.hive-mind/sessions/` are loaded and iterated in alpha.72, comparing its behavior with alpha.53 if useful. Done means the command lists existing sessions or prints "No active or paused sessions found" without throwing the `forEach` error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100