ワンクリックで
grepai-watch-daemon
Configure and manage the GrepAI watch daemon. Use this skill for real-time code indexing and file monitoring.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Configure and manage the GrepAI watch daemon. Use this skill for real-time code indexing and file monitoring.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Reference for all GrepAI MCP tools. Use this skill to understand available MCP tools and their parameters.
Advanced search options in GrepAI. Use this skill for JSON output, compact mode, and AI agent integration.
Find function callees with GrepAI trace. Use this skill to discover what functions a specific function calls.
Find function callers with GrepAI trace. Use this skill to discover what code calls a specific function.
Build complete call graphs with GrepAI trace. Use this skill for recursive dependency analysis.
Supported programming languages in GrepAI. Use this skill to understand which languages can be indexed and traced.
| name | grepai-watch-daemon |
| description | Configure and manage the GrepAI watch daemon. Use this skill for real-time code indexing and file monitoring. |
This skill covers the grepai watch command and daemon management for real-time code indexing.
The watch daemon:
cd /your/project
grepai watch
Output:
🔍 GrepAI Watch
Scanning files...
Found 245 files
Processing chunks...
████████████████████████████████ 100%
Indexed 1,234 chunks
Watching for changes...
Press Ctrl+C to stop.
grepai watch --background
Output:
🔍 GrepAI Watch (background)
Daemon started with PID 12345
Log file: ~/.grepai/daemon.log
grepai watch --status
Output:
✅ GrepAI Daemon Running
PID: 12345
Started: 2025-01-28 10:30:00
Project: /path/to/project
Statistics:
- Files indexed: 245
- Chunks: 1,234
- Last update: 2 minutes ago
grepai watch --stop
Output:
✅ Daemon stopped (PID 12345)
| Command | Description |
|---|---|
grepai watch | Start daemon in foreground |
grepai watch --background | Start daemon in background |
grepai watch --status | Check daemon status |
grepai watch --stop | Stop running daemon |
# .grepai/config.yaml
watch:
# Debounce delay in milliseconds
# Groups rapid file changes together
debounce_ms: 500
When you save a file, editors often write multiple times quickly. Debouncing waits for changes to settle:
| Value | Behavior |
|---|---|
100 | More responsive, more reindexing |
500 | Balanced (default) |
1000 | Less responsive, fewer reindexing |
The daemon indexes files:
.gitignoreLarge codebases show progress:
Scanning files...
Found 10,245 files
Processing chunks...
████████████████░░░░░░░░░░░░░░░░ 50% (5,122/10,245)
| Codebase | Files | Time (Ollama) | Time (OpenAI) |
|---|---|---|---|
| Small | 100 | ~30s | ~10s |
| Medium | 1,000 | ~5min | ~1min |
| Large | 10,000 | ~30min | ~5min |
After initial indexing, the daemon watches for:
Uses OS-native file watching:
| Action | Result |
|---|---|
| Save existing file | Re-embed file chunks |
| Create new file | Index new chunks |
| Delete file | Remove from index |
| Rename file | Update path, keep vectors |
Create ~/Library/LaunchAgents/com.grepai.watch.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.grepai.watch</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/grepai</string>
<string>watch</string>
</array>
<key>WorkingDirectory</key>
<string>/path/to/your/project</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
Load:
launchctl load ~/Library/LaunchAgents/com.grepai.watch.plist
Create ~/.config/systemd/user/grepai-watch.service:
[Unit]
Description=GrepAI Watch Daemon
After=network.target
[Service]
Type=simple
WorkingDirectory=/path/to/your/project
ExecStart=/usr/local/bin/grepai watch
Restart=always
[Install]
WantedBy=default.target
Enable:
systemctl --user enable grepai-watch
systemctl --user start grepai-watch
# Background daemon logs
tail -f ~/.grepai/daemon.log
# Or with systemd
journalctl --user -u grepai-watch -f
Run separate daemons for each project:
# Terminal 1: Project A
cd /path/to/project-a
grepai watch --background
# Terminal 2: Project B
cd /path/to/project-b
grepai watch --background
For multi-project setups:
grepai workspace create my-workspace
grepai workspace add my-workspace /path/to/project-a
grepai workspace add my-workspace /path/to/project-b
grepai watch --workspace my-workspace
❌ Problem: "Another daemon is already running" ✅ Solution:
grepai watch --stop
grepai watch --background
❌ Problem: "Config not found" ✅ Solution: Initialize first:
grepai init
grepai watch
❌ Problem: "Embedder connection failed" ✅ Solution: Start your embedding provider:
ollama serve # For Ollama
❌ Problem: Files not being indexed ✅ Solution: Check ignore patterns in config, ensure file extension is supported
❌ Problem: Indexing very slow ✅ Solutions:
❌ Problem: Index seems outdated ✅ Solution: Clear and reindex:
rm .grepai/index.gob
grepai watch
❌ Problem: Changes not detected ✅ Solutions:
echo 65536 | sudo tee /proc/sys/fs/inotify/max_user_watches
Regular health check:
grepai status
Output:
✅ GrepAI Status
Project: /path/to/project
Config: .grepai/config.yaml
Embedder: Ollama (nomic-embed-text)
Storage: GOB (.grepai/index.gob)
Index:
- Files: 245
- Chunks: 1,234
- Size: 12.5 MB
- Last updated: 2025-01-28 10:30:00
Daemon: Running (PID 12345)
Watch daemon status:
✅ Watch Daemon Active
Mode: Background
PID: 12345
Project: /path/to/project
Initial Index:
- Files scanned: 245
- Chunks created: 1,234
- Duration: 45s
Real-time Monitor:
- Debounce: 500ms
- Events processed: 23
- Last event: 5 minutes ago
Next steps:
- Run 'grepai search "query"' to search
- Run 'grepai watch --status' to check status
- Run 'grepai watch --stop' to stop daemon