forked from Cranot/deep-research
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmonitor.sh
More file actions
executable file
·52 lines (44 loc) · 1.75 KB
/
monitor.sh
File metadata and controls
executable file
·52 lines (44 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# Monitor running deep-research agents
echo "=== Deep Research Monitor ==="
echo ""
# Count total agents
TOTAL=$(ps aux | grep "claude -p" | grep -v grep | wc -l)
echo "Active agents: $TOTAL"
echo ""
if [ "$TOTAL" -eq 0 ]; then
echo "No agents running."
exit 0
fi
# Show agent tree
echo "Agent Tree:"
echo "─────────────────────────────────────────────────────────────"
ps aux | grep "claude -p" | grep -v grep | while read -r line; do
# Extract the question from the command (handle escaped quotes)
QUESTION=$(echo "$line" | sed 's/.*QUESTION: ["\x27]*\([^"\x27]*\).*/\1/' | head -c 80)
MODEL=$(echo "$line" | grep -oE -- '--model (haiku|sonnet|opus)' | awk '{print $2}')
if [ -n "$QUESTION" ] && [ "$QUESTION" != "$line" ]; then
# Check model to determine level
if [ "$MODEL" = "haiku" ]; then
echo " └─ [haiku] $QUESTION..."
elif [ "$MODEL" = "sonnet" ]; then
echo " └─ [sonnet] $QUESTION..."
else
echo " └─ [opus] $QUESTION..."
fi
fi
done
echo ""
echo "─────────────────────────────────────────────────────────────"
echo ""
# Show reports in progress
echo "Reports directory:"
ls -la reports/ 2>/dev/null | grep -E "^d.*2025" | while read -r line; do
DIR=$(echo "$line" | awk '{print $NF}')
if [ -f "reports/$DIR/SYNTHESIS.md" ]; then
LINES=$(wc -l < "reports/$DIR/SYNTHESIS.md")
echo " 📄 $DIR ($LINES lines)"
else
echo " 📝 $DIR (in progress)"
fi
done