Kirsch docs menu

Kirsch documentation · v0.1.5

Using Kirsch

How the screen is laid out, every key it responds to, every slash command, and the approval model that stands between a tool and your files.

Kirsch runs real model turns against your repository, keeps a durable session log, and resumes it on launch or with kirsch resume. The layout, the key bindings, the slash commands and the approval flow all work as described below. Sections that describe a limit say so in place.

The help overlay inside the program (?, or /help) is generated from the same binding table the program dispatches on, so it cannot describe a key it does not have. Where this page and the overlay disagree about a binding, the overlay is right. Where they disagree about why, this page is.

Starting it

kirsch                       # run in the enclosing Git repository
kirsch resume                # resume the most recent session for this workspace
kirsch --new                 # start a fresh session even when a previous session exists
kirsch --workspace ~/code/x  # run against a directory you name
kirsch --debug               # also write a structured debug log

kirsch resume picks up the most recent session for this workspace, including its session grants. If another Kirsch is already running in the workspace, it starts a fresh session instead and says so. kirsch --new starts a fresh session even when a previous session exists.

Kirsch works inside one directory and never outside it — the workspace. With no flag it is the enclosing Git repository; --workspace names one explicitly. The project name in the header is that directory's base name.

The debug log goes to $XDG_STATE_HOME/kirsch/debug.log, or ~/.local/state/kirsch/debug.log when that variable is unset. It never writes to stdout or stderr, so it cannot corrupt the display. KIRSCH_DEBUG=1 turns it on without the flag.

The screen

 Kirsch ───────────────────────────────────────   header row 1 — wordmark + rule
 my-project ─ main ●                              header row 2 — session line

                                                  transcript (fills)
 ── you ───────────────────────
 Fix the Divide validation

 ▸ read_file calc/divide.go · 4ms · ok            tool card (collapsed)

 I found the issue in... ▌                        streaming assistant

 ──────────────────────────────────────────────   separator rule
 claude-sonnet-5 · ⠋ thinking · in 12.4k out 980 cache 8.9k/1.2k · $0.04   status bar
 ──────────────────────────────────────────────   separator rule
 > _                                              composer

The cache figures are tokens read from the cache, then tokens written to it.

Header — two rows. Kirsch stands alone on the first, with a rule running off to the right. The second is the session: project name, branch, a ● if the worktree is dirty, and (compacted) once the session has been compacted. Below 60 columns the branch is dropped, and the dirty marker goes with it. Only the first row carries a rule.

Transcript. Everything that has been said and done, oldest at the top. It takes whatever rows the rest of the frame does not need.

Status bar. Model, current state, session token totals and cost, and any active session grants. Persistent warnings, for example a recovered session or another Kirsch running in the same workspace, sit at the right. No narrowing step removes them, but on a very narrow terminal a long one is cut at the right edge.

Composer. One row to start, growing as you add lines up to a fixed maximum height. Past that maximum the composer scrolls up and down to keep the line you are typing on in view. A line wider than the terminal is cut at the edge with a ⋯ marker; the composer does not scroll sideways. While a turn is running it dims and stops accepting input, and shows (input disabled, Esc cancels) at the right.

The frame keeps one blank column at each side, and none at the top or bottom. A terminal's rows are scarcer than its columns: the layout already spends every row it has, so a blank row would come out of the transcript, which at the smallest supported terminal is four rows tall. The right-hand column is reserved rather than painted, so no row ever ends in trailing whitespace, and both edges show your own terminal background rather than Kirsch's.

Sizes. Kirsch runs from 40×10 upwards. As the window narrows it drops the status bar's token figures (below 80 columns), then the branch (below 60), and below 40 replaces the transcript with a terminal too narrow notice rather than rendering something illegible. Below 80 columns the status bar also shortens its left-hand text as the width shrinks, starting with the grant count, and keeps the state for as long as it can. As the height shrinks it shrinks the composer, then drops the two separator rules together, then the header — both of its rows at once. Nothing panics at any size, and a zero-sized terminal draws nothing at all.

Keys

Kirsch is modal. Which keys do what depends on where the focus is, and the mode changes only by an explicit key.

Composing — the default

KeyAction
EnterSend
Shift+EnterNewline, where the terminal sends ESC+CR for it
Alt+EnterNewline, same decode path — Option+Enter on a Mac keyboard produces nothing
Ctrl+JNewline — the one form every terminal can produce
TabWhile typing a slash-command name (no space yet), complete a unique prefix; an ambiguous or unknown prefix does nothing. In any other text, move to the cards (→ Browsing)
Ctrl+GScroll back to the bottom of the transcript and re-pin it
↑ / ↓ on the first / last rowPrevious / next entry from this session's history (up to 100); past the newest, back to your unsent draft. Ignored while a turn is running
Shift+↑Move focus to the cards (→ Browsing)
Esc / Ctrl+CCancel the running turn; if nothing is running, clear the composer
Ctrl+C twice within 1sForce quit

