# superclaude.toml

> The workspace manifest reference. Every key in .claude/superclaude.toml, how sections assemble into the system prompt, and how to check a manifest with sc prompt and sc validate.
>
> The manifest, .claude/superclaude.toml, sets an agent's identity. Start from sc prompt example and check every edit with sc validate before you launch.

The manifest (`.claude/superclaude.toml`) is the file in each [workspace](/docs/concepts) that sets the agent's identity: the prompt sections it renders, the plugins it loads and the built-in tools it removes.

| Command | What it does |
|---|---|
| `sc prompt example` | Print a commented reference manifest: a working baseline, plus every optional field commented out with a one-line explanation. Needs no workspace. |
| `sc validate` | Render the manifest once per model family and report errors and lints. Run it from the workspace directory. |
| `sc prompt` | Print the exact `--system-prompt` string the workspace renders. Add `--debug` for the section-utilization table. |

| Key | Type | What it does |
|---|---|---|
| `code_repo` | string or array | Where the source code lives, if not in the workspace directory |
| `import` | array of tables | Pull named sections from a shared section library |
| `system_prompt` | array | The sections of the main agent's prompt, in order |
| `subagent_system_prompt` | array | Sections appended to every subagent's prompt |
| `plugins` | array of paths | Plugin directories to load |
| `[vars]` | table | Your own variables for `template` sections and `if` gates |
| `[section.<name>]` | table | Prompt text, as `content` or `template` |
| `[harness]` | table | Tools, subagent types and skills to remove |

> [!WARNING]
> Root keys (`code_repo`, `import`, `system_prompt`, `subagent_system_prompt`, `plugins`) must come before the first `[table]` header. In TOML, a key written after `[harness]` or `[section.x]` belongs to that table, not to the root.

[The shared system prompt](/docs/system-prompt) walks through composing `import` and `system_prompt`, and lists every section in `core.toml`.

**Copy a complete manifest**

