The longer a codebase grows without deliberate refactoring, the more expensive each new feature becomes.Documentation Index
Fetch the complete documentation index at: https://kode-f177b001.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
kode daemon addresses this by running silently in the background, polling your git history for code health signals — blast radius growth, circular dependencies, repeated anti-patterns — and creating speculative fixes on Ghost Branches before the debt becomes structural. You decide whether to merge the fix; the daemon handles the detection and generation.
How the daemon works
The daemon wakes every 30 seconds by default (configurable with
--poll) and reads the most recent commits in your repository. It waits until it sees at least 3 new commits since the last analysis cycle (configurable with --lag) before proceeding. This ensures it analyses real work, not isolated fixups.When a finding crosses the threshold, Kode speculatively generates a refactoring on a Ghost Branch worktree and validates it against your test suite. This happens entirely in the background — your working tree is never touched.
Starting the daemon
tmux, screen, or a background process manager) during active development.
All flags
| Flag | Description | Default |
|---|---|---|
--poll | Poll interval in seconds | 30 |
--lag | Number of new commits to wait for before analyzing | 3 |
--threshold | Blast radius growth percentage that triggers a fix | 40.0 |
--once | Run a single analysis pass and exit | false |
--project-dir | Project root directory | current working directory |
Single-shot CI mode
Pass--once to run exactly one analysis cycle and exit. This mode does not require an API key — it performs the analysis phase only, without generating Ghost Branch fixes. It is designed to be used as a code-health gate in CI pipelines.
0 if the codebase is clean or code 1 if issues were found:
Typical workflows
Development: persistent background watcher
Run the daemon alongside your normal development workflow in a dedicated terminal pane:--lag on repos with a high commit frequency to avoid analysis running on every trivial fix.
CI: code health gate
Add akode daemon --once step to your pipeline to fail the build when blast radius growth exceeds your threshold:
Tuning the threshold
The--threshold flag controls how sensitive the daemon is. A lower value means more findings; a higher value means only severe growth is flagged.
| Threshold | Behaviour |
|---|---|
20.0 | Aggressive — flags moderate drift; useful on strictly-layered codebases |
40.0 (default) | Balanced — catches meaningful growth without excessive noise |
60.0 | Conservative — only flags severe structural regressions |
Next steps
Loop Mode
Trigger the full pipeline manually for a specific task, with Ghost Branch exploration and automatic rollback.
MCP Integration
Expose Kode’s engine to Claude Desktop and other agents via the Model Context Protocol.