q is an ordinary character here — there is no bare-key quit. ? is an ordinary character too: a help overlay that fired mid-sentence would make the composer unusable. Quitting is /quit, /exit, or Ctrl+C twice.

Ctrl+G is worth knowing. It is the only way back to the bottom that does not send something first, and it is the only composing key that works during a running turn — which is when watching the bottom of a stream is worth the most. It moves the viewport and nothing else: your half-typed message, the card selection and the mode are all left exactly as they were. End would have been the obvious key and is not available: the text area already uses it for end-of-line, as it uses Ctrl+End for end-of-input.

The key-hint line. On a terminal at least 24 rows tall, the bottom row lists the keys that act in the current focus — ↑↓ history · ⇧↑/Tab cards · /help in the composer, for example. It goes blank while a modal or confirm prompt is open, and is dropped on shorter terminals.

Browsing — after Shift+↑ or Tab

KeyAction
↑ / ↓Move the card selection (plain text blocks are skipped)
PgUp / PgDnScroll without moving the selection
Home / EndTop / bottom — End re-pins
g / GTop / bottom, for terminals that swallow Home and End
EnterTool cards: switch between the 10-line preview and the head line only
dOpen the full content or diff in a modal
?Help overlay
Tab / EscBack to the composer — does not move the view
↓ past the last cardBack to the composer

Scrolling and selection are separate: PgUp/PgDn move the view and leave the selection where it is, ↑/↓ move the selection and scroll only as far as they must to keep it visible.

g/G exist because Home and End are not universally reachable — macOS Terminal sends both as a sequence the toolkit does not decode. Kirsch normalises that on the way in, so both pairs work; g/G are the belt to that braces.

An approval is pending

KeyAction
yApprove, this once
aApprove and grant for the rest of the session — run_command only
nReject
dOpen the detail or diff
?Help overlay
Esc / Ctrl+CCancel the turn — recorded as cancelled, not rejected
Tab / Shift+↑Re-arm a card that a stray key released

Every other key is swallowed, and none reaches the composer. A key that is not one of the above and not a navigation key also releases the card: the composer shows approval pending — Tab to return to the card, and y, a and n do nothing until Tab or Shift+↑ re-arms it. That is deliberate: typing a command while a card waits — the n in /new — must not be read as an answer. Navigation keys never release; pasted text is dropped.

A modal is open

KeyAction
j / k / ↑ / ↓Scroll a line
PgUp / PgDnScroll a page
g / G / Home / EndTop / bottom
EscClose, returning to whatever mode you were in
?Also closes the help overlay

Closing returns you to the previous mode, so Esc from a modal opened over a pending approval puts you back at the approval, not at the composer.

A confirm prompt is up

One-line questions — "Discard the running turn and start a new session?", "Clear 2 session grants?", "Paste 12KB into the composer?" — appear immediately above the composer, not over the status bar.

KeyAction
yYes
n / EscNo

Esc is not spelt out on the prompt itself: it does the same thing as n, the row already names a way out, and the cells it would cost come straight out of the question — which at 40 columns is the part being truncated.

Everywhere

Ctrl+C is context-dependent by design: it cancels a running turn, and otherwise arms a force quit. Two presses inside a second always quit, from any mode.

Pasting is literal — pasted text is never interpreted as keys, and newlines in it are preserved. Pasted tabs become spaces in the composer, so tab-indented text arrives with space indentation. A terminal that does not send a paste as one block delivers each tab as a Tab key press instead: the first moves focus to the cards, where the text that follows is read as card keys and not typed. A paste over 8KB asks first. A paste that arrives while an overlay is open is discarded rather than queued, so text cannot appear in a composer you could not see it landing in.

Scrolling and pinning

The transcript is pinned to the bottom. New content while pinned keeps it pinned, so a running turn stays in view without you touching anything.

Scrolling up unpins it, and a ↓ 3 new indicator appears at the bottom right counting what has arrived since. The view then stays exactly where you put it: typing does not drag it back, and neither does returning to the composer with Esc. Reading scrollback is a deliberate act and Kirsch does not undo it for you.

It re-pins when you:

  • scroll back to the bottom yourself,
  • press Ctrl+G in the composer,
  • press End or G while browsing,
  • send a message, or
  • submit a slash command.

