Repository navigation
v0.5.0 — the command line
Claude Sessions grows a command line. The same binary is now a headless CLI, so a
conversation can compact, search, edit or rehome itself without the app running.
Supercompact asks first
The toolbar button used to fire immediately. It now opens a sheet with the one
choice that changes the result: keep a line per tool call, or dialogue only.
With tool calls kept, each one survives as plain language in the turn where its
result used to sit:
You used tool Bash(command: swift build 2>&1 | tail -5, description: Build the package)
Parameters only — tool results are never included, since they are the bulk a
supercompact exists to shed. They come back as text rather than tool_use blocks
because the API rejects a tool_use with no matching tool_result, which would
break the fork on its next turn.
A headless CLI
make install-cli
claudesessions list --current # the active session for this directory
claudesessions search "context window" # find the thread, across conversations
claudesessions grep --current "tool_use" # find the message, within one
claudesessions show --current --last 6 # read the tail
claudesessions compact --current --tools # fork the dialogue into a new session
claudesessions compact --current --in-place # ...or rewrite this one, same id
claudesessions edit --current # rewrite or drop messages, forking
claudesessions move --current ../NewIdea # rehome it in another project
claudesessions count-tokens --file notes.md # exact with ANTHROPIC_API_KEY, else ≈Every verb runs appless and stateless: no GUI, no daemon, no MCP server.
compact, edit and move always fork — the source session is never modified.
edit pulls a bad turn out of a conversation before you resume it. It also
scrubs the metadata records that would otherwise keep a copy: Claude Code mirrors
user prompts into last-prompt entries, so a message deleted from the dialogue
was still sitting in the fork on disk. Tool output that quoted the removed text is
reported rather than silently left, since deleting it would orphan its tool call.
compact --in-place keeps the session id and name. It writes a full copy
titled <name> supercompact_copy_<date>_<time> first, then preserves the current
turn byte-for-byte — a live session appends to its own transcript, so the entries
it knows about have to keep existing. The saving lands on resume, not in the
window you are typing in.
move is for the idea that started in the wrong repo. --suggest prints the
parent directory and the projects beside it; a target that does not exist yet is
created.
Context warnings
Claude has no running token counter — it cannot feel a session getting long.
claudesessions hooks install --thresholds 140000,600000A UserPromptSubmit hook reads real usage from the transcript and, at each
threshold, asks Claude to offer you a supercompact. Once per threshold per
session. It only ever asks; it never compacts on its own. The first-launch wizard
now offers this alongside retention and the backup daemon.
Claude Code integration
make install-agent installs /supercompact, /supercompact-self and
/move-to-project. The latter two are user-invocable only, so Claude cannot
trigger them on its own.
Cycle 77 (headless agent CLI) ships complete. 59 regression checks in
scripts/cli_check.sh. Builds are ad-hoc signed, not notarized — if macOS
objects, right-click the app and choose Open.