Description
The sessions path is hardcoded in two files:
Sources/CodexCore/SessionLoader.swift:
public static let sessionsRoot = URL(fileURLWithPath: "/Users/oliver/.codex/sessions")
Sources/CodexMonitorCLI/Codex.swift:
static let sessionsRoot = URL(fileURLWithPath: "/Users/oliver/.codex/sessions")
This causes the tool to fail on any machine where the username is not oliver.
Error
Error: Invalid sessions path: /Users/oliver/.codex/sessions/2026/01/19
Suggested Fix
Replace the hardcoded path with a dynamic one using the current user's home directory:
static let sessionsRoot = FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent(".codex/sessions")
This allows the tool to work on any macOS machine regardless of username.
Environment
- macOS (arm64)
- Installed via Homebrew:
brew install cocoanetics/tap/codexmonitor
- Version: 0.1.0