A slash command re-pins because it is a request and its answer belongs on screen. The exception is an unknown command. It answers in the dim hint under the composer and puts nothing in the transcript, so re-pinning would cost you your place to report a typo.

Slash commands

Type / at the start of a single line. A command must be the whole line: multi-line text beginning with / is an ordinary message, so a pasted diff or stack trace is never mistaken for one. Tab completes a unique prefix.

CommandWhat it does
/helpThe help overlay
/statusA notice summarising the session — for example the model, endpoint, branch, dirty count, token totals and compaction level
/diffThe unstaged working-tree diff, in a modal
/filesA notice listing the files changed by approved patches this session. A resumed session starts this list empty and does not rebuild it from the earlier transcript
/approvalsLists active session grants, and offers to clear them
/newStart a new session — confirms first if a turn is running
/compactCompact the conversation history
/quitQuit
/exitQuit — the same thing, spelt the other way

An unknown command produces a dim hint under the composer, never an error card, and is never sent to the model.

Kirsch /help overlay listing the keys and slash commands
The /help overlay. Taken on a pre-release build, so it shows the version as v0.1.0-dev.

Tool cards

Every tool call appears in the transcript as a card, collapsed by default:

▸ read_file calc/divide.go · 4ms · ok

Glyph, tool name, what it acted on, the result, and how long it took. By default, a tool card opens as a preview showing the first 10 lines. When lines are hidden, a marker reads ‹10 of 4,181 lines — d full output · Enter collapse›. Enter toggles between preview and collapsed (head only). d opens the whole thing in a modal. The 10-line preview keeps the scrollback legible while tools are running.

Where a cap was hit further upstream — a 200KB read, a 4000-token result — the card says so in the same shape: ‹truncated — 200KB cap›.

Tool output is sanitised before it is rendered. Escape sequences are stripped rather than passed through, because an unstripped sequence hands arbitrary terminal control to whatever the tool printed. Carriage-return runs render as their final segment, tabs become four spaces, and other control characters become a dim ·.

The approval model

A patch appears as a card and waits, and no setting turns that off. A command runs without a card when it is exactly one of the built-in allowlist commands, with no further arguments, or when a session grant covers it. Every other command appears as a card and waits, unless policy.require_approval_for_commands is false in your configuration; shells and runners wait even then (see Configuration). Check that setting when you expect a card and none appears:

┌─ approval required ─────────────────────────────┐
│ apply_patch — add input validation              │
│                                                 │
│ files: 2 changed (calc/divide.go,               │
│        calc/divide_test.go)                     │
│                                                 │
│ [y] approve   [n] reject   [d] view diff        │
└─────────────────────────────────────────────────┘

y approves this one action. n rejects it. d shows you exactly what it would do — the diff for a patch, the full command and its environment for a command — before you answer.

a grants for the session, and only commands offer it. A session grant means "stop asking me about this command for the rest of this session"; it is offered on run_command cards and never on apply_patch ones, because a patch is a different change every time and a blanket yes to it would mean nothing. The status bar shows a count of active grants, /approvals lists them, and it offers to clear them.

Grants live and die with the session. The session log records each grant, so kirsch resume (or auto-resume) restores them, unless another Kirsch is already running in the workspace, in which case a fresh session starts. A grant you clear with /approvals is recorded in the session log as cleared, so it stays cleared after kirsch resume. A new session, including one started with /new, starts with none.

When colour or Unicode is not available

Set NO_COLOR to a non-empty value, run under TERM=dumb, or pipe the output somewhere that is not a terminal, and Kirsch emits no colour codes and no style sequences — not merely no visible colour. An empty NO_COLOR (NO_COLOR=) is treated as unset, as the no-color.org convention asks, so it does not turn colour off by itself. The layout is identical: same rows, same columns, same box positions. Every state is identified by its glyph rather than by its colour, so nothing becomes ambiguous.

Where the locale is not UTF-8, every glyph falls back to an ASCII form of the same width — > for ▸, [ok] for ✓, ... for ⋯, +-| for box drawing, and the wordmark to K I R S C H. The layout does not move, because every substitution preserves width.

Kirsch never paints a full-screen background. It sets foreground colours and accents only, so it sits inside your terminal theme rather than replacing it.

If something looks wrong

Run with the debug log on and read it afterwards:

kirsch --debug
cat ~/.local/state/kirsch/debug.log

Rendering problems are worth reporting with your terminal (echo $TERM) and its size (tput cols, tput lines) — most of the ones found so far have been specific to one terminal's encoding of one key, and the size is what makes a layout defect reproducible.

These pages describe Kirsch v0.1.5. Source: the doc folder for v0.1.5 on GitHub · releases.