Skip to content
DocsHaarness CLI
On this page

Find and resume a chat

Every chat with Haarness is saved, so you can close the terminal and pick up later. Chats belong to the folder you started them in. The commands are named sessions; --session and --thread both take a chat's ID.

Resume where you left off

haarness --continue

This opens the terminal UI on the most recent chat in this folder. Inside the terminal UI, /sessions (or Ctrl+L) opens the list instead. When you quit the terminal UI, it prints the command that reopens that chat.

Find an older chat

haarness sessions list
haarness sessions list --all      # include archived chats

Each line shows one chat, separated by tabs: its ID, title, model and when it was last updated, newest first. Then open one:

haarness --thread <id>

--session works the same as --thread. To see a chat's details without opening it, run haarness sessions get <id>; add --transcript for the whole conversation as JSON.

To look in another folder, add --workspace <path> to any of these commands.

Continue a chat from a script

haarness run --continue "and now add tests"
haarness run --thread <id> "…"

See Run a prompt from a script or CI.

Try a different approach

Forking copies a chat so you can go another way without losing the original.

haarness sessions fork <id>
haarness sessions fork <id> --title "Try the streaming API"
haarness tui --continue --fork      # fork the last chat and open the copy

sessions fork prints the new chat's title and ID; add --json for the whole record. To fork from an earlier point, pass --at <sequence> with an item's sequence from haarness sessions get <id> --transcript. In the terminal UI, /fork lets you fork from now or from an earlier reply. The message browser can also fork from any message.

Tidy up old chats

haarness sessions archive <id>
haarness sessions unarchive <id>

Archived chats are hidden from the list but kept. haarness sessions list --all shows them.

Ask a side question

haarness btw <id> "Which file did we change the retry logic in?"

btw answers a question about a chat without adding anything to it. The answer uses no tools, and the chat's work carries on undisturbed. In the terminal UI and Desktop, /btw <question> opens a side chat where you can ask follow-ups.

Export or share a chat

haarness sessions export <id> -o chat.json
haarness sessions import chat.json

Export writes the chat, including the chats its helpers and workflows created, to one JSON file. It will not overwrite an existing file unless you add --force; without -o, it prints the JSON. Importing the same file twice does not create duplicates: the second import merges into the copy already there.

--sanitize replaces the conversation text and other sensitive text with placeholders. Use it when you need to share the shape of a chat, for example in a bug report, without its content.

If Haarness stops unexpectedly

Your chats are kept. Haarness does not re-run commands or edits that were in progress; they are marked as interrupted. A goal that was active comes back paused until you continue it.

Reference

Command Does
haarness --continue Open the most recent chat here
haarness --thread <id> Open a specific chat
sessions list [--all] [--json] List chats in this folder
sessions get <id> [--transcript] Show one chat as JSON
sessions fork <id> [--title] [--at] [--json] Copy a chat
sessions archive / unarchive <id> Hide or restore a chat
sessions export <id> [-o file] [--force] [--sanitize] Save as JSON
sessions import <file> [--json] Load an exported chat
btw <id> "<question>" Ask without changing the chat