Updated against the current official Kilo CLI docs and CLI reference on 2026-04-12.
This sheet prefers the current Kilo terminology and file names.
- Use agents (not legacy “modes”) in day-to-day language.
- Use
planfor architecture/planning work; it is the modern equivalent of the older “Architect” idea.- Treat
orchestratoras deprecated.- Prefer
kilo.jsonc/.kilo/kilo.jsoncfor config today, even though some official pages still mentionkilo.json,config.json, or olderopencode.json(c)compatibility paths.
kilo— launch the interactive terminal UI in the current project./connect— easiest first-time provider setup from inside the interactive UI.kilo run "..."— one-shot, scriptable, CI-friendly execution.agents— task personas with different tool access.MCP— extra tools/integrations.AGENTS.md— project rules for the AI.workflows— reusable slash-commands backed by Markdown files.skills— reusable domain expertise packages (SKILL.md).
| Agent | Best for | Tool access |
|---|---|---|
code |
coding, refactors, implementation | full access |
ask |
explanation, learning, safe Q&A | read-only |
plan |
design, architecture, implementation plans | read-only + limited writes to .kilo/plans/ |
debug |
bug hunts, diagnostics, incident work | full access |
orchestrator |
legacy task delegation | deprecated |
# global install
npm install -g @kilocode/cli
# one-off run without installing globally
npx @kilocode/clikilo --version
kilo --help# start TUI in current directory
kilo
# start in a specific project directory
kilo /path/to/project# Kilo-native update
kilo upgrade
# pin or target a specific version
kilo upgrade v1.2.3
kilo upgrade 1.2.3
# choose install method explicitly
kilo upgrade --method npm
kilo upgrade --method brew
# npm alternative
npm update -g @kilocode/cli# preview what would be removed
kilo uninstall --dry-run
# uninstall but keep config/session data
kilo uninstall --keep-config --keep-data
# force uninstall
kilo uninstall --forceIf Kilo crashes with Illegal instruction on older CPUs, use the baseline release artifact from GitHub releases instead of the default build.
kiloInside the TUI, run:
/connect
That is the main guided entry point for adding provider credentials.
# list configured providers
kilo auth list
# login to a provider (OAuth-capable providers)
kilo auth login
# skip provider picker
kilo auth login --provider <provider>
# skip method picker
kilo auth login --provider <provider> --method <method>
# logout from a configured provider
kilo auth logout- Fastest start: use Kilo’s built-in provider.
- If you need your own keys or specific vendors/models, configure providers in config or via
/connect. kilo auth loginis especially useful for OAuth-style providers.
These are the commands you will use most often.
# interactive work
kilo
kilo --model <provider/model>
kilo --agent code
kilo --agent plan --prompt "Design the migration"
kilo --continue
# one-shot task execution
kilo run "Find the failing tests and fix them"
kilo run --agent plan "Draft an implementation plan"
kilo run --agent debug "Investigate flaky test"
kilo run --model <provider/model> "Refactor the auth module"
kilo run --file logs.txt --file stacktrace.txt "Analyze these failures"
# structured / automation-friendly
kilo run --format json "Check whether the repo builds"
kilo run --auto "Update the changelog from recent commits"
# inspect sessions
kilo session list
kilo session list --all
kilo session list --format json
# inspect config / environment
kilo config check
kilo debug config
kilo debug paths| Command | What it does | Handy flags / notes |
|---|---|---|
kilo [project] |
start interactive TUI | --model, --agent, --prompt, --continue, --session, --fork, --cloud-fork, --port, --hostname |
kilo run [message] |
run Kilo with a message | --agent, --model, --file, --format json, --auto, --continue, --session, --fork, --title, --thinking, --variant |
kilo attach <url> |
attach to a running Kilo server | --dir, --continue, --session, --fork, --cloud-fork, --password |
kilo serve |
start headless Kilo server | --port, --hostname, --mdns, --mdns-domain, --cors |
kilo remote |
enable real-time remote relay | gateway/cloud-related |
kilo acp |
start ACP server | useful when integrating external clients/tools |
| Command | What it does | Handy flags / notes |
|---|---|---|
kilo auth |
manage providers and credentials | subcommands: list, login, logout |
kilo models [provider] |
list available models | --verbose, --refresh |
kilo agent |
manage custom agents | subcommands: create, list |
| Command | What it does | Handy flags / notes |
|---|---|---|
kilo mcp |
manage MCP servers | subcommands: add, list, auth, auth list, logout, debug |
| Command | What it does | Handy flags / notes |
|---|---|---|
kilo session list |
list sessions | --max-count, --format, --all, --search |
kilo session delete <id> |
delete a session | irreversible for local history |
kilo export <sessionID> |
export a session as JSON | redirect to file |
kilo import <file-or-url> |
import a JSON session or share URL | useful for handoff/restore |
kilo stats |
show token usage / cost stats | --days, --tools, --models, --project |
kilo pr <number> |
checkout GitHub PR branch and run Kilo | fast PR review/start point |
| Command | What it does | Handy flags / notes |
|---|---|---|
kilo debug |
troubleshooting toolbox | many subcommands; see below |
kilo db |
query/migrate Kilo DB | db path, db migrate, `--format json |
kilo config check |
validate config | catches warnings/errors |
kilo plugin <module> |
install plugin and update config | --global, --force |
kilo help [command] |
full CLI reference | --all, `--format md |
kilo completion |
generate shell completions | redirect into shell setup |
kilo upgrade [target] |
upgrade Kilo | --method |
kilo uninstall |
remove Kilo | --dry-run, --keep-config, --keep-data, --force |
kilo run [message]
--agent <name>
--model <provider/model>
--file <path> # repeatable
--continue # continue most recent session
--session <id> # continue a specific session
--fork # fork before continuing
--share # share session
--format json # raw JSON events
--auto # autonomous/non-interactive mode
--title [text] # set session title
--dir <path> # working directory
--attach <url> # attach to running server
--password <secret> # or KILO_SERVER_PASSWORD
--port [n] # local server port for this run
--variant <name> # provider-specific reasoning effort
--thinking # show thinking blocks# one-shot code fix
kilo run "Fix TypeScript errors in src/auth"
# planning only
kilo run --agent plan "Design a blue/green deploy strategy"
# debugging specialist
kilo run --agent debug --file crash.log "Root-cause this crash"
# machine-readable output
kilo run --format json "Check whether the repo builds cleanly"
# attach extra files
kilo run --file README.md --file docs/spec.md "Summarize the implementation gaps"
# continue the latest session and keep going
kilo run --continue "Now add tests"--help, -h
--version, -v
--print-logs
--log-level DEBUG|INFO|WARN|ERRORThese work inside the interactive TUI.
| Slash command | Aliases | Purpose |
|---|---|---|
/sessions |
/resume, /continue |
switch session |
/new |
/clear |
new session |
/share |
— | share session |
/unshare |
— | stop sharing |
/rename |
— | rename session |
/timeline |
— | jump to a message |
/fork |
— | fork from a message |
/compact |
/summarize |
compact session |
/undo |
— | undo previous message |
/redo |
— | redo message |
/copy |
— | copy transcript |
/export |
— | export transcript |
/timestamps |
/toggle-timestamps |
show/hide timestamps |
/thinking |
/toggle-thinking |
show/hide thinking blocks |
| Slash command | Purpose |
|---|---|
/models |
switch model |
/agents |
switch agent |
/mcps |
enable/disable MCP servers |
| Slash command | Aliases | Purpose |
|---|---|---|
/connect |
— | add/connect a provider |
/status |
— | view status |
/themes |
— | switch theme |
/help |
— | show help |
/editor |
— | open external editor |
/exit |
/quit, /q |
exit the app |
| Slash command | Aliases | Purpose |
|---|---|---|
/profile |
/me, /whoami |
view gateway profile |
/teams |
/team, /org, /orgs |
switch organization/team |
/remote |
— | toggle remote mode |
| Slash command | Purpose |
|---|---|
/init |
create/update AGENTS.md for the project |
/local-review |
review current branch vs base |
/local-review-uncommitted |
review staged + unstaged changes |
# interactive
/agents
# command line
kilo --agent code
kilo --agent plan
kilo run --agent debug "Investigate the memory leak"- Use
codewhen you want maximum flexibility. - Use
askwhen you want explanations without file edits or command execution. - Use
planfor architecture/design work and implementation planning. - Use
debugwhen you want systematic diagnosis and narrowing down causes. - Avoid building new workflows around
orchestrator; it is deprecated.
Inside the current Kilo-based CLI/IDE family:
Cmd+.(macOS) /Ctrl+.(Windows/Linux) — cycle agents- add
Shiftto cycle in reverse
# list all models
kilo models
# filter by provider
kilo models openai
kilo models anthropic
# include metadata such as costs
kilo models --verbose
# refresh models cache
kilo models --refresh# guided connection inside TUI
/connect
# auth from CLI
kilo auth list
kilo auth login
kilo auth login --provider <provider>
kilo auth logout- The built-in Kilo provider is the fastest path to “it just works”.
- Kilo supports many provider categories: direct labs, gateways, local/self-hosted backends, and more.
- The VS Code extension and CLI share provider settings via the same underlying config files.
# resume most recent session for current workspace
kilo --continue
kilo -c
# continue a specific session
kilo --session <session-id>
kilo run --session <session-id> "Continue from here"
# fork before continuing
kilo --session <session-id> --fork
kilo run --session <session-id> --fork "Try an alternative approach"# list sessions
kilo session list
kilo session list --max-count 20
kilo session list --all
kilo session list --search auth
kilo session list --format json
# delete one
kilo session delete <session-id># export to a local file
kilo export <session-id> > session.json
# import back from a file
kilo import session.json
# import from a share URL
kilo import '<share-url>'Inside TUI:
/share
/unshare
/export
/copy
--continueis workspace-oriented and resumes the most recent relevant session.- In older docs/examples you may still see cloud/local fork wording; the modern CLI still exposes
--forkand--cloud-forkwhere relevant.
Use kilo run for automation.
# autonomous pipeline-style run
kilo run --auto "Update generated docs and fix lint violations"
# structured logs/events for tooling
kilo run --format json "Run a repo health check"
# select org in CI
KILO_ORG_ID=<org-id> kilo run "Do the release prep"| Flag | Use |
|---|---|
--auto |
non-interactive autonomous mode |
--format json |
machine-readable event stream |
--file |
attach artifacts/logs/specs |
--agent |
force a specialist persona |
--model |
pin a model for reproducibility |
--title |
label the session in history |
| Code | Meaning |
|---|---|
0 |
success |
1 |
init/execution failure |
124 |
timeout |
# override active provider
export KILO_PROVIDER=<provider-id>
# built-in Kilo provider overrides
export KILOCODE_MODEL=<value>
# generic provider-field style override
export KILO_API_KEY=<value>
# choose organization/team for non-interactive runs
export KILO_ORG_ID=<org-id>Treat --auto as powerful. In real CI, keep permissions conservative and test in a disposable repo first.
# terminal A: start a server
kilo serve --port 4096
# terminal B: attach to it
kilo attach http://127.0.0.1:4096If a password is configured, use:
export KILO_SERVER_PASSWORD='secret'
kilo attach http://127.0.0.1:4096 --password "$KILO_SERVER_PASSWORD"If you are trying to attach to the server spawned by the new VS Code / VSCodium extension, be aware of a current auth mismatch in the codebase:
- the server defaults to Basic Auth username
kilounlessKILO_SERVER_USERNAMEis set kilo attachcurrently builds the Basic Auth header with usernameopencode- the extension launches
kilo serve --port 0and injects a generated password, but not a username override
That means attach can return Unauthorized even when the password is correct. See Appendix C for the full breakdown and workarounds.
You can also send a one-shot task to a running server:
kilo run --attach http://127.0.0.1:4096 "Review the current repo state"Remote connections let Cloud Agent / Kilo Gateway interact with your local CLI session.
Inside an authenticated TUI session:
/remote
- connected to Kilo Gateway
- same Kilo account on CLI and Cloud Agent
- local CLI must keep running and stay online
Remote mode means anyone with access to your Kilo account can send messages to the machine while remote mode is enabled.
kilo acpUse ACP when another client/tool needs to talk to Kilo via Agent Client Protocol.
| Scope | Recommended path | Notes |
|---|---|---|
| Global | ~/.config/kilo/kilo.jsonc |
applies to all projects |
| Project | ./kilo.jsonc |
simple root-level config |
| Project (cleaner) | ./.kilo/kilo.jsonc |
takes priority over ./kilo.jsonc if both exist |
Official Kilo pages are currently inconsistent:
- newer settings/docs pages favor
kilo.jsonc - the MCP CLI page says
kilo.jsonis recommended and also acceptskilo.jsonc/config.json - older compatibility docs still mention
opencode.json/opencode.jsonc
Recommendation: use kilo.jsonc / .kilo/kilo.jsonc unless you specifically need compatibility with another documented path.
Prefer environment variables (or file indirection) over hardcoding secrets.
{
"provider": {
"anthropic": {
"options": {
"apiKey": "{env:ANTHROPIC_API_KEY}"
}
},
"openai": {
"options": {
"apiKey": "{file:~/.secrets/openai-key}"
}
}
}
}- CLI and VS Code extension share the same underlying config.
- Restart the CLI after editing config files.
- Use env vars for API keys and secrets, especially if config is committed to git.
- There is an
experimentalconfig area; treat it as unstable.
Kilo decides whether an action runs automatically, asks, or is blocked.
allow— run without approvalask— prompt firstdeny— block
{
"$schema": "https://app.kilo.ai/config.json",
"permission": "allow"
}{
"$schema": "https://app.kilo.ai/config.json",
"permission": {
"*": "ask",
"bash": "allow",
"edit": "deny"
}
}{
"$schema": "https://app.kilo.ai/config.json",
"permission": {
"bash": {
"*": "ask",
"git *": "allow",
"npm *": "allow",
"rm *": "deny",
"grep *": "allow"
},
"edit": {
"*": "deny",
"packages/web/src/content/docs/*.mdx": "allow"
}
}
}*= zero or more characters?= exactly one character- last matching rule wins
- common pattern: put a catch-all
"*"first, then more specific rules later
You can use either of these at the start of a path pattern:
~$HOME
Examples:
~/projects/*$HOME/projects/*
Use external_directory for paths outside the working directory.
{
"$schema": "https://app.kilo.ai/config.json",
"permission": {
"external_directory": {
"~/projects/personal/**": "allow"
}
}
}If you want read access but still forbid edits there:
{
"$schema": "https://app.kilo.ai/config.json",
"permission": {
"external_directory": {
"~/projects/personal/**": "allow"
},
"edit": {
"~/projects/personal/**": "deny"
}
}
}When Kilo asks for approval in interactive mode, it can offer increasingly broad “always allow” choices, letting you build rules incrementally without manually editing config.
Use MCP to add external tools/data sources.
kilo mcp list
kilo mcp add
kilo mcp auth
kilo mcp auth list
kilo mcp logout <server>
kilo mcp debug <server>Inside the TUI:
/mcps
{
"mcp": {
"my-local-server": {
"type": "local",
"command": ["npx", "-y", "my-mcp-command"],
"enabled": true,
"environment": {
"API_KEY": "{env:MY_API_KEY}"
},
"timeout": 5000
}
}
}{
"mcp": {
"context7": {
"type": "remote",
"url": "https://mcp.context7.com/mcp",
"enabled": true,
"headers": {
"Authorization": "Bearer {env:CONTEXT7_TOKEN}"
},
"timeout": 5000
}
}
}{
"mcp": {
"Figma Desktop": {
"type": "remote",
"url": "http://127.0.0.1:3845/mcp"
},
"mcp_everything": {
"type": "local",
"command": ["npx", "-y", "@modelcontextprotocol/server-everything"]
}
}
}MCP tools use the same permission system as built-ins.
Permission keys are namespaced as:
{server}_{tool}
Example:
{
"permission": {
"github_*": "ask",
"github_create_pull_request": "allow"
}
}Each enabled MCP server can add tools and context overhead. Keep only the ones you actually use.
A project-level Markdown file that tells Kilo how to behave in your repo.
AGENTS.md(recommended)AGENT.md(fallback)
Use uppercase.
my-project/
├── AGENTS.md
├── src/
│ └── backend/
│ └── AGENTS.md
└── docs/
└── AGENTS.md
- root
AGENTS.mdapplies to the project - subdirectory
AGENTS.mdadds more specific rules for that subtree - subdirectory rules take precedence when they conflict
- Kilo treats
AGENTS.md/AGENT.mdas write-protected; changes require explicit approval
Inside TUI:
/init
Global instructions file:
~/.config/kilo/AGENTS.md
Extra instruction sources can be set via config:
{
"instructions": [
"./docs/coding-standards.md",
"./teams/frontend-rules.md",
"https://example.com/team-instructions.md"
]
}From highest to lower-priority instruction sources:
- agent-specific prompt in config
- project
instructionsinkilo.jsonc - project
AGENTS.md - global
instructions - skills (loaded on demand)
kilo agent createUseful flags:
kilo agent create \
--path ./.kilo/agents \
--description "Review code for security and maintainability" \
--mode subagent \
--tools read,glob,grep \
--model provider/modelkilo agent list| Mode | Meaning |
|---|---|
primary |
appears as a directly selectable agent |
subagent |
only invoked by Task tool / mentions |
all |
can be both |
{
"agent": {
"code-reviewer": {
"description": "Reviews code for best practices and potential issues",
"mode": "subagent",
"model": "provider/model",
"prompt": "You are a strict code reviewer.",
"permission": {
"edit": "deny",
"bash": "deny"
}
}
}
}Preferred directories:
- global:
~/.config/kilo/agents/ - project:
.kilo/agents/
Example:
---
description: Reviews code quality and best practices
mode: subagent
model: provider/model
permission:
edit: deny
bash: deny
---
You are a careful reviewer. Focus on security, correctness, performance, and maintainability.Workflows are Markdown files stored as slash-commands.
- global:
~/.config/kilo/commands/ - project:
.kilo/commands/
File:
.kilo/commands/submit-pr.md
Invoke in TUI as:
/submit-pr
---
description: Submit a pull request with checks
agent: code
---
1. Run tests
2. Summarize changes
3. Prepare the PR body
4. Ask for final confirmation if required| Field | Meaning |
|---|---|
description |
shown in command picker |
agent |
agent to use |
model |
model override |
subtask |
run as subagent session when true |
Workflows can use built-in tools such as read, glob, grep, edit, write, bash, webfetch, plus MCP tools.
Skills are reusable expertise packages. The model decides whether to use a skill primarily from the skill’s description, so naming and description quality matter.
| Scope | Path |
|---|---|
| Global (macOS/Linux) | ~/.kilo/skills/ |
| Global (Windows) | C:\Users\<you>\.kilo\skills\ |
| Project | .kilo/skills/ |
| Compatibility | .claude/skills/, .agents/skills/ |
| Extra paths | via skills.paths |
| Remote URLs | via skills.urls |
~/.kilo/skills/
└── api-design/
└── SKILL.md
---
name: api-design
description: REST API design best practices and conventions
---
# API Design Guidelines
Use resource-oriented URLs, explicit error models, versioning rules, and consistent pagination.nameshould match the parent directory name- new/changed skills are picked up at the start of a new session (or
kilo run) - project skills override global skills with the same name
- Kilo loads compatibility dirs for other tools unless disabled
{
"skills": {
"paths": ["~/shared-skills", "./company-skills"],
"urls": ["https://example.com/skills/api-design/SKILL.md"]
}
}export KILO_DISABLE_EXTERNAL_SKILLS=truekilo config check
kilo debug config
kilo debug pathskilo debug lsp diagnostics path/to/file.ts
kilo debug lsp symbols Auth
kilo debug lsp document-symbols file:///abs/path/to/file.tskilo debug rg tree --limit 200
kilo debug rg files --query auth --glob '*.ts' --limit 50
kilo debug rg search 'TODO|FIXME' --glob '*.ts' --glob '*.tsx' --limit 100kilo debug file status
kilo debug file read package.json
kilo debug file list src
kilo debug file search auth
kilo debug file tree .kilo debug skill
kilo debug scrap
kilo debug snapshot track
kilo debug snapshot patch <hash>
kilo debug snapshot diff <hash>
kilo debug agent <name>
kilo debug waitkilo db path
kilo db 'select * from sessions limit 5;'
kilo db 'select * from sessions limit 5;' --format json
kilo db migrate# full markdown reference generated by the CLI itself
kilo help --all --format md > kilo-cli-reference.md
# single command help
kilo help run
kilo help mcpCmd+./Ctrl+.— cycle agents- add
Shiftfor reverse cycling
Kilo CLI inherits a lot from OpenCode. In practice, these TUI defaults are often useful to know:
Ctrl+P— command listTab/Shift+Tab— cycle agentsEnter— submit promptShift+Enter,Ctrl+Enter,Alt+Enter, orCtrl+J— newline in promptEsc— interrupt running sessionCtrl+A/Ctrl+E— line start / line endCtrl+B/Ctrl+F— move left / rightCtrl+W— delete previous wordCtrl+K/Ctrl+U— delete to end / start of linePageUp/PageDown— message paging- leader key defaults to
Ctrl+Xin OpenCode-styletui.json
Some terminals do not send modifier+Enter cleanly. On Windows Terminal especially, you may need a custom sendInput mapping for shift+enter.
kilo --agent code --model <provider/model>kilo --agent plan --prompt "Design a data migration plan"kilo run --agent debug --file ci.log --file junit.xml "Find the root cause and suggest a minimal fix"Inside TUI:
/local-review
kilo -ckilo session list --all --format jsonkilo models --verbose --refreshkilo config check && kilo debug configkilo export <session-id> > handoff.json/submit-pr
- Prefer
kilo.jsonctoday. Official pages are not fully harmonized yet. planis the modern architecture/planning agent. If you see “Architect” in older docs, map it mentally toplan.orchestratoris deprecated. Build new setups aroundcode,plan,debug, and custom subagents.- Secrets do not belong in checked-in config. Use
{env:...}or{file:...}. - Skills are loaded at session start. After adding/modifying a skill, start a new session.
- Remote mode is powerful. Enable it intentionally and understand the account-level risk.
- MCP servers can bloat context. Fewer enabled servers usually means a cleaner experience.
AGENTS.mdis uppercase.agents.mdis not the recommended file name.- Project
.kilo/config wins over rootkilo.jsoncwhen both are present. - Old wording still appears. For example, some command help/docs still refer to “opencode server” or “modes”.
- CLI overview:
https://kilo.ai/docs/code-with-ai/platforms/cli - CLI command reference:
https://kilo.ai/docs/code-with-ai/platforms/cli-reference - Settings / config files:
https://kilo.ai/docs/getting-started/settings - Setup & authentication:
https://kilo.ai/docs/getting-started/setup-authentication - Using agents:
https://kilo.ai/docs/code-with-ai/agents/using-agents - Custom subagents:
https://kilo.ai/docs/customize/custom-subagents - Workflows:
https://kilo.ai/docs/customize/workflows - AGENTS.md:
https://kilo.ai/docs/customize/agents-md - Custom instructions:
https://kilo.ai/docs/customize/custom-instructions - Skills:
https://kilo.ai/docs/customize/skills - MCP in CLI:
https://kilo.ai/docs/automate/mcp/using-in-cli - Kilo provider:
https://kilo.ai/docs/ai-providers/kilocode - AI providers overview:
https://kilo.ai/docs/ai-providers - GitHub repo / README:
https://github.com/Kilo-Org/kilocode
- OpenCode config:
https://opencode.ai/docs/config/ - OpenCode keybinds:
https://opencode.ai/docs/keybinds/
# install / update
npm install -g @kilocode/cli
npx @kilocode/cli
kilo upgrade
# start / continue
kilo
kilo /path/to/project
kilo -c
kilo --session <id>
# one-shot tasks
kilo run "..."
kilo run --agent plan "..."
kilo run --agent debug --file log.txt "..."
kilo run --format json "..."
kilo run --auto "..."
# providers / models
/connect
kilo auth list
kilo auth login
kilo models --verbose --refresh
# sessions / data
kilo session list --all --format json
kilo export <id> > session.json
kilo import session.json
kilo stats --days 7 --models
# review / debug
/local-review
kilo config check
kilo debug config
kilo debug paths
kilo debug skill
# server / remote / attach
kilo serve --port 4096
kilo attach http://127.0.0.1:4096
/remote
# MCP / customization
/mcps
kilo mcp list
kilo agent create
/initSource basis: current core flag definitions in packages/opencode/src/flag/flag.ts, current shared auth store in packages/opencode/src/auth/index.ts, current XDG paths in packages/opencode/src/global/index.ts, and the current VS Code / VSCodium server launcher in packages/kilo-vscode/src/services/cli-backend/server-manager.ts.
This is the current source-derived list, not a stability guarantee. Quite a few experimental/internal vars are intentionally undocumented and may change.
| Variable | Type | What it controls | Notes |
|---|---|---|---|
KILO_CONFIG |
string | explicit config file path | use when you want one specific config file |
KILO_CONFIG_CONTENT |
string | inline config payload | useful for wrappers / tests / generated configs |
KILO_CONFIG_DIR |
string | override config directory root | affects config discovery, not the auth data file |
KILO_TUI_CONFIG |
string | explicit TUI config path | advanced override |
KILO_CLIENT |
string | client identity | defaults to cli; extension sets vscode |
KILO_PERMISSION |
string | permission override / preset selector | advanced / partly internal |
KILO_SERVER_PASSWORD |
string | Basic Auth password for kilo serve |
used by attach if --password is omitted |
KILO_SERVER_USERNAME |
string | Basic Auth username for kilo serve |
server default is kilo |
KILO_DISABLE_PROJECT_CONFIG |
boolean | ignore project-local config files | useful for debugging config precedence |
KILO_DISABLE_DEFAULT_PLUGINS |
boolean | disable bundled/internal plugins | advanced troubleshooting |
KILO_DISABLE_EXTERNAL_SKILLS |
boolean | disable compatibility/external skill dirs | blocks automatic loading from external compatibility paths |
KILO_DISABLE_LSP_DOWNLOAD |
boolean | skip bundled LSP downloads | useful in locked-down environments |
KILO_DISABLE_MODELS_FETCH |
boolean | skip refreshing the model catalog | offline / deterministic runs |
KILO_MODELS_URL |
string | alternate model catalog URL | advanced / internal override |
KILO_MODELS_PATH |
string | local model catalog file path | advanced / offline override |
KILO_DISABLE_AUTOUPDATE |
boolean | disable self-update checks / flow | useful on pinned installs |
KILO_ALWAYS_NOTIFY_UPDATE |
boolean | always show update notification | useful for testing updater UX |
KILO_DISABLE_PRUNE |
boolean | disable cleanup / pruning tasks | advanced / internal maintenance |
KILO_DISABLE_TERMINAL_TITLE |
boolean | stop Kilo from changing terminal title | terminal UX preference |
KILO_SHOW_TTFD |
boolean | show first-response timing diagnostic | TTFD = time to first delta / first streamed output |
KILO_ENABLE_EXPERIMENTAL_MODELS |
boolean | expose experimental models | catalog / picker behavior |
KILO_DISABLE_AUTOCOMPACT |
boolean | disable automatic context compaction | advanced context debugging |
KILO_DISABLE_CLAUDE_CODE |
boolean | disable Claude-compat layer wholesale | also disables Claude-compat prompt + skills toggles |
KILO_DISABLE_CLAUDE_CODE_PROMPT |
boolean | disable Claude-compat prompt layer only | ignored if KILO_DISABLE_CLAUDE_CODE=true |
KILO_DISABLE_CLAUDE_CODE_SKILLS |
boolean | disable Claude-compat skill layer only | ignored if KILO_DISABLE_CLAUDE_CODE=true |
KILO_ENABLE_QUESTION_TOOL |
boolean | enable the interactive question tool |
extension sets this to true |
KILO_GIT_BASH_PATH |
string | explicit Git Bash path on Windows | Windows-only troubleshooting helper |
KILO_DISABLE_EMBEDDED_WEB_UI |
boolean | disable embedded web UI | advanced / internal |
KILO_DB |
string | custom database path | advanced override for kilo.db |
KILO_DISABLE_CHANNEL_DB |
boolean | disable channel DB features | advanced / internal |
KILO_SKIP_MIGRATIONS |
boolean | skip DB migrations | only for careful debugging/testing |
KILO_STRICT_CONFIG_DEPS |
boolean | strict config dependency validation | advanced config debugging |
KILO_SESSION_RETRY_LIMIT |
integer | retry ceiling for session operations | positive integer only |
KILO_PLUGIN_META_FILE |
string | plugin metadata file path | advanced / internal |
KILO_FAKE_VCS |
string | fake VCS adapter / override | mainly testing / advanced tooling |
KILO_PURE |
boolean | internal “pure” runtime mode | dynamic getter; mostly tooling/tests |
KILO_TEST_HOME |
string | override home directory for tests | defined in Global.Path.home; mainly test isolation |
| Variable | Type | What it controls | Notes |
|---|---|---|---|
KILO_EXPERIMENTAL |
boolean | master experimental switch | enables a family of experimental behaviors |
KILO_EXPERIMENTAL_FILEWATCHER |
boolean | experimental filewatcher backend | source-derived |
KILO_EXPERIMENTAL_DISABLE_FILEWATCHER |
boolean | disable experimental filewatcher | source-derived |
KILO_EXPERIMENTAL_ICON_DISCOVERY |
boolean | experimental icon discovery | source-derived |
KILO_EXPERIMENTAL_DISABLE_COPY_ON_SELECT |
boolean | disable copy-on-select behavior | defaults vary by platform |
KILO_ENABLE_EXA |
boolean | enable Exa integration | source-derived / experimental |
KILO_EXPERIMENTAL_EXA |
boolean | legacy/alias Exa experimental toggle | source-derived |
KILO_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS |
integer | default timeout for bash tool executions | positive integer only |
KILO_EXPERIMENTAL_OUTPUT_TOKEN_MAX |
integer | fallback max output-token cap | positive integer only |
KILO_EXPERIMENTAL_OXFMT |
boolean | experimental oxfmt formatting integration |
source-derived |
KILO_EXPERIMENTAL_LSP_TY |
boolean | experimental ty / typing integration |
source-derived |
KILO_EXPERIMENTAL_LSP_TOOL |
boolean | experimental LSP tool integration | source-derived |
KILO_DISABLE_FILETIME_CHECK |
boolean | disable file mtime safety check | advanced / internal |
KILO_EXPERIMENTAL_PLAN_MODE |
boolean | experimental / legacy plan-mode flag | source-derived |
KILO_EXPERIMENTAL_WORKSPACES |
boolean | experimental multi-workspace support | source-derived |
KILO_EXPERIMENTAL_MARKDOWN |
boolean-ish | markdown handling toggle | enabled by default unless explicitly set to false / 0 |
KILO_AUTO_SHARE |
boolean | automatic share behavior | source-derived; currently undocumented |
| Variable | Type | Set by | Purpose |
|---|---|---|---|
KILO_CLIENT=vscode |
string | extension server launcher | marks the process as VS Code-backed |
KILO_SERVER_PASSWORD=<random hex> |
string | extension server launcher | per-server Basic Auth password |
KILO_ENABLE_QUESTION_TOOL=true |
boolean/string | extension server launcher | enables the question tool |
KILOCODE_FEATURE=vscode-extension |
string | extension server launcher | feature/platform tag |
| `KILO_TELEMETRY_LEVEL=all | off` | string | extension server launcher |
KILO_APP_NAME=kilo-code |
string | extension server launcher | app label |
KILO_EDITOR_NAME=<VS Code / VSCodium name> |
string | extension server launcher | editor branding |
KILO_PLATFORM=vscode |
string | extension server launcher | platform marker |
KILO_MACHINE_ID=<editor machine id> |
string | extension server launcher | editor runtime identifier |
KILO_APP_VERSION=<extension version> |
string | extension server launcher | extension version marker |
KILO_VSCODE_VERSION=<editor version> |
string | extension server launcher | editor version marker |
KILO_DISABLE_CLAUDE_CODE=true |
boolean/string | extension server launcher (conditional) | set when the extension disables Claude compatibility |
Kilo config files support {env:VARIABLE_NAME} references, so provider/MCP credentials do not have to use Kilo-specific names. In practice, people often use names like these:
| Example env var | Typical use |
|---|---|
OPENAI_API_KEY |
OpenAI-compatible provider auth |
ANTHROPIC_API_KEY |
Anthropic auth |
MY_PROVIDER_API_KEY |
custom provider defined in provider.<id> |
CONTEXT7_TOKEN / MY_API_KEY |
MCP headers or other external tools |
Example:
{
"provider": {
"openai": {
"options": {
"apiKey": "{env:OPENAI_API_KEY}"
}
}
},
"mcp": {
"context7": {
"type": "remote",
"url": "https://mcp.context7.com/mcp",
"headers": {
"Authorization": "Bearer {env:CONTEXT7_TOKEN}"
}
}
}
}There are two different storage classes in the current CLI / extension architecture:
- Config files (
kilo.jsonc) for non-secret settings:- global:
~/.config/kilo/kilo.jsonc - project:
kilo.jsoncor.kilo/kilo.jsonc
- global:
- Auth data (
auth.json) for credentials handled by auth flows / provider auth storage:- stored at
path.join(Global.Path.data, "auth.json") - written with file mode
0600
- stored at
So your command
find ~/.config/kilo -name "*auth.json"can return nothing even when auth exists, because auth.json is stored under the data dir, not the config dir.
Current source resolves Kilo paths through xdg-basedir:
- config dir = XDG config location +
/kilo - data dir = XDG data location +
/kilo
On many Linux systems that means the files are usually here:
~/.config/kilo/kilo.jsonc
~/.local/share/kilo/auth.json
But the actual location can differ if your editor/terminal sets XDG variables differently.
For things added through the current extension/CLI settings UI or auth browser:
- provider definitions / model lists / base URLs / non-secret settings live in
kilo.jsoncwhen applicable - stored credentials / tokens / API-key auth objects live in
auth.json
This is why you may see the provider in Kilo, but not find a plaintext API key inside kilo.jsonc. The official settings docs also explicitly warn not to keep secrets in config and recommend environment variables for credentials.
find ~/.config/kilo ~/.local/share/kilo -maxdepth 2 \
\( -name 'kilo.json*' -o -name 'opencode.json*' -o -name 'auth.json' \) -print
printf 'XDG_CONFIG_HOME=%s\n' "${XDG_CONFIG_HOME:-<unset>}"
printf 'XDG_DATA_HOME=%s\n' "${XDG_DATA_HOME:-<unset>}"- The extension shares config with the CLI, but it still runs a bundled CLI backend under the editor.
KILO_CONFIG_DIRchanges config discovery, not the auth data path.KILO_TEST_HOMEexists in source as a home-dir override, but it is mainly for testing/tooling.- If you launched VSCodium from a desktop launcher instead of the shell, its effective XDG environment may differ from your terminal's.
Appendix C. Why kilo attach http://localhost:4096 returned Unauthorized against the extension server
Your repro strongly matches a current client/server auth mismatch in the source:
kilo servechecks Basic Auth with:- password =
KILO_SERVER_PASSWORD - username =
KILO_SERVER_USERNAME ?? "kilo"
- password =
kilo attachbuilds the Basic Auth header as:- username =
opencode - password = the supplied
--passwordorKILO_SERVER_PASSWORD
- username =
- the current VS Code / VSCodium extension launches the bundled CLI as:
kilo serve --port 0- injects a generated
KILO_SERVER_PASSWORD - sets several metadata env vars
- but does not set
KILO_SERVER_USERNAME
So the extension-managed server expects:
kilo:<password>
while attach currently sends:
opencode:<password>
That is enough to produce Unauthorized even when the password is correct.
Current serve code tries port 4096 first when started with --port 0, then falls back to a random free port only if needed. So your lsof output on port 4096 is perfectly plausible and not suspicious.
Because the extension forwards ...process.env into the spawned kilo serve process, you can launch VSCodium from a shell like this:
export KILO_SERVER_USERNAME=opencode
codium .Then the spawned server should expect the same username that kilo attach currently sends.
# terminal A
export KILO_SERVER_USERNAME=opencode
export KILO_SERVER_PASSWORD='replace-me'
kilo serve --port 4096
# terminal B
export KILO_SERVER_PASSWORD='replace-me'
kilo attach http://127.0.0.1:4096export KILO_SERVER_USERNAME=opencode
export KILO_SERVER_PASSWORD='replace-me'
kilo serve --port 4096
kilo run --attach http://127.0.0.1:4096 "Review the current repo state"The current attach CLI exposes a password option, but not a username option. So with the extension-managed server you cannot fully fix this from the attach side alone; the clean workaround is to change the server username via environment before the server starts.
Kilo currently does not expose first-class session lifecycle hooks comparable to Claude's Start / Stop / SessionEnd style hooks.
There is an open feature request asking Kilo to expose session lifecycle hooks / APIs specifically so external tools can detect session start/end, read transcripts, inspect file changes, and run custom workflows when sessions complete.
Kilo gives you several customization mechanisms, but they are not lifecycle callbacks:
AGENTS.md/ custom instructions for persistent behavior rules- workflows (
.kilo/commands/*.md) for slash-command prompt templates - custom subagents with their own model + prompt + permissions
- skills (
SKILL.md) for reusable task-specific capability packs - config / rules / permissions in
kilo.jsonc
Natively: no, not today.
You can get advisory behavior with instructions + workflows, but not a guaranteed synchronous stop hook that intercepts session close in the same way your Claude example does.
Create or extend your project AGENTS.md:
# Session handoff policy
For any task lasting more than ~15 minutes, or any task ending with open TODOs,
blockers, partial implementation, or unmerged work:
1. Before concluding, ask whether to write a handoff note.
2. If the user agrees, write it to `.kilo/handoffs/YYYY-MM-DD-HHMM-<slug>.md`.
3. Include:
- task summary
- files changed
- tests run / not run
- blockers
- next steps
- rollback notes / risky areas
4. Never claim a handoff exists unless the file was actually written.Create .kilo/commands/handoff.md:
---
description: Write a handoff note for the current session
agent: general
---
Write a handoff note to `.kilo/handoffs/YYYY-MM-DD-HHMM-session-handoff.md`.
Required sections:
- Summary
- Files changed
- Commands/tests run
- Open issues / blockers
- Recommended next step
- Risks / rollback notes
If the directory does not exist, create it.
Do not say the handoff was written unless the write succeeded.Then you can invoke it with:
/handoff
If you need real “block on exit until condition is met” behavior, do it outside Kilo:
- wrapper script around
kilo - editor task / shell function
- CI or git-hook style validation
- a small daemon that checks for a recent handoff file before allowing your own workflow to finish
That is currently the only reliable way to reproduce the exact semantics of a Claude Stop hook.
Yes, Kilo can do the multi-agent / multi-model part:
- the main workflow can run with one model
- a custom reviewer subagent can run with a different model
- the main agent can repeatedly call the reviewer and revise based on feedback
Current Kilo workflows are Markdown-based instruction files, not a procedural DSL with strict loops/conditionals/hooks. So a “repeat until approved, max 10 tries” workflow is best-effort when implemented purely inside Kilo.
For a hard gate, use an external driver script that calls Kilo repeatedly and parses the reviewer verdict.
Create .kilo/agents/code-reviewer.md:
---
description: Strict reviewer that returns APPROVED or BLOCKED
mode: subagent
model: openai/gpt-5.3-codex # replace with the exact provider/model ID from `kilo models`
temperature: 0.1
permission:
edit: deny
bash: deny
---
You are a strict code reviewer.
Review the current workspace state against the task you are given.
Output format:
- first line: `APPROVED` or `BLOCKED`
- second line: one-sentence verdict
- then sections:
- Blocking issues
- Non-blocking suggestions
- Minimal acceptance checklist
Only return `APPROVED` if there are zero blocking issues.If you already have a custom reviewer agent installed, just replace code-reviewer with that agent's name.
Create .kilo/commands/implement-with-review.md:
---
description: Implement with mandatory reviewer loop (max 10 rounds)
agent: code
model: anthropic/claude-opus-4.6 # replace with the exact provider/model ID from `kilo models`
---
# Mandatory implementation + review loop
Goal: complete the user's task, but do not finish until the `code-reviewer`
subagent approves or 10 rounds are exhausted.
Execution contract:
1. Work in rounds numbered 1..10.
2. In each round:
- inspect the current task state and reviewer feedback
- make the smallest reasonable edits
- run focused validation for the touched area
- delegate a review pass to `code-reviewer`
3. The reviewer must respond with `APPROVED` or `BLOCKED` on the first line.
4. If the reviewer returns `BLOCKED`:
- summarize the blocking items into a concise TODO list
- fix them
- continue to the next round
5. If the reviewer returns `APPROVED`:
- stop iterating
- produce a final summary with changed files, tests run, and residual risks
6. If round 10 ends without approval:
- stop
- report that approval was not reached
- list the remaining blockers and the best next step
Important rules:
- Never claim approval unless the reviewer explicitly returned `APPROVED`.
- Keep reviewer feedback concrete and file-specific.
- Prefer focused tests over expensive full-suite runs unless the change requires it.
- If useful, persist reviewer results under `.kilo/reviews/round-<n>.md`.Invoke it with:
/implement-with-review
- workflows can choose an
agentand amodel - custom subagents can define their own
model,mode, andpermission - subagents run in isolated sessions and return results to the parent agent
That makes “Opus implements, GPT-5.3-codex reviews” a valid Kilo pattern.
If you want the 10-round approval loop to be truly enforced, use a wrapper script like this:
#!/usr/bin/env bash
set -euo pipefail
TASK="${*:?pass the task text}"
mkdir -p .kilo/reviews
for round in $(seq 1 10); do
kilo run --agent code --model anthropic/claude-opus-4.6 \
"Round ${round}/10. Task: ${TASK}. If .kilo/reviews/latest.md exists, fix every blocking item in it before doing anything else."
kilo run --agent code-reviewer \
"Review the current workspace for task: ${TASK}. First line must be APPROVED or BLOCKED." \
> .kilo/reviews/latest.md
if grep -q '^APPROVED\b' .kilo/reviews/latest.md; then
echo "Approved in round ${round}"
exit 0
fi
done
echo "Reviewer never approved after 10 rounds" >&2
exit 1This variant is not as ergonomic as a native hook/loop engine, but it gives you the deterministic “do not finish until approved or attempts exhausted” behavior.
Current docs distinguish between session model selection and persistent per-agent model defaults:
- in VS Code,
/modelsopens the picker for the current session; docs say precedence is session override → per-agent config → global config → recent models → Kilo Auto - in CLI/TUI,
/models/ the picker switches models interactively, but the documented precedence is--model→ per-agent config → last used in session → global config → recent models → first available
That means a model configured directly on an agent can still dominate in some situations, especially in CLI precedence.
If you expected /models to permanently rewrite the agent's default model, that is not what the docs currently promise. The persistent/default place to change an agent model is:
- Settings → agent/model configuration
kilo.jsonc- a custom agent markdown file in
.kilo/agents/or~/.config/kilo/agents/
There are current open issues around model/agent coupling in the new extension, including:
- #6377: changing “Model Override” in the new extension does not stay specific to the selected agent
- #8305: switching agents can also change models implicitly, leading to unexpected cost/behavior
So if /models appears to do nothing, or the choice reverts unexpectedly, it can be one of two things:
- documented precedence (for example, the agent itself is pinned to a model)
- a current model-selection bug / rough edge in the new extension UX
# inspect the resolved config
kilo debug config
# inspect one agent's resolved config
kilo debug agent <agent-name>Also inspect whether the relevant agent has an explicit model: in:
~/.config/kilo/kilo.jsonc- project
kilo.jsonc .kilo/kilo.jsonc~/.config/kilo/agents/*.md.kilo/agents/*.md
This is a real current sharp edge.
kilo serveprotects HTTP endpoints with Basic Auth whenKILO_SERVER_PASSWORDis set.- Server-side username is
KILO_SERVER_USERNAMEif present, otherwise default iskilo. kilo attach http://...currently usesopencode:<password>for the Basic Auth header.kilo --attach http://.../kilo run --attach http://...currently uses${KILO_SERVER_USERNAME:-kilo}:<password>.- The current VS Code / VSCodium extension does not attach to an arbitrary external server. It bundles its own
bin/kilo, spawnskilo serve --port 0, captures the ephemeral port from stdout, and connects over HTTP + SSE. - The extension client currently authenticates to its own backend as
kilo:<password>.
This creates a mismatch matrix:
| Client | Username it sends today |
|---|---|
kilo attach <url> |
opencode |
kilo --attach <url> / kilo run --attach <url> |
${KILO_SERVER_USERNAME:-kilo} |
| VS Code extension client | kilo |
kilo serve server expectation |
${KILO_SERVER_USERNAME:-kilo} |
If the server was started by the extension, it normally expects:
kilo:<password>
So:
kilo attach http://127.0.0.1:4096may fail with Unauthorized, while:
kilo --attach http://127.0.0.1:4096works, because --attach follows the server default username (kilo) and the attach subcommand currently does not.
If you launch VSCodium/VS Code with:
export KILO_SERVER_USERNAME=opencodethen the extension-spawned backend inherits that environment and its kilo serve process expects:
opencode:<password>
But the extension client still authenticates as:
kilo:<password>
So the backend starts, but the extension keeps failing auth / health checks and may sit in a reconnect loop showing:
connecting to server...
Find the extension-managed backend:
pgrep -fla '/extensions/kilocode.kilo-code-.*/bin/kilo serve --port 0'Inspect its environment:
pid=<PID>
strings /proc/$pid/environ | grep '^KILO_SERVER_'If you see:
KILO_SERVER_USERNAME=opencode
that is the smoking gun.
Start VSCodium/VS Code with a clean env for server auth vars:
env -u KILO_SERVER_USERNAME -u KILO_SERVER_PASSWORD codiumor, in the current shell:
unset KILO_SERVER_USERNAME
unset KILO_SERVER_PASSWORD
codiumThen let the extension spawn its own backend again.
At least in the current rebuilt extension line, there is no documented/obvious setting that tells the extension to reuse your already-running external kilo serve endpoint. Treat the extension backend and manual kilo --attach as separate client flows.
Then the likely causes move to extension-side startup/reconnect bugs, for example:
- extension misses the printed port if the startup line is split across stdout chunks
- extension reconnects against a dead backend after process death / stale SSE state
In that case, inspect extension host logs and the spawned kilo serve stderr.
{ "$schema": "https://app.kilo.ai/config.json", "model": "provider/model", "permission": { "*": "ask", "bash": { "*": "ask", "git *": "allow", "npm test*": "allow", "rm *": "deny" }, "edit": { "*": "ask", ".env*": "deny" }, "external_directory": { "~/projects/shared/**": "allow" } }, "instructions": [ "./docs/coding-standards.md" ], "mcp": { "context7": { "type": "remote", "url": "https://mcp.context7.com/mcp", "enabled": true } }, "skills": { "paths": ["~/my-skills"] } }