Superego

Profiles

A profile is what an agent is: a folder with a profile.ts, and the files it names.

Where Whose Runs
~/.superego/profiles/<name>/ yours, for every folder on this machine always
<source>/profiles/<name>/ yours, from an installed profile source always
<project>/.superego/profiles/<name>/ the project's, for threads in it and below (up to its repository's top) once allowed

A thread takes its profile when it starts and keeps it. Without -P, it gets default: the project's, else yours, else none. A project's profile replaces yours of the same name, unless it extends it.

superego profile new support           # .superego/profiles/support/profile.ts here, allowed
superego profile new --user            # ~/.superego/profiles/default
superego profile types                 # types for this project's existing profiles (--user: yours)
superego -P support -p "Order 1234?"   # a thread with it

profile.ts

import { defineProfile } from 'superego'

export default defineProfile({
  description: 'Answers customer mail',              // shown where a profile is picked
  model: 'anthropic/claude-sonnet-4-5',              // provider/model; else the machine's default
  thinking: 'medium',
  // agent: 'claude-agent',                          // another kind of agent, for its threads' whole life
  prompt: 'You answer customer email for Acme. Be brief.',
  extensions: ['./orders.ts'],                       // daemon side
  ui: ['./ui/order.tsx'],                            // window side: defineUiExtension modules
  panes: {                                           // pane kinds its UI adds, told to the agent for pane_open
    order: 'an order, with its lines and status. Params: { id }',
  },
  without: ['agent-ui'],                             // optional extensions to leave out
  options: { worktrees: true },                      // what its threads ask extensions for, by name
  extends: 'user:default',                           // start from your profile of that name, and add to it
  // global: true,                                   // yours only: part of the app, not only of its threads
  mcpServers: [                                      // the mcp-servers extension's key
    'linear',                                        // the machine's, by name
    { docs: { command: 'node', args: ['./tools/docs-mcp.js'], auth: { type: 'env', names: ['DOCS_TOKEN'] } } },  // its own
  ],
})

Every field is optional and no other is taken: a misspelt key fails the type check. One that loads anyway (a key no extension reads, a without naming no extension) is reported on the profile's card (its name in the title bar) and in profile.list's problems.

