KCode Usage
Interactive REPL
kkOpens an interactive session. Type your questions or instructions, and KCode streams responses with syntax highlighting.
Permission System
KCode asks permission before executing potentially dangerous operations:
| Mode | Behavior |
|---|---|
ask | Prompt for each tool call (default) |
auto | Auto-approve safe operations |
plan | Show plan before executing |
deny | Block all tool execution |
acceptEdits | Auto-approve edits, ask for bash/other |
Protected directories (/etc, /usr, /bin, ~/.ssh, ~/.aws, ~/.gnupg) are always blocked for writes regardless of permission mode.
Subagents
For complex tasks, KCode spawns subagents:
- General — Multi-step research and code writing (all tools)
- Explore — Fast codebase exploration (read-only tools)
- Plan — Architecture and implementation planning (read-only + plan output)
- Custom — User-defined agents from
~/.kcode/agents/
# Via slash command
> /agent explore "find all API endpoints"
> /agent plan "redesign the auth system"
# Via CLI flag
kcode --agent reviewer "review the auth module"Multi-Agent Swarm
Orchestrate parallel agents for complex tasks:
kcode --agents '["test-runner", "linter", "reviewer"]' "check this PR"Team Mode
Group agents into teams with shared context:
Agent(task: "check tests", teamId: "review", agentName: "tester", shareResults: true)
Agent(task: "check types", teamId: "review", agentName: "type-checker", shareResults: true)Single-Shot Mode
k "what does the login function do"
k "add error handling to server.py"
k --print "list files modified today" # pipe-friendly output
k -m mnemo:mark5-nano "quick question" # use a specific model
k --effort low "simple fix" # lower effort for faster responsesSlash Commands
152+ slash commands available. Key examples:
| Command | Description |
|---|---|
/plan | Create or view a structured task plan |
/pin <file> | Pin a file to persistent context |
/memory | View or edit persistent memory |
/search <query> | Search codebase index |
/compact | Manually trigger conversation compaction |
/rewind | Revert to a previous checkpoint |
/stats | Show session cost and token usage |
/model | Show/switch model |
/style | Switch output style (concise/detailed/markdown/plain) |
/vim | Toggle vim keybinding mode |
/resume | Resume a previous conversation |
/benchmark | Run model benchmarks |
/doctor | Diagnose environment issues |
/batch | Run multiple prompts from a file |
/fast | Toggle low-effort mode |
/insights | Show analytics and usage insights |
/export | Export conversation transcript |
CLI Flags
kcode [options] [prompt]
Options:
-m, --model <name> Model to use
-p, --permission <mode> Permission mode (ask/auto/plan/deny/acceptEdits)
--max-turns <n> Max tool turns per loop
--effort <level> Effort level (low/medium/high)
--system-prompt <text> Custom system prompt
--print Non-interactive pipe-friendly output
--verbose Enable debug logging
--agent Run as subagent
--agents <json> Multi-agent swarm mode
--allowed-tools <list> Tool whitelist
--disallowed-tools <list> Tool blacklist
--session-id <id> Resume a session
--mcp-config <file> MCP server config file
--tmux Open worktree agents in tmux panes
--file <path> Read prompt from file
--from-pr <url> Load PR context
--read-only Disable write toolsShell Aliases
Add to your shell profile (auto-configured by KULVEX):
source ~/.kulvex/data/kulvex-shell-init.sh
# Now available:
kk # Interactive REPL
k # Single-shotVS Code Extension
KCode includes a VS Code extension with:
- Chat panel for inline coding assistance
- Session management
- MCP server browser
- Code actions and diagnostics
Install from vscode-extension/ or the KULVEX dashboard.
Web IDE Integration
KCode is also available in the KULVEX web terminal at /code. The web IDE spawns kcode via PTY, giving you the full interactive experience in the browser.