GrepAI Watch Daemon
This skill covers the grepai watch command and daemon management for real-time code indexing.
When to Use This Skill
- Starting initial code indexing
- Setting up real-time file monitoring
- Running the daemon in background
- Troubleshooting indexing issues
What the Watch Daemon Does
The watch daemon:
- Scans all source files in your project
- Chunks code into segments (~512 tokens)
- Generates embeddings via your configured provider
- Stores vectors in your configured backend
- Monitors for file changes in real-time
- Updates the index when files change
Basic Usage
Start Watching (Foreground)
Output:
Press Ctrl+C to stop.
Start in Background
Output:
Check Daemon Status
Output:
Stop the Daemon
Output:
Command Reference
Configuration
Watch Settings
Debounce Explained
When you save a file, editors often write multiple times quickly. Debouncing waits for changes to settle:
Initial Indexing
What Gets Indexed
The daemon indexes files:
- Matching supported extensions (.go, .js, .ts, .py, etc.)
- Not in ignore patterns (node_modules, .git, etc.)
- Respecting
.gitignore
Indexing Progress
Large codebases show progress:
Indexing Time Estimates
Real-Time Monitoring
After initial indexing, the daemon watches for:
- File creation
- File modification
- File deletion
- File renames
File Change Detection
Uses OS-native file watching:
- macOS: FSEvents
- Linux: inotify
- Windows: ReadDirectoryChangesW
What Triggers Reindexing
Background Daemon Management
Starting on System Boot
macOS (launchd)
Create ~/Library/LaunchAgents/com.grepai.watch.plist:
Load:
Linux (systemd)
Create ~/.config/systemd/user/grepai-watch.service:
Enable:
Checking Logs
Multiple Projects
One Daemon Per Project
Run separate daemons for each project:
Using Workspaces
For multi-project setups:
Troubleshooting
Daemon Won't Start
❌ Problem: "Another daemon is already running" ✅ Solution:
❌ Problem: "Config not found" ✅ Solution: Initialize first:
❌ Problem: "Embedder connection failed" ✅ Solution: Start your embedding provider:
Indexing Issues
❌ Problem: Files not being indexed ✅ Solution: Check ignore patterns in config, ensure file extension is supported
❌ Problem: Indexing very slow ✅ Solutions:
- Use OpenAI for faster cloud embeddings
- Add more ignore patterns
- Increase chunking size
❌ Problem: Index seems outdated ✅ Solution: Clear and reindex:
File Watch Issues
❌ Problem: Changes not detected ✅ Solutions:
- Reduce debounce_ms
- Check inotify limits (Linux):
Best Practices
- Run in background: For continuous monitoring
- Use workspace for monorepos: Better organization
- Set up auto-start: launchd or systemd
- Check logs periodically: Monitor for errors
- Reindex after config changes: Especially after changing embedding model
Status Check
Regular health check:
Output:
Output Format
Watch daemon status:


