- An agent session that should not publish half-finished work.
- A batch of edits you want to review as one diff.
- Several agents working in parallel, each in its own draft.
draft/<id> with its own worktree under .kiwi/drafts/. Drafts need the git versioning strategy and a repository with at least one commit.
Turn on drafts
Drafts are off by default on the server..kiwi/config.toml
501 with drafts not enabled. The in-process MCP server (kiwifs mcp --root) has drafts available without this setting.
Lifecycle
1
Create
Create a draft and keep its
id. Creation fails with 409 when max_active drafts already exist.2
Write
Read, write, delete, and list files inside the draft. Each write commits to the draft branch. Draft writes are not indexed, searchable, or broadcast to the web UI.
3
Review
Diff the draft against the main branch to see exactly what would change.
4
Merge or discard
Merge fast-forwards the main branch to the draft, so its commits land in history unchanged and the file watcher indexes the new content. If the main branch moved since the draft was created, merge fails with
409. Discard deletes the branch and worktree.Use drafts
- REST
- MCP
Terminal
GET /drafts, GET /drafts/{id}, GET and DELETE /drafts/{id}/file, GET /drafts/{id}/tree, and DELETE /drafts/{id} to discard.