Superego

Start here

Superego runs agents. A daemon on each machine keeps them running while the app is closed; the app (desktop, browser or phone) and the superego command are both clients of that daemon. What an agent is (model, prompt, tools, UI) comes from a profile: files in ~/.superego/profiles/<name>/ or in a project's .superego/profiles/<name>/.

machine   a daemon (this computer, or one reached over ssh)
└─ project  a git repository (and its worktrees) or a folder, on that machine
   └─ thread  one conversation with an agent, in the folder or a worktree of its own
      └─ pane   a view beside the thread: a diff, a file, a web page, a profile's own

Everything the app does is an action with an id (thread.start, pane.open, vault.graph). The command line, the window, keyboard shortcuts and extensions all run actions. superego actions lists what a machine offers.

What to read for a task

Each topic fits in one read: superego --skill <topic>, or the file beside this one.

To… Read
give an agent a tool or a prompt section tools.md
add a pane beside the thread guide.md, then ui.md
show a view with no UI code (blocks from the daemon) window.md
put a mark on threads in the sidebar ui.md, with daemon.md
draw a board of threads ui.md
add an action, a shortcut or a live value daemon.md, the cheat sheet
test it guide.md, tools.md
write a profile profiles.md
hand work to other threads, or write a lead profile thread-tools.md
act as a thread starts, ends a run or is archived lifecycle.md
find out why it doesn't load or show debugging.md

Extending Superego: start with extension new

To give agents a tool, or the window a pane or a mark, scaffold a working extension in the shape of the job and change it. Don't start from a blank file.

No Node needed. superego extension test is the type checker and the test runner. Don't look for node, npx, tsc or bun: plain Node can't import superego.

superego extension new orders           # an agent tool, in this project's default profile (.superego/profiles/default), made if there's none
superego extension new orders --ui      # a pane, UI half only (ui.tsx)
superego extension new orders --badge   # a mark in the sidebar: a daemon half sets a thread's fact, a UI half draws it
superego extension new orders --tool --ui   # an agent tool, and a pane of what it did
superego extension new orders --user    # in your own profile (~/.superego/profiles/default), for every folder
superego extension test orders          # check its types and run its tests
superego extension reload               # load the profile's changes now, and say why if it doesn't load
superego extensions                     # every extension here: where it's from, how it stands, what it registered

Each says which profile it uses. superego <command> --help gives any command's options.

new writes <profile>/orders/: the smallest working extension of that shape, with its version and api, a test on superego/testing that passes as made, and a README; and it gives the profile its types. Then:

Quick reference

superego                          # start a thread here and open it in the app
superego start . -p "fix tests"  # start one without the app; prints its id
superego send <thread> "and the docs" && superego read <thread> --wait   # its answer, once it stops working
superego threads --json           # every thread, with its status
superego actions                  # what `superego do` can run
superego mcp                      # those exposed to outside agents, as an MCP server on stdio (cli topic)
superego do thread.rename --thread <thread> --title "Fix the tests"
superego profile new [name]       # .superego/profiles/<name>/profile.ts, in this project, with types for an editor
superego daemon restart           # onto the installed code

Where to read more

This is the overview. Each topic is a file beside this one (guide.md, ui.md, …), also printed by superego --skill <topic>:

Topic Read it when
guide building an extension: the big picture, one end to end, the build-queue examples (examples/ beside it), testing
cheatsheet looking up what either half of an extension can register, a line each
window placing views (sidebars, beside the thread, the pane menu, the header), spaces, data-only views, links, window events
lifecycle teardown and what needs cleaning up, a thread's hooks (starting, archived, …), versions and compatibility
cli starting and scripting threads, machines, settings, actions, the daemon
profiles writing profile.ts: model, prompt, extensions, panes, allowing, extends, when changes apply
tools giving an agent tools and prompt sections (defineExtension, defineTool, section)
thread-tools an agent that starts, reads, messages and archives threads: parameters, reports, worktrees, a lead profile
daemon an extension's daemon half: actions, live values, a thread's blocked status, reaching threads
ui an extension's UI half: panes, slots, tool renderers, reading threads, hooks and components from superego/ui
bundled working on Superego itself: a bundled extension in extensions/, tests, typecheck
debugging something doesn't load, run or show up

Read only the topics the task needs. A profile with a tool needs profiles and tools; one with a pane needs profiles, daemon and ui.

Ground rules

packages/cli/skill/SKILL.md