Field
prompt the agent's instructions, after its extensions' prompt sections. With extends, the two are joined
extensions paths from the profile's folder. Each default-exports an agent part, defineExtension({ name, tools, sections }) (tools), or a daemon half, defineDaemonExtension({ name, setup(superego) { … } }) (daemon)
ui window modules (ui), drawn only in this profile's threads unless it's global
panes each pane kind its UI registers, with its params, so the agent can open one
without optional extensions (Settings → Extensions, superego extensions) its threads go without: the core's coding-tools (read, write, edit, bash), panes (pane_open) and agents-md; bundled ones such as skills, thread-tools (thread-tools.md), agent-ui, terminal, mcp-servers. No tools, prompt sections or UI of theirs. Required ones (the sidebar) can't be left out
options what its threads ask extensions for, as thread.start's options (a thread's own win): { worktrees: true } gives each a git worktree. Not for threads they start (thread-tools.md)
model, thinking apply where a thread hasn't chosen its own
agent another kind of agent (an extension's superego.agentKind), fixed for each thread's life; see Claude Agent
extends 'user:<name>': start from your profile of that name
global yours only: see Global profiles

Extensions' keys. A bundled extension can add a key (superego.profileKey, daemon.md); defineProfile's type lists them. It checks the value as the profile loads (a problem fails the load) and merges it over extends.

mcpServers (the mcp-servers extension's) lists the MCP servers its threads use:

Imports. Profile files are TypeScript (types stripped on load) or JavaScript. They may import each other, Node's built-ins (node:fs/promises) and 'superego' (and 'superego/ui', 'react' in UI modules). There's no npm install: a package or a package.json # alias imported by name is refused, and the profile doesn't load. A file imported by path is fine wherever it is (node_modules too), and counts toward what's allowed.

Global profiles

global: true makes one of your own profiles part of the app:

Notes and Canvas are global profiles. A project's profile can't be global (its problems say so), and a profile extending a global one isn't, unless it says so itself.

A non-global profile of yours can still add a sidebar from its daemon half: a data view (superego.view, context: 'window') that fits sidebar, shown while the profile is loaded. A project's can't.

Types

profile new and extension new give a profile what an editor needs; superego profile types [name] gives it to existing ones (all of this project's, the one named, or yours with --user), and again after a fresh clone:

File
tsconfig.json strict, JSX for React, Node's and the DOM's types. Nothing machine-specific: commit it. One you changed is left alone
node_modules a link to ~/.superego/types/node_modules: declarations for superego, superego/ui, superego/unstable, superego/testing, React, Node and vitest, refreshed as the app starts
.gitignore node_modules

The daemon doesn't load packages from node_modules. The tsconfig.json counts toward a project profile's allowance (so profile types allows again one that was allowed); node_modules and .gitignore don't. superego extension test type-checks with the same tsconfig.

What 'superego' exports

import {
  defineProfile,                                     // profile.ts
  defineExtension, defineTool, section,              // agent parts
  wrapTool, wrapSection, hook,                       // decorating other extensions' tools and sections
  defineDaemonExtension, defineAction, RpcError, spawnGroup,   // daemon halves (`runs: 'machine'` is implied)
  obj, str, num, int, bool, arr, opt, lit, union, nullable, unknown,   // JSON Schema for parameters
} from 'superego'

Profile sources

Keep your profiles in a repo or folder of their own and install it as a source. Its profiles are its profiles/<name>/profile.ts.

superego profile install git:github.com/mikker/superego-profiles   # clone it (an https:// URL works too); again: no change
superego profile install ~/dev/superego-profiles                    # a folder, read in place
superego profile install git:github.com/acme/profiles@v1.2          # pinned: a tag, branch or commit
superego profile sources                                            # each source, its state and its profiles
superego profile update [source]                                    # git pull --ff-only (pinned ones stay)
superego profile remove <source>                                    # drop it; a git one's clone is deleted

Allowing

A project's profile runs that repository's code, so the daemon refuses it until it's allowed, and again whenever any file it runs changes: any file in its folder (node_modules and dotfiles aside), and every file its code imports, wherever it is.

superego profile allow support     # in the project

profile new allows what it scaffolds; allow again after editing. Your own profiles are never asked about.

Allowing is the user's consent, never an agent's: from a thread's shell, profile allow and allow-ui are refused, and profile new and extension new leave a project's profile waiting. Tell the user to allow it in the window (where its thread asks, or Settings → Profiles) or in their own terminal.

Another machine's profile UI is asked about on this computer too, since it runs in the window with reach to every machine: once for exactly the sources received, again after any change. Allow it from the notice in one of its threads, or:

superego profile allow-ui default -m box     # as it is now; a name, or the profile's folder there
superego profile revoke-ui default -m box    # Settings → Machines lists them too, with Revoke

When changes apply

Claude Agent

agent: 'claude-agent' (experimental) runs the user's own Claude Code, signed in with its own /login.

claudeAgent: { permissionMode, settingSources, allowedTools, disallowedTools, model, effort }:

Key
permissionMode default, acceptEdits, plan, auto or bypassPermissions; unset: the machine's (Settings → Claude Agent; auto by default)
settingSources Claude Code's user, project, local: narrows what it loads, never adding a folder's not allowed
allowedTools, disallowedTools Claude Code's tool lists
model, effort an alias or id; low … max. Apply where a thread didn't pick its own

An example

examples/build-queue-ui is complete: a tool, a scoped value per thread, a Cancel action, a view beside the thread, and tests.

A minimal one with a tool:

// .superego/profiles/support/profile.ts
import { defineProfile } from 'superego'
export default defineProfile({ prompt: 'Answer customers. Look orders up before answering.', extensions: ['./orders.ts'] })
// .superego/profiles/support/orders.ts
import { defineExtension, defineTool, obj, str } from 'superego'

export default defineExtension({
  name: 'orders',
  tools: [defineTool({
    name: 'find_order',
    description: 'Find an order by its number.',
    parameters: obj({ number: str() }),
    async execute({ number }) {
      const order = await fetch(`https://acme.example/orders/${number}`).then((r) => r.json())
      return { output: [{ type: 'text', text: JSON.stringify(order) }] }
    },
  })],
})

packages/cli/skill/profiles.md