This manifest validates as written. Its imports come from the shared library, `$SC_PROMPTS/core.toml`, which `sc system` installs (see [Install the library](/docs/system-prompt#install-the-library)). Copy it to `.claude/superclaude.toml` in a workspace and edit the identity.

```toml
code_repo = "~/code/billing-api"

import = [
  { from = "$SC_PROMPTS/core.toml", use = ["communication", "git_policy"] },
]

system_prompt = [
  "identity",
  "communication",
  "git_policy",
  { ref = "open_weights_note", if = { var = "model", contains = ["qwen", "glm", "kimi"] } },
]

subagent_system_prompt = [
  "return_data",
]

plugins = [
  "$SC_PLUGINS/sc-memory",
]

[vars]
service = "billing-api"

[harness]
remove_tools = ["WebSearch"]
remove_agents = ["Explore"]

[section.identity]
template = """
<identity>
You are the {{agent}} agent of project {{project}}. You own the {{service}} service
in {{code_repo}}. You do not change infrastructure.
</identity>
"""

[section.open_weights_note]
content = """
Keep tool calls sequential. Confirm a file exists before you edit it.
"""

[section.return_data]
content = """
Return findings as data: paths, line numbers, and commands. No narrative.
"""
```

**See what sc passes to Claude Code**

At launch, `sc` reads the manifest and turns it into Claude Code arguments:

| Manifest key | Becomes | Effect |
|---|---|---|
| `system_prompt` | `--system-prompt` | Replaces Claude Code's default system prompt |
| `subagent_system_prompt` | `--append-subagent-system-prompt` | Appended to every subagent's own prompt |
| `plugins` | one `--plugin-dir` per entry | Loads skills, subagents, hooks and MCP servers |
| `[harness]` | `permissions.deny` rules in the injected `--settings` | Removes tools and subagent types from the model's list |

The manifest carries identity. Capability ships in plugins (see [Features](/features)). Keep prose about who the agent is in the manifest, and put skills, hooks and MCP servers in a plugin. If a workspace has no `superclaude.toml` but has a legacy `.claude/system-prompt.md`, `sc` uses that file verbatim; when both exist, the toml wins.

**Point the workspace at its code**

`code_repo` points at a separate git repository that holds this workspace's code. The `WorktreeCreate` hook uses it to provision git worktrees, which land at `../worktrees` relative to the repo by default; `sc worktree` lists and prunes them. The value must be absolute or start with `~/`; a `$VAR/...` path variable also works. `sc doctor` reports a `code_repo` that does not resolve to a directory.

Every declared path that exists is granted to the session with `--add-dir`, and the system prompt gets a short block saying where the project's code lives. You do not need `{{code_repo}}` anywhere for that.

A workspace that spans several repos writes an array:

```toml
code_repo = ["~/projects/app", "~/projects/app-lib"]
```

The first entry is the primary: worktree fan-out uses it, and `{{code_repo}}` resolves to it. `sc doctor` checks every entry. A manifest can move between the two shapes without touching a template.

`code_repo` joins the variable namespace, so a `template` section can print it as `{{code_repo}}`. Any other top-level string scalar does the same.

**Reuse sections from a shared library**

Each `import` entry names a library file and the sections to take from it. A `use` entry can rename a section on the way in, which settles a clash when two libraries define the same name:

```toml
import = [
  { from = "$SC_PROMPTS/core.toml", use = ["git_policy", { name = "communication", as = "core_communication" }] },
]
```

Importing a section does not render it. It only makes the name available to `system_prompt`. An `if` inside an import entry is a parse error. Put gates on the `system_prompt` entry instead.

An import whose file is missing fails to render with ``cannot open `<path>`: No such file or directory``. If `core.toml` is missing, see [Install the library](/docs/system-prompt#install-the-library).

**Choose what the prompt renders**

`system_prompt` is the assembly order. `sc` renders each entry and joins them with a blank line. A file with `system_prompt` is a leaf, which you can launch. A file without one is a section library, and `sc validate` refuses it.

| Entry | Meaning |
|---|---|
| `"identity"` | A section reference. Same as `{ ref = "identity" }` |
| `{ ref = "<section>", if = { ... } }` | A reference with a gate. Rendered only when the gate matches |
| `{ from = "<path>", if = { ... } }` | Spread: render every section of a content file, in document order |
| `{ include = "<path>", if = { ... } }` | Include: render a preset's own `system_prompt` at this point |

`if` is optional on all three table forms. A spread target must have no `system_prompt` and no `import` of its own. An include target must have a `system_prompt`. Includes nest up to three levels, and a cycle is an error.

A reference can also name a section a plugin publishes, written `<namespace>:<section>`. See 'Use the sections a plugin publishes' below.

**Give every subagent extra rules**

`subagent_system_prompt` uses the same entry grammar as `system_prompt`. The difference is what happens to the result:

- `system_prompt` replaces Claude Code's default prompt for the main agent.
- `subagent_system_prompt` is appended to each subagent's own prompt. The subagent keeps its definition's prompt.

It reaches every subagent the session spawns: one from the Agent tool, one a skill starts, one a plugin hook starts. It never reaches the main agent. Write additive rules here, not an identity. A section can appear in both lists.

Plugin `inject` prose is not added here. Name a plugin section in this list to give it to subagents.

Omit the key and `sc` passes no flag. A file with `subagent_system_prompt` but no `system_prompt` is an error.

**Load plugins**

`plugins` lists plugin directories. Each resolves to a path and becomes one `--plugin-dir` argument. A plain entry whose directory does not exist fails the launch. Write `{ optional = "<path>" }` to load a plugin only when its directory exists, and skip it otherwise.

```toml
plugins = [
  "$SC_PLUGINS/sc-memory",
  { optional = "$SC_VAULT_PLUGINS/billing-tools" },
]
```

`plugins` is read from the root leaf only. A preset reached by `include` cannot add plugins. To load one more plugin for a single launch without editing the manifest, use `--with <plugin>`. To drop one, use `--without <plugin>`.

**Write a path that works on any machine**

These prefixes work anywhere the manifest takes a path: `import`, `code_repo`, a spread `from`, an `include`, and `plugins`.

| Variable | Resolves to | Use it for |
|---|---|---|
| `$SC_PROMPTS` | `<profiles home>/_global/shared/prompt` | The shared section library, `core.toml` |
| `$SC_PLUGINS` | `<profiles home>/plugins` | The vendored plugins. `sc system` replaces this tree on every run, so never edit under it |
| `$SC_VAULT_PLUGINS` | `<vault>/plugins` | Plugins you author for one vault. Vendoring never touches it |

The profiles home is `~/.superclaude/` by default. A path without a prefix is either absolute or relative to the manifest's own directory. See [How it fits together](/docs/concepts) for the profiles home and the vault, and [Add projects and agents](/docs/workspaces) for authoring a vault plugin.

**Write a prompt section**

A `[section.<name>]` table holds prompt text. It has exactly one body key:

| Key | Behaviour |
|---|---|
| `content` | Literal text, never interpolated |
| `template` | Text with `{{name}}` placeholders, filled from the variable namespace |

A section cannot carry `if`; gate the `system_prompt` entry that names it. A section name cannot contain `:`, which is reserved for plugin namespaces. Defining a section does not render it: only the lists decide what renders.

```toml
[section.identity]
template = """
You are the {{agent}} agent. Work in {{code_repo}}.
"""

[section.style]
content = """
Use {{braces}} literally here; content is never interpolated.
"""
```

**Use the built-in variables**

| Variable | Value |
|---|---|
| `model` | The routed model slug on a [gateway](/docs/gateways) launch, else the `--model` value, else `claude/default` |
| `project` | The project name from the `p/<project>/a/<agent>` path |
| `agent` | The agent name from that path |
| `workspace_dir` | The workspace directory |
| `vault` | The current vault path, from `$SUPERCLAUDE_VAULT` |
| `git_sha`, `git_branch` | Present only when a `.git` is found walking up from the workspace |

**Add my own variables**

`[vars]` adds your own variables. A value is a literal string, an environment variable, or a file's contents:

```toml
[vars]
service = "billing-api"
ticket_prefix = { from_env = "TICKET_PREFIX" }
style_guide = { from_file = "style.md" }
```

A `from_file` path is relative to the manifest's directory. Defining a name twice is an error, whether the clash is with a built-in, a top-level scalar, or another `[vars]` entry. `sc validate` warns when a literal contains `{{`, since placeholders only expand in a `template`.

**Render a section only for some models**

A gate renders a `system_prompt` entry only when a variable matches. Gating on `model` lets one manifest render different sections per provider. A gate is `{ var = "<name>", contains = ... }` or `{ var = "<name>", not_contains = ... }`, with exactly one operator. The value is a substring or a list of substrings, matched as OR:

```toml
system_prompt = [
  "identity",
  { ref = "deepseek_note", if = { var = "model", contains = "deepseek" } },
  { ref = "claude_only", if = { var = "model", not_contains = ["qwen", "glm", "kimi"] } },
]
```

A gate can only read a built-in, a top-level scalar, or a literal `[vars]` value. `from_env` and `from_file` variables are not allowed inside `if`.

**Remove tools, subagent types or skills**

`[harness]` removes capability from the session. It is the inverse of `plugins`.

| Key | Compiles to | Effect |
|---|---|---|
| `remove_tools` | `<Tool>` deny rule | The tool leaves the model's tool list. `*` globs work, for example `mcp__exa__*` |
| `remove_agents` | `Agent(<type>)` deny rule | The subagent type leaves the Agent tool's schema |
| `remove_skills` | `Skill(<name>)` deny rule | Reject-only: the skill stays listed and its invocation is refused |

```toml
[harness]
remove_tools = ["WebSearch"]
remove_agents = ["Explore"]
```

Write bare names. A qualified entry such as `Bash(rm:*)` is a parse error, because a qualified rule only rejects a call and never removes the tool. To remove a skill outright, stop loading the plugin that ships it.

Removals union across the manifest graph. A preset reached by `include`, a library reached by `import`, and a plugin's `plugin.toml` can each contribute removals, and a gated-out include contributes none. Each removal records the file or plugin that asked for it.

**Use the sections a plugin publishes**

A plugin can publish prompt sections in a `plugin.toml` at its root. Listing the plugin in `plugins` makes its sections available as `<namespace>:<section>`, with no import. Every published section is on [Prompts](/prompts#plugins).

Each plugin lists in `inject = [...]` the sections that are its own prose. Those render in the main prompt of every workspace that loads the plugin, after your own `system_prompt` and in `plugins` order, each with its own `if` gate. This holds for an authored workspace, for the `system/` workspace that `sc system` opens, and for a plugin added with `--with <plugin>`. Loading the plugin is enough, so do not list injected sections in `system_prompt`. `sc doctor` notes such a line as `redundant-plugin-prose`.

Name an injected section yourself only to pin where it renders or to give it a different gate. Your entry wins, and the injected copy is dropped. Any other section a plugin publishes renders only where `system_prompt` names it:

```toml
plugins = ["$SC_PLUGINS/sc-memory"]

system_prompt = [
  "identity",
  "sc-memory:memory_protocol",
]
```

- A plugin's `plugin.toml` is a section library: `[section.*]` bodies only, with no `system_prompt`, no `import` and no `plugins`.
- The namespace is the `name` in the plugin's `.claude-plugin/plugin.json`, else its directory name. Two plugins with the same namespace are an error.
- `sc doctor` reports `dead-plugin-prose` when a plugin publishes a section that is not in its `inject` list and the manifest never names, because that text renders nowhere.
- A plugin's `plugin.toml` can also declare `[harness]` removals.

**Check what CLAUDE.md adds**

`sc` controls the system prompt, not the `CLAUDE.md` files Claude Code finds on its own. A stray `CLAUDE.md` in an ancestor directory still reaches the model.

The model reads two things at the start of a session:

1. The system prompt `sc` assembled from the manifest.
2. Every `CLAUDE.md` Claude Code finds by walking up from its working directory. In each directory it checks `CLAUDE.md`, then `.claude/CLAUDE.md`, then `CLAUDE.local.md`. `~/.claude/CLAUDE.md` is added to every session.

```sh
sc <project> <agent> --prompt
sc doctor
```

`--prompt` prints the assembled prompt with the file and section behind each part, then the `CLAUDE.md` chain, then the sections that went unused. `sc doctor` flags a `CLAUDE.md`, `.claude/CLAUDE.md` or `CLAUDE.local.md` in the workspace itself (`claude-md`) and the global one (`global-claude-md`).

**Preview a prompt with sc prompt**

```sh
sc prompt
sc prompt --model qwen/x
sc prompt --var service=ledger
sc prompt --debug
sc prompt --spf ./candidate.toml
```

| Flag | Effect |
|---|---|
| `[dir]` | Workspace to read. Default: the current directory |
| `--model <id>` | Render as if launched with this model, which drives `model` gates |
| `--var k=v` | Set a variable for the preview. Repeatable. Overrides any value |
| `--trace` | Show how each section was assembled |
| `--debug` | Append the section-utilization table |
| `--spf <path>` | Render a different manifest or flat prompt file |

The `--debug` table marks each section `[used]` (named and rendered), `[inject]` (rendered by its plugin's `inject` list), `[gated]` (its `if` is off for this render) or `[UNUSED]` (never named, not injected). For the complete example above, rendered for a Claude model, `sc prompt --debug` appends a table of this shape:

```text
# ── debug: section utilization ──
# legend: [used] named + rendered · [inject] rendered by its plugin's `inject` list · [gated] `if` off this run · [UNUSED] never named, not injected (dead)
# import core.toml (2/2 used, 0 dead):
#   [used  ] communication
#   [used  ] git_policy
# local (1/3 used, 1 dead):
#   [used  ] identity
#   [gated ] open_weights_note
#   [UNUSED] return_data
# plugin sc-memory (2/3 used, 0 dead):
#   [gated ] sc-memory:memory_explicit  (inject)
#   [inject] sc-memory:memory_hub
#   [inject] sc-memory:memory_protocol
```

The table counts `system_prompt` only, so a section named only in `subagent_system_prompt`, like `return_data` here, shows as `[UNUSED]`. The `sc-memory` rows are sections that plugin injects. `memory_explicit` is gated because its `if` fires only for deepseek, qwen, glm and kimi models.

**Read what sc validate prints**

```sh
sc validate
sc validate --spf ~/.superclaude/personal/p/<project>/a/<agent>/.claude/superclaude.toml
sc validate --model qwen/x
sc validate --strict
```

```text
OK     model=claude/default
OK     model=deepseek/x
OK     model=qwen/x
OK     model=glm/x
OK     model=kimi/x
OK     model=minimax/x

summary: 6 branch(es), 0 error(s), 0 warning(s)
```

`--model` narrows the matrix to one model. `--strict` turns warnings into a non-zero exit. A gate that is wrong for one provider shows up as an `ERROR` on that branch only. `sc validate` loads plugins, so a `<namespace>:<section>` reference resolves the same way it does in `sc prompt`.

For editing a manifest in place and the launch-time report flags, see [Change an agent](/docs/editing-agents).

**Set up messaging, a cheatsheet or teammates**

Three more tables are not prompt content. The launcher skips them, and `sc doctor` reports one that is invalid.

- `[messaging]` sets who this agent may start a conversation with. Inside an `sc` session the model's `SendMessage` and `ListAgents` are answered by `sc`'s own message store, addressed by workspace id. A session's own subagents and its main agent are always reachable, and replies are always allowed. Everything else needs an entry in `allow`. The daemon enforces it on every send. It guards against an agent's mistakes and is not a security boundary, because the agent can edit its own manifest.
- `[cheatsheet]` tells a newcomer what the setup offers, which matters most for a workspace you share. The band above a fresh interactive session's prompt shows a rotating four of its entries until the first prompt is sent, and `/cheatsheet` prints them all. It lives in the manifest because a share packs the manifest and leaves a sibling file behind.
- `[teammates]` caps how many background `sc` sessions this workspace may start per parent session. `max` is an integer from 0 to 16, and 0 switches spawning off. The default is 4. A value outside the range, or not an integer, is ignored: the daemon keeps the default and warns.

```toml
[messaging]
allow = ["<project>/<agent>", "<project>/*"]

[cheatsheet]
items = [
  { run = "share this setup with Sam", does = "send it to someone: a link plus a code" },
  "describe the bug and paste the log",
]

[teammates]
max = 4
```

| `allow` entry | Reaches |
|---|---|
| `"<project>/<agent>"` | An agent in this vault |
| `"<vault>/<project>/<agent>"` | An agent in another vault |
| `"<project>/*"` | Every agent of a project |
| `"*"` | Every agent in this vault |
| `"system"` | The flat `sc system` workspace |
| `"<address>@<node>"` | An agent on another machine, held until federation exists |

A `[cheatsheet]` has 1 to 20 `items`, and a twenty-first is an error. An item is a plain line of at most 100 characters, or a `run` (the command as typed, at most 60 characters) with `does` (what it does, at most 120). Name only what the workspace loads. Control characters are stripped before the text reaches a terminal. Omit `[messaging]`, or leave `allow` empty, for the default: own subagents and own main agent only.

**What the manifest does not hold**

No hook writes to the manifest. You own the whole file.

- Worktree state. Older manifests carried a `[[worktrees]]` block. The parser ignores it, so delete it when you see one. `git worktree list` is the source of truth.
- Settings. `sc vault new <name>` writes no `settings.json` for the workspace it scaffolds. Tool removal belongs in `[harness]`.
- Unknown top-level tables are tolerated and ignored, so a plugin or tool can keep its own table in the manifest without breaking the render. Unknown keys inside `[section.*]`, `[harness]`, an `import` entry, a `system_prompt` entry or an `if` are errors.
