KiloCode Engine

KiloCode bridges VS Code extension workflows and standalone AI coding. It communicates over HTTP on localhost, respects project-level .kiloCodes rules, and integrates cleanly into QuantumReef's session model.

Last updated: 2025-01-15

Overview

KiloCode started as a VS Code extension and evolved into a standalone AI coding engine that communicates over HTTP. Rather than spawning a subprocess per prompt, KiloCode runs as a persistent local server — QuantumReef connects to it like an API, sending prompts and receiving structured responses over localhost.

This architecture makes KiloCode fast to respond (no process startup latency) and easy to keep warm between sessions. If you use the KiloCode VS Code extension today, the standalone server uses the same .kiloCodes rules files, making migration to QuantumReef frictionless.

VS Code extension users

If you have the KiloCode VS Code extension installed, you can point QuantumReef at the same .kiloCodes files in your project. No duplicate configuration needed.

Installation

Install KiloCode standalone server

bash
# Install via npm
npm install -g kilocode

# Or via Homebrew
brew install kilocode/tap/kilocode

# Verify
kilocode --version

Start the KiloCode server

bash
# Start on the default port (3141)
kilocode serve

# Start on a custom port
kilocode serve --port 4000

# Start with a specific model provider
kilocode serve --provider anthropic --model claude-opus-4-5

# Start in background (daemon mode)
kilocode serve --daemon
kilocode status   # check if running
kilocode stop     # stop the daemon

Enable in QuantumReef

Go to Settings → Engines → KiloCode and toggle on. Set the Server URL to match the port KiloCode is running on (default: http://localhost:3141). QuantumReef will ping the health endpoint to verify connectivity before enabling the engine.

Port Configuration

KiloCode's HTTP server exposes a small REST API that QuantumReef uses for all communication. You can run multiple KiloCode instances on different ports to serve different projects or model configurations simultaneously.

KiloCode server REST API (QuantumReef communicates with these endpoints)
EndpointMethodDescription
/healthGETHealth check — returns server status and active model
/promptPOSTSend a prompt; returns streamed JSON response
/contextPOSTUpdate the active file/directory context
/rulesGETList active .kiloCodes rules for the current workspace
/sessionsGETList open sessions and their message counts
bash
# Run multiple instances for different projects
kilocode serve --port 3141 --workspace ~/projects/app-a &
kilocode serve --port 3142 --workspace ~/projects/app-b &

# Configure each in QuantumReef workspace settings
# app-a workspace: http://localhost:3141
# app-b workspace: http://localhost:3142

.kiloCodes Rules System

The .kiloCodes file (or directory) at your project root defines rules that shape KiloCode's behaviour. Rules are Markdown-formatted instructions that are injected into every prompt as system context.

.kiloCodes
# Project Rules

## Stack
This project uses SolidJS, TailwindCSS, and Hono. Do not suggest React patterns.

## Code Style
- Use named exports only — no default exports
- All async functions must have explicit return types
- Use `const` over `let` wherever possible
- Prefer `for...of` over `.forEach()`

## Testing
- Write tests in Vitest
- Use @testing-library/solid for component tests
- Mock external HTTP calls with msw

## File Structure
- Components go in src/components/<category>/
- Hooks go in src/hooks/
- Utilities go in src/lib/
- Never create files in the root of src/

Multiple rules files

bash
# You can split rules into a directory
mkdir .kiloCodes
echo "# Global rules" > .kiloCodes/global.md
echo "# API rules"    > .kiloCodes/api.md
echo "# UI rules"     > .kiloCodes/ui.md

# KiloCode merges all .md files in the directory alphabetically

Keep rules actionable

Rules work best when they are specific and imperative. Prefer "Use named exports only" over "We prefer named exports in this project". KiloCode treats rules as hard constraints, not suggestions.

Configuration

SettingDefaultDescription
Server URLhttp://localhost:3141KiloCode server address and port
ProvideranthropicLLM provider: anthropic, openai, ollama, etc.
Modelclaude-opus-4-5Model to use for code generation
StreamtrueStream responses token-by-token into QuantumReef
Rules Path.kiloCodesPath to rules file or directory (relative to workspace root)
Timeout120sRequest timeout before QuantumReef retries

When to Choose KiloCode

Use CaseWhy KiloCode Excels
VS Code extension migrationSame .kiloCodes rules — zero config duplication
Low-latency responsesPersistent server eliminates per-prompt startup cost
Rule-heavy projectsGranular .kiloCodes rules enforce conventions consistently
Multi-project setupsRun separate instances per project on different ports
Enterprise codebasesSelf-hosted server keeps code off third-party infrastructure