Bug Description
ClawChain cannot discover any Codex/Claude Code sessions on macOS. The dashboard shows zero session cards despite active Codex processes running.
Root Cause
In clawchain/host_monitor.py, the _scan_processes_via_pgrep() function uses pgrep -af . to scan running processes. On Linux, this outputs PID full_command_line, but on macOS the -a flag is not supported the same way — it only outputs bare PIDs (e.g., 1, 192, 35024).
Since _matches_agent() tries to regex-match agent patterns (like codex) against these lines, it never finds a match because the lines contain only numbers.
# Current code — works on Linux, broken on macOS
probe = subprocess.run(
["pgrep", "-af", "."],
capture_output=True, text=True, check=False,
)
macOS pgrep -af . output:
Linux pgrep -af . output:
35024 node /usr/bin/codex
35025 codex resume
Environment
- macOS Darwin 25.3.0 (arm64)
- GNU bash 3.2.57
- Python 3.12
- ClawChain 0.1.0
Suggested Fix
Replace pgrep -af . with ps -eo pid,args, which outputs PID + full command line on both macOS and Linux. Keep pgrep as a fallback if ps is unavailable.
Steps to Reproduce
- Install ClawChain on macOS
- Start a Codex session
- Run the setup script and open the dashboard
- Observe that no sessions appear despite
ps aux | grep codex showing running processes
🤖 Generated with Claude Code
Bug Description
ClawChain cannot discover any Codex/Claude Code sessions on macOS. The dashboard shows zero session cards despite active Codex processes running.
Root Cause
In
clawchain/host_monitor.py, the_scan_processes_via_pgrep()function usespgrep -af .to scan running processes. On Linux, this outputsPID full_command_line, but on macOS the-aflag is not supported the same way — it only outputs bare PIDs (e.g.,1,192,35024).Since
_matches_agent()tries to regex-match agent patterns (likecodex) against these lines, it never finds a match because the lines contain only numbers.macOS
pgrep -af .output:Linux
pgrep -af .output:Environment
Suggested Fix
Replace
pgrep -af .withps -eo pid,args, which outputs PID + full command line on both macOS and Linux. Keeppgrepas a fallback ifpsis unavailable.Steps to Reproduce
ps aux | grep codexshowing running processes🤖 Generated with Claude Code