Reference documentation

Koh command reference.

Keep the versions of your project that worked. Save progress as you go, try a change, and bring an earlier version back when you need it.

v3.8.7VSQLite 3.49.1macOS + Linux

01Get started

Koh keeps a history of your project as you work. Each save records the whole project, apart from files you ignore. Give it a short message about what changed, then carry on. History lives in one .koh file in the project folder, works offline and stores unchanged files once.

→curl -fsSL https://koh.asha.software/install.sh | sh

The installer downloads a verified binary for Apple silicon macOS or x86_64/ARM64 Linux and offers the zsh prompt and completions. Then open a terminal in your project and record your starting point:

koh init
koh save "first working version"

A day with Koh

Say you want to change your project’s parser. Start from a saved version, make the change, and save again when it works.

01
koh status

See whether anything changed since the last save, and read the changes with koh diff. Save unfinished work before starting the next task.

02
koh checkpoint "before changing the parser"

Keep a named starting point. A checkpoint works even when no files have changed.

03
koh save "reject incomplete input"

Edit, run your checks, review koh diff and save. Write a message you’ll recognise later.

04
koh view

Browse what you’ve saved. If the change goes badly, save what you have and run koh load --checkpoint. Koh asks before replacing files, and the parser change stays in history if you want it back.

If a coding agent makes the change, record its model and task with the save so you can review or undo the whole session. To carry on from another machine, set up a remote.

Installation options

To install without prompts, run curl -fsSL https://koh.asha.software/install.sh | sh -s -- --yes --no-zsh, or use --zsh to include the plugin. INSTALL_DIR sets where the binary goes. New releases do not support Intel macOS.

Coming from Koh 2, save any unfinished work, run koh update and confirm, then run koh migrate in each repository. Migration keeps every save ID and moves the old data to .koh-v2/.

02How Koh works

One line of history

Saves form one line. Undo, revert, load and pluck each add a save, so earlier saves stay available by ID.

One SQLite file

.koh holds every save, file object, flag, setting and event. Don’t copy it while it is open; koh doctor --backup makes a consistent copy.

Strict confirmation

Destructive actions default to No. Press Enter to cancel, or approve with y, Y or explicit --yes. Replacing a remote and receiving saves also ask, even with --mine or --theirs.

Permanent erasure

Only koh strip erases files from saved history. It carries the removal to the remote and makes you type each path first.

A path stripped from every save is banned. Koh adds it to .kohignore, and no machine can save it into this repository again.

03Saving & history

koh init

Create the repository at the project root.

koh save <message> [--agent <name>] [--session <name>]

Save the whole working tree. Koh reuses stored files that have not changed and offers the save to the remote if one is configured.

koh status [--json]

Show changes since the last save, repository problems and any interrupted restore.

koh diff [<id> [<id>]] [--session <name>|last]

Show unsaved changes, compare the working tree with a save, or compare two saves. --session shows the changes made during an agent session.

koh view [--checkpoints] [--since <when>] [--session <name>]

Browse saves and checkpoints. On a terminal it opens the interactive list below; piped or with --json, it prints the history.

koh checkpoint <message> [--agent <name>] [--session <name>]

Record a save you can return to, even if no files have changed. Name the work you are about to start.

koh flag [<id>] [--reason <text>] [--clear]

Mark a save as unsafe and record the reason, or clear the flag. Flags sync with the history.

Interactive view

KeyAction
↑ / ↓Move through saves
TabSwitch saves and checkpoints
/Search the line
EnterOpen one save
cCopy its ID
lLoad it
fFlag it

04Going back

Each restore adds a save, so you can still return to the state you left.

koh undo [<n>] [--session] [--yes]

Restore the state from one or more saves ago. With --session, restore the state from before the current session.

koh revert [--yes]

Discard unsaved changes after keeping them in a checkpoint. Load that checkpoint to get the work back.

koh load <id> [--yes]

Restore the files from the selected save.

koh load --checkpoint [--yes]

Return to the latest checkpoint without looking up its ID.

koh peek <id>

Open a save in a temporary folder without changing the working tree or history.

koh pluck <id> [<path>...] [--reverse] [--dry-run] [--yes]

Apply the changes from one save, or reverse them, as a new save. Paths limit which files it touches. If a file has changed since, pluck stops and leaves the tree alone.

05Sync & Kepr

Every repository on a machine shares one remote: a folder, an S3 bucket or storage from a Kepr host. Koh offers each save to it automatically. If that fails, Koh prints a warning and keeps the local save. After any interruption, run offer or steal again; Koh transfers only what the other side is missing.

koh remote <kepr-host> [--code <code>]

Sign in to a Kepr host and use the storage it provides.

koh remote folder <path>

Use a local folder, mounted drive or USB disk.

koh remote s3 <endpoint> <bucket> <region>

Use an S3-compatible bucket. Credentials can come from KOH_ACCESS_KEY and KOH_SECRET_KEY.

koh offer [--builds [--notes <text>]]

Send saves the remote is missing. --builds also builds and publishes every platform named in koh.build.

koh steal [--mine|--theirs] [--yes]

