Watch Mode
FreshOverview
Watch mode keeps the knowledge graph live during active development. Graphify monitors your directory for file changes and triggers incremental rebuilds automatically.
Start Watch Mode
/graphify . --watch
/graphify ./src --watch # Watch a specific subfolderThe process runs in the foreground. Stop it with Ctrl+C.
How It Works
flowchart TD
A[Watch mode started] --> B[Monitor directory for changes]
B --> C{File changed?}
C -->|No| B
C -->|Code file| D[Tree-sitter AST rebuild - instant]
C -->|Prose or doc file| E[LLM extraction - seconds]
C -->|Image or video| F[Vision and transcription]
D --> G[Merge into graph]
E --> G
F --> G
G --> BPerformance Characteristics
| Change Type | Rebuild Time | LLM Call? |
|---|---|---|
Code file (.py, .ts, .go, etc.) | < 1 second | No |
| Markdown / text file | 2-5 seconds | Yes |
| 5-15 seconds | Yes | |
| Image | 3-10 seconds | Yes (vision) |
| Video | 30s+ | Yes (transcription) |
Code Changes Are Fast
Watch mode is particularly well-suited to code-heavy development. Editing Python, TypeScript, Go, or Rust files triggers near-instant rebuilds because tree-sitter AST extraction runs entirely locally without LLM calls.
Running in Background
To run watch mode in the background while you work:
# macOS/Linux
nohup graphify . --watch > /tmp/graphify-watch.log 2>&1 &
echo "Watch started, PID: $!"
# Stop it later
kill <PID>Or use a terminal multiplexer:
# tmux
tmux new-session -d -s graphify 'graphify . --watch'
tmux attach -t graphify # to see output
tmux kill-session -t graphify # to stopCombining with --no-viz
For faster watch mode (skip HTML regeneration):
/graphify . --watch --no-vizThis updates graph.json and GRAPH_REPORT.md only — no HTML rebuild on every change. Useful if you're primarily querying via slash commands rather than the browser visualization.
Use Cases
Active Feature Development
Keep watch mode running during a long coding session. Your AI assistant's graph context stays current with every save.
Code Review Prep
Run watch mode while making review changes. Query the final graph to verify your changes are reflected correctly before pushing.
Pair Programming
One person runs watch mode. Both developers get live graph updates as code evolves.
Verification
# Start watch mode
/graphify . --watch
# In another terminal, make a change
echo "# Test" >> README.md
# Watch mode should log: "Detected change: README.md — rebuilding..."
# Then: "Graph updated: 1 file reprocessed"