Skip to content

Terminal

The Kodik agent runs commands in the terminal via the shell tool. Each invocation is scoped to the working directory of the current task, is visible in the chat, and requires your approval — unless auto-approve has been configured.

When the agent calls shell, the command appears in the chat with a pending status. You can approve or reject it. After execution the agent sees the full command output and responds to it.

If the output size would exceed the available context window, Kodik automatically triggers context compaction before returning the result.

For long-running processes — dev servers, watch modes, log streams — use the block_until_ms: 0 parameter. It starts the command in the background and immediately returns a terminal_id without blocking the agent.

# Start in the background
terminal_id = shell("npm run dev", block_until_ms=0)
# Poll the output
command_status(terminal_id=terminal_id)

Call command_status with the returned terminal_id to retrieve incremental output as it arrives. This lets the agent monitor server logs on its own without requiring you to paste output manually.

Some commands are never auto-approved — even in Autopilot mode. This is a safety guard against accidental data loss or destructive system operations. The default blocked list includes:

File deletion:

  • rm *, sudo rm *
  • del *, rd *, rmdir *, Remove-Item *, ri *

Destructive Git operations:

  • git clean*

Find with deletion:

  • find * -delete*, find * -exec rm*

Disk operations:

  • mkfs*, dd if=*, format *

System power:

  • shutdown*, reboot*

Other dangerous patterns:

  • > /dev/*, :(){:|:&};:, chmod -R 777 /, chown -R *:* /

You can customize the blocked commands list in auto-approve settings. See Auto-approve.

When auto-approve is enabled, the agent checks the command against your configured patterns (for example npm run * or git *). If the command matches a pattern and is not on the blocked list, it runs without prompting.

In Autopilot mode all commands are approved except blocked ones. A notification is shown if a command has been running in the background for more than 30 seconds.

You can manually add output from the VS Code integrated terminal to the chat context using the Add Terminal Output to Chat command (kodik.addTerminalOutputToChat). The command is available from the terminal context menu and the command palette. This is useful when you want to show the agent output from a command you ran yourself.