Harness Deep Dive
Kompile's harness is the execution layer that sits between your coding agents (or direct LLM sessions) and your repositories, terminals, and quotas. It is deliberately opinionated: instead of trusting prompts to enforce discipline, it combines deterministic pre-tool enforcement, bounded coding tools, fail-closed verification, controlled subagent delegation, and evidence-backed auditing.
If you want the philosophy first, start with Why Kompile Is Opinionated. Otherwise, use the map below to jump straight to the subsystem you need.
How the harness fits together
┌─────────────────────────────────────────────────────────────────────────┐
│ Surfaces & Clients │
│ CLI TUI (kompile chat) · Web Harness (--web) · ACP v1 (Editors) │
│ Passthrough CLIs (Claude, Codex, agy, OpenCode) · Mobile C ABI │
└───────────────────────────────────┬─────────────────────────────────────┘
│
┌───────────────────────────────────▼─────────────────────────────────────┐
│ Guardrails & Supervision │
│ The Enforcer (deterministic pre-tool) · The Judge (post-turn/drift) │
│ Reminders · Security & Permissions · Auditing & Provenance │
└───────────────────────────────────┬─────────────────────────────────────┘
│
┌───────────────────────────────────▼─────────────────────────────────────┐
│ Execution, Coordination & Intelligence │
│ Subagents · Edit Coordinator & Message Bus · Monitors │
│ Persistent Memory · Graphs & Grounded Reasoning · Skills · Cost/Quota │
└─────────────────────────────────────────────────────────────────────────┘1. Surfaces & Clients
Where you interact with Kompile and how external CLIs or editors connect to it:
| Page | What it covers |
|---|---|
| Why Kompile Is Opinionated | Core design principles: mechanical guardrails over prompt-only advice, containment, and honest cost accounting |
| CLI Harness (TUI & Config) | Terminal UI layout, status bar, keybindings, /ui presets, and kompile configure wizards |
| How the Chat REPL Works | Turn loop internals, streaming, compaction, command routing, and session lifecycle |
| Web Harness | Multi-project browser workspace (kompile chat --web), SSE controls, embedded PTY terminal, processes, and insights |
| ACP v1 (Server & Client) | Running Kompile as an Agent Client Protocol stdio server for Zed, JetBrains, Neovim, and Emacs |
| Installable Client Harnesses | Installing and managing supported external agent CLIs directly from /install |
| Embeddable Mobile Harness (C ABI) | Embedding Kompile's harness inside mobile and native host apps over its C ABI |
2. Guardrails & Supervision
How Kompile prevents destructive mistakes, catches drift, and preserves verifiable audit trails:
| Page | What it covers |
|---|---|
| The Enforcer | Deterministic pre-tool rules: dedicated tool routing, read-before-edit, Build/Script/Lane/Draft enforcers, and /enforcer wizard |
| The Judge | LLM-backed compliance checks, cross-turn DirectionJudge drift detection, /judge wizard, and diff-archive rollback |
| Reminders | Persistent project and user behavioral reminders injected cleanly into turns |
| Security & Permissions | Permission modes, workspace boundaries, secret redaction, and tool-gateway evaluation |
| Auditing & Provenance | /policy-enforce transcript audits, JudgementLog, tool_call_catalog, diff_index, and build_provenance |
3. Delegation, Monitors & Sync
How Kompile runs background work, coordinates concurrent agents, and carries work across tools and machines:
| Page | What it covers |
|---|---|
| Subagents | task, multi_task, quorum_task, vendor containment, /subagent-config caps, and mandatory progress reports |
| Edit Coordinator & Message Bus | File-level edit locks (edit_coordinator) and agent-to-agent coordination |
| Monitors & Reactive Wake-Ups | Background process monitors, timers, and event-driven wake-ups without polling loops |
| Peers & Sources | Encrypted TLS peer federation (kompile peer), kompile sync, and unified artifact/storage sources |
| Import, Resume & Vendor Switching | Importing transcripts from 11 external CLIs/IDEs, per-vendor resume (claude, codex, agy, opencode, qwen, gemini, pi, kompile), changing vendor mid-conversation (/auth, /provider, /model, /model failover), and kompile resume-all |
4. Memory, Context, Storage & Cost
How Kompile retains durable knowledge, compacts long sessions, manages disk usage, grounds claims, reuses procedures, and tracks spend:
| Page | What it covers |
|---|---|
| Persistent Memory | Project and global memory files, typed memories, semantic recall, and MEMORY.md hygiene |
Context Compaction (/compact & /auto-compact) | Model-aware auto-compaction, manual /compact, reviewed scope retirement, and post-compaction memory/skill reload |
Disk Space, Storage & Garbage Collection (/gc) | Safe dry-run disk reports, lossless archive compression, cleanable vs. protected stores, gc-config.json, and Web /storage |
| Graphs & Grounded Reasoning | Portable .kgraph knowledge graphs, OWL-RL/Datalog/PSL/MEBN reasoning, and verifiable derivation trails |
Agent Skill (SKILL.md) | Public skill specification (https://getkompile.github.io/kompile/SKILL.md) that teaches any agent how to operate Kompile |
| Skills & Skill Manager | Creating, discovering, and invoking reusable task skills with skill_manager |
| Cost & Quota Estimation | PER_TOKEN / PLAN / UNKNOWN billing buckets, ModelPriceCatalog, cache-write TTLs, and /usage + /cost telemetry |
Where to go next
- Want to configure these interactively right now? Follow Customizing the Harness With an Agent.
- Looking for Kompile's code-intelligence tools (
lsp,code_index,draft)? Go to Coding Tools Overview. - Looking for document crawling, RAG pipelines, and knowledge-graph concepts? See Core Platform & Knowledge Concepts.