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:
- A string names one of the machine's (Settings → MCP servers); an unknown name is left out.
- An object defines the profile's own by name: a
command(withargs,cwd, plainenv) or aurl(withheaders), andauth:oauth,api-key, or secretenvnames. Names: lower-case letters, digits and hyphens, up to 24. One named like a machine's replaces it here. - A command runs in the project's root (its
cwddefault), only once the profile is allowed; changing it means allowing again. Secrets and OAuth: Settings → MCP servers → From profiles, orsuperego mcp-servers set-secret/sign-in. Never in the file. - With
extendsthe lists add up, this profile's winning by name. Read each turn; a machine without the extension, or a profilewithoutit, runs none. - The thread's header says which it has (
3 servers) and why any were left out; so doessuperego mcp-servers --thread <id>.
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:
- the daemon loads it at start, and its daemon halves run for the daemon's life;
- the window installs its UI as the app's: views in any place (a sidebar in the rail), slots and tool rows in every thread, styles window-wide;
- it can add spaces, views that fill the main area with a thread docked beside them (window).
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
- Git sources are cloned to
~/.superego/sources/<host>/<owner>/<repo>. - Their profiles are yours: they run without being allowed. Installing a source is trusting its code, so an agent can't install one for the user.
extends: 'user:<name>',-P <name> --userandprofile types --userfind them like any of yours.- Lookup order:
~/.superego/profiles, then each source in install order. The first of a name wins; the other is reported as shadowed (superego profile,profile sources, Settings → Profiles). - The list is
~/.superego/profile-sources.json({ "sources": [...] }); edits are read again, andprofile updateclones a listed git source that isn't cloned yet. - Edits (or a pull) apply from each thread's next turn.
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
- A thread keeps the profile it started with. A profile made after a thread started (your first
default, a project's new one) never reaches it, the thread that wrote it included: say so. Start a new thread, or move an idle one onto it:superego do thread.setProfile --thread <thread> --profile <name>(refused while it's working). - The daemon loads a profile when a thread with it takes a turn, and again after its files change: edit, then send the
thread a message (a run in progress keeps what it started with).
superego extension reloadloads it now and says why if it can't. Daemon halves are torn down (their cleanup runs) and set up again. - The window loads a profile's UI as soon as it lists one of its threads, and again when a shown thread of it moves on after a change (ui.md).
Claude Agent
agent: 'claude-agent' (experimental) runs the user's own Claude Code, signed in with its own /login.
- Picking a Claude Agent model (
claude-agent/opus,sonnet,haiku, whereclaudeis installed) starts a thread on the user'sclaudeprofile,{ agent: 'claude-agent' }, made then if missing. - Superego's model doesn't apply. Its thread, pane, question, UI, image and task tools reach Claude Code over MCP, and
the profile's
promptis appended to Claude Code's. - It loads the user's Claude Code settings. A folder's (
.claude/,.mcp.json,CLAUDE.md,CLAUDE.local.mdand what they import, plus skills in.claude/skillsbelow it) load only once the user allowed them as they are, since they run commands: the thread asks (Allow, over its message box), and again after they change. From a terminal:superego do claude-agent.allow --cwd "$PWD". Where another user could write a folder above (a shared/tmp), they can't be allowed.
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) }] }
},
})],
})