Claude Code in a window
ztk code claude runs Claude Code in the harness of ztcl and shows what it does in a window. The terminal of Claude Code is on the left. A panel on the right shows the model, the tokens, the tasks, the changed files, and each tool call. It is the window form of ztcl code claude, which draws the same panel in a terminal.
ztk code claude
ztk code claude -- --resume
ztk code claude -isolation interp -- --continue
The words before -- are options of the harness. The words after -- go to Claude Code. The flags of ztk, such as --dark, go before code.
| Option | What it does |
|---|---|
-isolation process |
The default. Claude Code runs in a child process in the sandbox of the system. It can change only the project, its state folders, and the temporary folder. |
-isolation interp |
Claude Code runs as a program of this process, with the full power of the user. The panel shows no sandbox: full user access in red. |
-isolation vm |
Claude Code runs in a guest on KVM. The guest sees the project, the state folder, and the hosts of Claude Code. |
-write LIST |
More paths that Claude Code can change at the level process. |
-program PATH |
The program. The default is claude on PATH. |
-mcp 0|1 |
Gives Claude Code the MCP server of ztcl (ztcl debug --mcp). The default is 1. It needs ztcl on PATH. |
-skills 0|1 |
Gives Claude Code the skills and the prompt of the harness. The default is 1. |
-kernel F, -initrd F, -memory MB |
The guest of the level vm. |
The window
- The terminal is a
ztk::terminal. The keys go to Claude Code, and the size of the terminal in cells follows the size of the window. - The panel shows the model, the state (
idle,thinking, or the name of the running tool), the tokens in and out, and the tokens of the cache. - The line under the tokens shows the sandbox: the count of the paths that Claude Code can change, the guest, or
no sandbox. - The text under it is the last message of Claude Code.
- Tasks lists the tasks of
TodoWrite: ✓ done, → in progress, and · to do. - Files lists the files of
EditandWrite, the newest first. - Tools lists each tool call with its first argument: ● running, ✓ done, and ✗ failed.
- The status bar shows the level, the session, and the status of Claude Code, such as
runningorexit 0. - Ctrl-] shows or hides the panel.
The window stays open after Claude Code ends, so the panel and the status stay on the screen. Close the window to end the session.
The capabilities
ztk code claude turns on exec, clock, socket, env, thread, event, and vm with no --allow flag. The program uses the files of the host, as it does for a script. The policy of socket allows the loopback addresses and the hosts of Claude Code. The policy applies to the interpreter and to the NAT of a guest. A program on a PTY of the host reaches the network as the user. exec gives Claude Code the full power of the user at the level interp, so use the level process or vm for a sandbox. A plain ztk script.tcl gets only file and channels, and more with --allow.
The harness needs the variables HOME and PATH, and Claude Code keeps its state in ~/.claude or in CLAUDE_CONFIG_DIR. The module ztcl::code::claude of ztcl has the harness, and docs/modules/code.md of ztcl has its commands.
Check it
tests/code-claude.sh runs the window on the headless backend with /bin/sh in place of Claude Code, at the levels interp and process. It checks the output on the terminal, a typed line with a non-ASCII character, the new size of the PTY after a resize, the panel after a set of events, and Ctrl-]. On 2026-11-28 it passed on Linux x86-64.