View verbs
kraft view reads work items without changing them. Wherever a command takes an ID, you can omit it inside that item's worktree. See the CLI for output format and --json.
Reading the board
kraft view list
kraft view list --all --status=paused
kraft view list --include-abandoned
kraft view show
kraft view search "retry policy"
kraft view search "retry policy" --limit 50
| Command | Effect |
|---|---|
view list | The board, scoped to the repo you are in. --all spans every repo. --repo PATH picks one. --status filters to active, needs_human, paused, queued, blocked, waiting, rate_limited, completed or abandoned. --include-abandoned adds abandoned items, cancelled ones included. |
view show [ID] | One work item. With no ID, the one whose worktree you are in. See What view show prints. |
view search | Search the document index. --limit caps the result count (default 20). |
What view list prints
view list prints one line per item, with the columns ID, STATUS, GATE, NODE and TITLE. GATE is the gate the item waits at, and NODE the node it is on, with 3/6 after it while the item reports its progress through a plan (task 3 of 6). An empty cell reads -, and the last column is cut with … to fit the terminal. With no items, it prints (nothing).
ID STATUS GATE NODE TITLE
3f9c1e7a5b2d4c80a6e1d97f0b34c2aa needs_human spec_approval spec_approval Fix flaky retry
b81d0c42e6a94f3d8c5a7e19f2046b13 active - implementation 3/6 Add JSON export
07ae5d3c91b84e26a4f8c0d1e7b352f9 paused - - Bump the lockfile
What view show prints
view show prints one key value line for each of these fields the item has, and None for one with no value. dependencies lists the items it comes after as ID (status), or none. --json prints the item's full detail instead.
id 3f9c1e7a5b2d4c80a6e1d97f0b34c2aa
title Fix flaky retry
...
repo /Users/you/code/app
status needs_human
current_node_id spec_approval
pending_gate spec_approval
gate_artifact .engineering/specs/retry.md
...
next_node_id plan
| Field | Meaning |
|---|---|
id, title, description, repo, bead_id | What the item is and where it lives. |
status, current_node_id, next_node_id | Where it stands: its status, the node it is on, and the node after. |
pending_gate, gate_artifact | The gate it waits at, and the document that gate is about. |
worktree_path | Where its worktree is. |
attachments | The spec or plan it was filed with, and what each trimmed. |
progress | Where the implementer is in its plan, such as "3 of 6", when it is on that node. |
usage | What the item has spent. See below. |
policy_override | The item's own policy override, only when it has one. |
concerns | What a task flagged about its own work when it finished, since the last gate that was decided. Only when there is one. |
stop_reason, suggested_action | On a stopped item, why it stopped, and the one command the chain proposes. |
next | On a stop on a dollar cap the item can raise, and with no suggested_action: kraft item raise-budget ID --usd N, the command behind the board's Raise cap. |
usage lists uncached input, cache writes, cache reads and output tokens, then cost. A session recorded before cache tokens were split out has a single input figure, counted under in, and the line says (cache not split on older sessions). A token_budget counts all four kinds.
A session reports its output tokens when it ends, and one that was paused or killed never does. While a session's count is missing, the line reads at least N out, or out not known when no session has reported one.
The cap next names is the item's own, or its policy's item-wide budget_usd. A stop on a cap raise-budget does not take adds no next line.
Following a running item
kraft view logs -f
kraft view logs --session <id> -n 0
kraft view events
kraft view events -f
kraft view events --type permission_decision
kraft view watch
| Command | Effect |
|---|---|
view logs | One session's log, by default the newest. See Read a session's log. |
view events | Node transitions, gate decisions and escalations. --after N shows only later events. --type T filters by type; see Events for every type. -f/--follow streams until the item completes or is abandoned; with --json, every event is one line of NDJSON. |
view watch | A live board, redrawn on every event. Needs a terminal. --repo PATH picks the repo. |
Read a session's log
view logs reads the newest session's log. While the item is stopped, it reads the log of the session that stopped it instead, such as the failed test command. It then names the newest session on stderr, such as the auto-escalation that started after the stop.
| Flag | What it does |
|---|---|
-f | Follows the newest session. While the item is stopped, stderr names the session that stopped it. |
-n N | Sets the backlog lines shown first (default 50). |
--session ID | Reads that session. |
-n 0 -f prints only lines written after it starts.
Reviewing before you approve
kraft view diff --stat
kraft view diff --name-only
kraft view diff
kraft view diff --no-pager
kraft view docs
kraft view docs <id> --attachment spec
kraft view doc <id> --open
kraft view artifact <id>
| Command | Effect |
|---|---|
view diff | The colored diff, through $PAGER. --no-pager prints straight to the terminal. |
view diff --stat | Size of the change. |
view diff --name-only | Changed and untracked paths. |
view diff -w | --ignore-whitespace: leaves out files whose only change is whitespace. |
view docs | Specs, plans and summaries linked to the item, including the spec or plan it was filed with. See List an item's documents. |
view docs --attachment spec|plan | The spec or plan the item was filed with, as Kraft stored it. See List an item's documents. |
view doc ID | One document. See Read one document. |
view artifact | The document the pending gate is about. --no-pager prints straight to the terminal. |
List an item's documents
A document the index does not hold yet is listed as attachment:<id>:spec (or :plan). Kraft reads it from the item's worktree, or, before the item starts, from the copy stored at filing. kraft view doc takes that id.
| Flag | What it does |
|---|---|
--attachment spec|plan | Shows the spec or plan as Kraft stored it at filing, which is what its worktree gets. It is the only way to read the document before the item starts. |
--json | Prints the same list; with --attachment, prints its path, title and content. |
--no-pager | With --attachment, prints straight to the terminal. |
Read one document
| Flag | What it does |
|---|---|
--open [EDITOR] | Opens the document in an editor on the server's machine. system is the OS opener. |
--no-pager | Prints straight to the terminal. |
With no editor named, --open uses the Default editor in Settings, else KRAFT_EDITOR, else the OS opener.
An attachment: id opens only once the item has started and has a worktree. Before that, a 409 names view docs --attachment.
What the diff shows
Once an item has commits, view diff and view diff --stat show two blocks.
The change under review is every commit on the item's branch since its
base, the spec and plan documents included. Uncommitted is what an agent
left in the worktree without committing; Kraft commits after every task, so it
is usually empty and reads "(nothing uncommitted)". An item with no commits
yet shows one block.
A truncated diff always says so on its last line. Files the agent wrote
without git add are listed separately, because a unified diff does not show
them.
Reviewing threads and comparing attempts
kraft view threads
kraft view threads --open
kraft view compare --from base --to latest
kraft view compare --from attempt:1 --to attempt:2 --stat
kraft view compare --nodes implementation,verify --name-only
| Command | Effect |
|---|---|
view threads | Review threads on the item, drafts marked. See List review threads. |
view compare | Diffs two review targets: base, attempt:N, last_review, or latest (the working tree; attempt:N needs a pending gate). See Compare two review targets. |
List review threads
--open drops resolved ones.
Each line range carries its side as the diff marks it:
calc.py:+8is new line 8.calc.py:-3 to -4is old lines 3 to 4.calc.py:-2 to +2is a removed line through its replacement.
Compare two review targets
| Flag | What it does |
|---|---|
--from | Defaults to base. |
--to | Defaults to latest, so with neither it shows the whole change so far. |
--nodes | Limits it to files those node ids touched. |
--stat, --name-only, -w | Mirror view diff. |
--json | Each file also carries viewed. |
Worktree disk use
kraft view storage
kraft view storage --json
view storage prints what the worktrees use against the quota and limit, the totals per category, and one line per worktree, largest first, with its item's title, status, size and age. A finished item that archiving would free is marked yes under RECLAIMABLE. A folder that belongs to no item reads orphan. It exits 0 in every state, held included: it is a read.
worktrees 12G of 10G (held)
quota 8G
reclaimable 9.1G
measured 4m ago
CATEGORY SIZE
worktrees 11.5G
...
ID STATUS SIZE AGE RECLAIMABLE TITLE
3f9c1e7a completed 4.2G 3d ago yes Fix flaky retry
b81d0c42 active 1.1G 2h ago - Add JSON export
With no limit set it prints 1G (no limit set) and no quota. --json prints the GET /api/storage payload. The figure is the last measurement, taken at startup and every 10 minutes while a limit is set, and on the first request when there is none. To archive what it marks, use kraft item archive --reclaimable.
Related
- Item verbs: act on what you read here: approve, reject, comment, retry.
- Reviewing a change: how threads, comments and outcomes fit together.
- Events: every event type
view eventscan show.