Account and machine

These commands look after your machine rather than a single session: who you are signed in as, the local server the app talks to, the projects it knows, and the invariant install itself.

Sign in to an organisation

invariant login                          # opens a browser to sign this machine in
invariant login --organization acme      # pre-select the organisation on the consent page
invariant whoami                         # every organisation this machine is signed in to
invariant whoami --verify                # confirm each sign-in with Invariant
invariant logout --organization acme     # sign out of one
invariant logout --all                   # sign out of every one

login opens a consent page in your browser, where you sign in and choose the organisation. Each organisation is its own sign-in: signing in to a second one never touches the first. --no-browser prints the link instead, --signup opens the page on sign-up when you have no account yet, and --join explains how to join a team that invited you. --device-name sets how this machine is named in your account (its hostname by default).

With several sign-ins, a plain logout refuses and lists them: name one, or pass --all. Projects of an organisation you signed out of stay bound to it; local work goes on, and what needs the organisation waits until you sign in again. Sign-ins are kept in ~/.invariant/credentials.json, readable only by you. The app's avatar menu does the same; see Teams and organisations.

The daemon and the UI

The daemon is the local server behind the app: it serves every registered project's pages, keeps each project's event log, and syncs organisation projects. The app starts it, so you rarely need these:

invariant daemon status          # is it running, on which port, serving which projects
invariant daemon start           # start it, or attach to the running one (port 4200)
invariant daemon stop
invariant daemon logs --follow
invariant ui                     # open the workbench for your projects

invariant ui opens the Invariant app when it is installed, and a browser tab otherwise (--browser forces the tab, --no-open opens nothing). daemon start --prefer-newest replaces a running daemon older than the CLI you run. invariant update restarts a running daemon on the new version unless you pass --no-restart-daemon.

Projects

The projects the app shows are the ones registered on this machine.

invariant projects list
invariant projects add ~/code/web                    # register a folder (the current one by default)
invariant projects rename <project> "Web app"        # the name this machine shows
invariant projects group <project> Frontend          # file it under a group, created if needed
invariant projects groups new Backend                # create an empty group; groups rm deletes one
invariant projects move <project> --to acme          # move it into an organisation
invariant projects remove <project>                  # forget it; its files stay

A <project> is its id, as projects list shows it, or its folder. projects add --organization <org> registers a folder straight into an organisation. The first time a repository moves into an organisation, say whether it is a clone of one of the organisation's projects (--join <project-id>) or a new one (--create). A project in an organisation stays there; moves are refused while a session of the project is in progress. Every move asks first, unless you pass --yes.

Worktrees

A session can run in its own Git worktree and branch, so several agents work at once without stepping on each other. Worktrees not in use are parked under .invariant/worktrees/; one worktree at a time is shown at the project root.

invariant worktree list                  # the worktree at the root, and the parked ones
invariant worktree switch INV-12         # show another worktree at the root, by name or session
invariant worktree remove <worktree>     # remove a parked worktree; its branch is kept
invariant worktree recover               # finish, or undo, a switch that was interrupted

switch refuses while an agent works on either side; --force is for an agent that crashed, and its files move with it.

Update and uninstall

invariant version
invariant self status                    # how invariant is installed, and which copy your PATH runs
invariant update                         # the latest version on your channel
invariant update --to 0.10.1             # a given version, even an older one
invariant update --rollback              # the previous version (native install)
invariant update --channel canary        # follow canary; --channel stable to go back
invariant update --auto off              # no background updates
invariant self uninstall                 # remove the native install
invariant self uninstall --purge --yes   # also delete ~/.invariant: projects, sign-ins, preferences, logs

self install is what the install script and the app run: it puts the native build on your PATH. Details are on Install the app and the CLI overview.

Telemetry

invariant telemetry status       # whether anonymous usage data is shared, and the installation id
invariant telemetry disable      # stop, and delete anything queued
invariant telemetry enable
invariant telemetry reset        # start over with a new anonymous id
invariant telemetry flush        # upload what is queued now

What is collected is on Telemetry.

Token usage

invariant stats reads Claude Code's own transcripts on this machine and reports token usage and cost. By default it covers the project you run it in.

invariant stats --since 7d               # the last 7 days
invariant stats sessions                 # per session, sorted by cost
invariant stats models                   # per model
invariant stats projects                 # every project
invariant stats --live                   # an interactive dashboard

--format markdown|json|table changes the output; --model filters by model.

Code index

invariant scan indexes the codebase into a code graph that the Brain's Code graph tab and agents read. It covers every file Git tracks and invariant.json admits, and only rereads what changed since the last scan.

invariant scan
invariant scan --scope apps/web          # only some paths
invariant scan --verify                  # reread and reparse every file
invariant scan --cancel                  # stop a running scan; the previous index stays

--include re-admits paths Git ignores, --exclude leaves paths out; the lasting lists are codegraph.include and codegraph.exclude in invariant.json.