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.
Running a command
Section titled “Running a command”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.
Commands run in your default terminal profile’s shell (Terminal: Select Default Profile), and the agent writes its commands in that shell’s syntax — for example Git Bash, Command Prompt, Cygwin, or PowerShell on Windows, or zsh on macOS. If the selected profile is contributed by an extension, Kodik asks VS Code to create that profile instead of substituting another shell.
Kodik uses shell integration to capture each command’s exit code and command-scoped output. If the selected shell cannot provide an exit code, the command is shown as Completion Unverified with a neutral warning instead of being marked failed. The agent still receives the captured output and does not restart the command merely to discover its status.
If the output size would exceed the available context window, Kodik automatically triggers context compaction before returning the result.
Background processes
Section titled “Background processes”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 backgroundterminal_id = shell("npm run dev", block_until_ms=0)
# Poll the outputcommand_status(terminal_id=terminal_id)
# Stop it when done (or to restart)kill_terminal(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.
Each status result belongs only to that background command; output from earlier commands in a reused terminal is not included. If the process finishes without a detectable exit code, command_status reports Completion Unverified rather than an implementation value such as undefined.
A backgrounded command keeps its own terminal, so it never blocks the agent’s next command — the agent can start a dev server and immediately run commands against it (each command runs in a separate terminal, reusing an idle one where possible). When the agent no longer needs a background process, or needs to restart it after a change, it stops it with kill_terminal(terminal_id); the process is terminated and its terminal is freed. You can also stop any background command yourself from the session’s terminal menu on its chat tab.
Blocked commands
Section titled “Blocked commands”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.
Auto-approving commands
Section titled “Auto-approving commands”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. For chained commands, every segment must be allowed; npm run * does not approve a later curl ... | sh segment.
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.
Adding terminal output to chat
Section titled “Adding terminal output to chat”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.