Run the watcher with recent filter to see only active sessions:
pnpm watch --recentYou should see:
- This current session showing as "Working" (since Claude is responding)
- Any other Claude Code sessions you have open
The watcher should detect this session and show status changes as we interact:
-
Start the watcher in one terminal:
pnpm watch --recent
-
Observe status transitions:
- When you send a message → status should be "Working"
- When Claude finishes responding → status should be "Waiting for input"
- After 5 minutes of no activity → status becomes "Idle"
Open a new terminal and start a simple Claude Code session:
# In a test directory
mkdir -p /tmp/test-claude-session
cd /tmp/test-claude-session
claude "say hello"The watcher should show:
[NEW]event when the session starts- Status updates as the session progresses
- The session grouped under
/tmp/test-claude-session
Open 2-3 Claude Code sessions in different directories:
# Terminal 1
cd ~/project-a && claude "explain this codebase"
# Terminal 2
cd ~/project-b && claude "help me write tests"
# Terminal 3 - watch them all
pnpm watch --activeVerify:
- All sessions appear grouped by their working directory
- Status updates appear in real-time as each session progresses
- The
--activefilter hides idle sessions
- Start a session:
claude "hello" - Verify it appears with "Working" then "Waiting" status
- Let it sit for 5+ minutes
- Verify it transitions to "Idle"
- Resume it:
claude --resume - Verify status changes back to active
Start a session that will request file edits:
cd /tmp/test-dir
echo "test" > file.txt
claude "edit file.txt to say 'hello world'"When Claude requests approval for the edit:
- Status should show "Needs approval" (orange indicator)
- After approving, status should change
To test with many sessions, you can generate mock JSONL files:
# Create a mock session file
mkdir -p ~/.claude/projects/-tmp-mock-test
cat > ~/.claude/projects/-tmp-mock-test/test-session.jsonl << 'EOF'
{"type":"user","cwd":"/tmp/mock-test","sessionId":"test-123","timestamp":"2026-01-07T12:00:00Z","message":{"role":"user","content":"test prompt"},"uuid":"a","parentUuid":null,"isSidechain":false,"userType":"external","version":"2.0.0","gitBranch":"main"}
{"type":"assistant","cwd":"/tmp/mock-test","sessionId":"test-123","timestamp":"2026-01-07T12:00:01Z","message":{"role":"assistant","content":[{"type":"text","text":"Hello!"}]},"uuid":"b","parentUuid":"a","isSidechain":false,"userType":"external","version":"2.0.0","gitBranch":"main","requestId":"req-1"}
EOFThe watcher should detect this mock session.
- Empty session file: Create an empty
.jsonlfile - should be skipped - Malformed JSON: Add a line with invalid JSON - should be skipped without crashing
- Missing metadata: Create a session without
cwdfield - should be skipped - File deletion: Delete a session file while watching - should emit "deleted" event
| Scenario | Expected Status |
|---|---|
| User just sent a message | Working |
| Claude finished responding | Waiting for input |
| Claude requested a tool | Needs approval |
| No activity for 5+ minutes | Idle |
| File deleted | Session removed from list |
If the watcher isn't showing expected sessions:
-
Check the Claude projects directory exists:
ls ~/.claude/projects/ -
Verify there are
.jsonlfiles:find ~/.claude/projects -name "*.jsonl" | head -5
-
Check a session file is valid JSONL:
head -3 ~/.claude/projects/*/$(ls ~/.claude/projects/*/ | head -1)
-
Run without filters to see all sessions:
pnpm watch