Receive saves made on another machine. Koh replays local saves after the remote ones and applies files changed on only one side. If both sides changed a file, it shows both versions and asks which to keep; it never merges lines. Choosing mine or theirs sets the working files, and Koh prints the previous local head ID so you can load it later.

koh steal <kepr-host>/<repo>

Download a public repository, check its complete history and record where it came from. Run koh steal inside it to receive later saves. It stays read-only until this machine signs in to that Kepr host; the next offer then imports the remote saves and drops the read-only source.

06Builds & releases

koh build [--platform <platform>]... [--all]

Run the koh.build recipe for this machine, the named platforms or every platform in the file. The output stays local; Koh does not upload or install it.

koh update [--check] [--yes]

Look for a newer Koh release. Koh refuses versions that are not newer and checks the download’s Blake3 hash before replacing the binary.

The koh.build recipe

Define platforms, build commands and output paths in koh.build. Koh substitutes the platform and the project’s version into each command. It takes the first literal version it finds in VERSION, build.zig.zon, v.mod, package.json, Cargo.toml, Info.plist, then Gradle, without running a build tool, and refuses to build a project that has none.

Any project can build for these platforms, including Intel macOS, which Koh’s own releases no longer support.

PlatformTarget
linux-x86_6464-bit Intel/AMD Linux
linux-aarch6464-bit Arm Linux
macos-aarch64Apple silicon macOS
macos-x86_64Intel macOS
android-arm6464-bit Arm Android
android-x86x86 Android
koh build # this machine
koh build --platform linux-aarch64
koh build --platform macos-aarch64 --platform linux-x86_64
koh build --all # every platform in koh.build

Publishing

koh offer --builds builds every platform before uploading anything, then uploads the release files, the release record and finally releases/latest. Published versions never change; to correct a build, release a new version.

Building Koh itself needs V 0.5.2 b9a2d87 and the native C toolchain for the target OS and CPU. Boehm garbage collection is bundled and Zig is not required. The source README covers compiler setup and build commands.

07Agents & automation

--agent records the model and --session groups the saves from one task. koh view shows both as [agent · session].

koh save "tighten parser errors" --agent gpt-5 --session "parser errors"

koh diff --session last shows everything the latest named session changed. To throw the result away, koh undo --session restores the state from before it, or koh load --checkpoint returns to the checkpoint. The session’s saves stay in history either way.

Strict Koh Discipline

Read the current stateRead koh status --json, koh view --since today --json and LOG.md. Stop if the tree has unsaved changes.

Checkpoint before startingName the task in the checkpoint message.

Save one result at a timeUse separate saves for unrelated changes, even within one task.

Verify before savingBuild and test each result.

Sessions & attributionUse the real model ID and one short session name for the whole task.

Save seriallyAgents may work in parallel, but only one writes to the history at a time.

Describe the resultName the behavior the save adds or fixes. A message like “update files” tells the reader nothing.

Never end unsavedIf the task is incomplete, save it with a specific wip: message.

JSON & exit codes

Commands that print information accept --json and print one JSON value with no colour or pagination. Errors go to stderr. Without a terminal Koh never waits for an answer, and koh strip refuses to run.

CommandUseful fields
koh status --jsonhead, dirty state, changed paths, size, flagged state
koh view --jsonsave IDs, parents, messages, agents, sessions, checkpoints
koh diff --session lastthe complete patch made by one session
ExitMeaning
0The command worked
1Koh refused or the operation failed
2The command line was wrong

08Care & configuration

koh doctor [--backup <path>] [--yes]

Verify every stored object’s hash and each save’s file list. --backup writes a consistent copy of .koh. Old peek folders are cleared only with --yes.

koh ignore <path>... [--global] [--yes] [--json]

Preview the ignore rules for these files or folders, confirm once, and toggle the matching rules in .kohignore. --global edits ~/.kohignore instead.

koh migrate [--lane dev|main]

Convert a Koh 2 repository in place, keeping every save ID.

koh strip <path>... [--save <id>] [--yes] [--json]

Erase these paths from history in one local transaction and from the remote. It needs a terminal, and you must type every path before removal starts; --yes skips only the yes/no question. If remote cleanup is interrupted, run the same batch again.

koh man [<command>]

Read the built-in manual, or one command’s section. koh help prints a shorter reference, and koh help <command> prints one command.

Files

PathPurpose
.kohThe repository, in one SQLite file
.kohignorePaths Koh leaves out; Koh’s own files and symlinks are always ignored
~/.kohignoreMachine-local rules applied alongside each repository’s .kohignore; names and paths match at any depth
LOG.mdThe latest 20 saves, rewritten after each save and never saved itself
~/.config/koh/remoteThe machine’s folder, S3 or Kepr-derived remote
~/.config/koh/credentialsS3 credentials, stored with mode 0600
koh.buildThe project’s build and release recipes

Ignored files remain in earlier saves. Koh previews broad ignore rules and warns when removing a rule would bring other files in. If a global rule matches a tracked file, the next save records that file as gone. Global rules stay on this machine.

Environment

NO_COLORTurn off colour
KOH_NO_COLORThe Koh-specific form of the same setting
KOH_ACCESS_KEYS3 access key for remote setup
KOH_SECRET_KEYS3 secret key for remote setup
KOH_UPDATE_SOURCEUse another release document for updates