KCode Usage

Interactive REPL

kk

Opens 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:

ModeBehavior
askPrompt for each tool call (default)
autoAuto-approve safe operations
planShow plan before executing
denyBlock all tool execution
acceptEditsAuto-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 responses

Slash Commands

152+ slash commands available. Key examples:

CommandDescription
/planCreate or view a structured task plan
/pin <file>Pin a file to persistent context
/memoryView or edit persistent memory
/search <query>Search codebase index
/compactManually trigger conversation compaction
/rewindRevert to a previous checkpoint
/statsShow session cost and token usage
/modelShow/switch model
/styleSwitch output style (concise/detailed/markdown/plain)
/vimToggle vim keybinding mode
/resumeResume a previous conversation
/benchmarkRun model benchmarks
/doctorDiagnose environment issues
/batchRun multiple prompts from a file
/fastToggle low-effort mode
/insightsShow analytics and usage insights
/exportExport 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 tools

Shell Aliases

Add to your shell profile (auto-configured by KULVEX):

source ~/.kulvex/data/kulvex-shell-init.sh
 
# Now available:
kk    # Interactive REPL
k     # Single-shot

VS 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.