# Change an agent

> Describe a change to an agent and let an agent edit its manifest, then check the result with the launch reports before you use it.
>
> Add --sc-agent and your ask to a launch line, and an agent opens on that workspace and makes the change. You need an existing project and agent.

1. Ask an agent to make the change

   ```sh
   sc <project> <agent> --sc-agent "add sc-web and tighten the identity section"
   ```

   `sc` opens the built-in `system/` workspace, where the editing agent runs, with that agent aimed at the workspace you named, instead of launching the agent itself. It reads the agent's manifest (`.claude/superclaude.toml`), runs the reports, tells you what it found, and then makes the change.

2. Check the result

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

   The reports print the assembled prompt, the plugins this launch loads and a conformance verdict, then exit without starting Claude Code.

An agent is defined by its manifest: the identity prose, the order its sections render in, and the plugins it loads. Add a capability by naming a plugin in `plugins = [...]`, not by writing new prose. To try a plugin for one launch, add `--with <plugin>`.

- The flags use the same `<project> <agent>` names as a launch, so you never type the workspace path.
- Without an ask, `--sc-agent` orients itself and waits for you to say what to change.
- To add a new agent instead, see [Add projects and agents](/docs/workspaces).

**What does --sc-agent do before it edits?**

The session starts with an orientation pass that is read-only:

1. It reads the agent's manifest in full.
2. It runs `sc <project> <agent> --prompt --plugins --doctor` against the workspace.
3. It reads the workspace's `CLAUDE.md`, if there is one.

It then reports in a few lines what the agent is, what it loads, and anything the reports flagged. Then it waits. It does not start editing until you say what you want. With no ask on the line, you type it as your first message:

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

An ask after the flag is folded into the opening message. The session then works like this:

- It treats identity as the manifest and capability as plugins. Adding a capability usually means naming an existing plugin in `plugins = [...]`, not writing new prose.
- It gets the manifest grammar live from `sc prompt example` (directly or through the `/superclaude:workspace` skill) rather than from memory, so it follows the binary you have installed.
- It edits the workspace's own manifest. It never edits files under `$SC_PLUGINS`, because `sc system` replaces that tree on its next run.
- It re-runs the reports after every change.

It closes by printing the `--sc-edit` line for the same agent, so you can open the file yourself afterwards.

`--sc-agent` refuses `-i`: the `system/` workspace needs the vault memories and the daemon control token that incognito denies. It also refuses to combine with `--sc-edit`, and it rejects reserved verbs such as `sc system --sc-agent`.


**Change every agent in a project at once**

Name only the project. The agent then works on every agent under it, and the reports switch to `sc doctor <project>` plus a per-agent `--prompt --plugins`.

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

> [!NOTE]
> The second word on the line is always the agent slot. `sc <project> --sc-agent "fix it"` looks for an agent called `fix it` and fails. At project scope, open the session without an ask and type it as your first message.


**Edit the manifest myself**

`--sc-edit` opens the agent's manifest in your editor and exits without launching.

```sh
sc <project> <agent> --sc-edit
```

It opens `.claude/superclaude.toml`. A workspace that predates the manifest and has only a legacy `.claude/system-prompt.md` opens that file instead, because that is what a launch of it reads.

With only a project named, `--sc-edit` opens that project's `main` agent. If there is no `main`, it opens the only agent, and with several agents it stops with an error that lists them, and you add the agent name.

```sh
sc <project> --sc-edit
```

For the annotated reference of every manifest key, run `sc prompt example`, or read [superclaude.toml](/docs/superclaude-toml).


**Edit the machine-wide config or prompt library**

`sc edit` opens the files that belong to no single workspace. It takes no `<project> <agent>`, works from any directory, and has no other targets. A workspace's manifest opens with `--sc-edit`.

| Target | Opens |
|---|---|
| `sc edit config` | `~/.superclaude/config.toml`: vaults, endpoints, profiles, daemon and backup tables |
| `sc edit prompt` | The shared prompt library, as a directory: the path `$SC_PROMPTS` resolves to, by default `~/.superclaude/_global/shared/prompt` |

Bare `sc edit` prints its usage page. The [prompts page](/prompts) publishes every section the shipped library holds. Once you edit `core.toml`, `sc system` stops updating it and says when a newer one is published.

`sc edit` and `--sc-edit` use one editor order:

1. `$SUPERCLAUDE_EDITOR`
2. `zed`, when it is on your `PATH`
3. `$VISUAL`
4. `$EDITOR`

To pin an editor for `sc` without touching your shell's `$EDITOR`, set `SUPERCLAUDE_EDITOR`.

```sh
export SUPERCLAUDE_EDITOR="code --wait"
```

When `$SUPERCLAUDE_EDITOR` is set or Zed is installed, `sc` also exports `$VISUAL` and `$EDITOR` into every session it launches, so an editor Claude Code opens lands in the same place. Otherwise the session inherits your shell's values. When the choice is Zed, the exported value is `zed --wait`, so Claude Code waits for you to finish. `$SUPERCLAUDE_EDITOR` is exported verbatim, so add `--wait` to it yourself if your editor needs it. Your shell's own `$EDITOR` is left alone.


**Check a manifest with sc validate**

`sc validate` renders a manifest across a matrix of model families and reports errors and lint warnings. It reads `.claude/superclaude.toml` from a workspace directory, the current directory by default, or a specific file with `--spf`.

```sh
sc validate <vault>/p/<project>/a/<agent>
sc validate --spf ./candidate.toml
```

A clean manifest prints one line per branch:

```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)
```

A `system_prompt` entry that names no section prints one `ERROR` line per branch, then the summary, and exits 1. The block shows one line, and `<file>` stands for the manifest path:

```text
sc: ERROR  model=claude/default: `<file>`: system_prompt ref `missing` matches no section (available: identity)
```

| Option | Effect |
|---|---|
| `[dir]` | Workspace directory to read (default: the current directory) |
| `--spf <path>` | Validate this manifest or prompt file instead |
| `--model <id>` | Restrict the matrix to one model family, for example `--model claude` |
| `--strict` | Make lint warnings exit non-zero |

The matrix exists because a manifest can gate sections on the model, with `if = { var = "model", contains = "..." }`. A gate can hide a broken reference on one model and expose it on another. A section or plugin directory that does not resolve fails the whole launch, not one entry, and `sc validate` reports it here instead of at launch.

`sc validate` loads plugins the way a launch does. A missing plugin directory fails every branch, and a `<plugin>:<section>` reference resolves against the plugins the manifest names. `--prompt --plugins` shows which directories resolved.


**Check conformance with sc doctor**

`sc doctor` is the conformance linter. Give it a project name to scope it, or nothing to check every workspace in every registered vault. A project name is fuzzy-resolved like a launch. A directory is checked as a single workspace.

```sh
sc doctor <project>
sc doctor <project> --all
sc doctor <project> --json
```

It checks that the manifest exists, that every `plugins = [...]` entry resolves, that `code_repo` points at a real directory, and that no capability arrives outside the manifest and its plugins. Examples are a loose skill under `.claude/skills/`, a hook wired in the workspace's `settings.json`, or a plugin section published to this manifest and never named.

Findings carry one of five severities: `FAIL`, `VIOL`, `WARN`, `NOTE` and `OK`. `OK` rows show only with `--all`. The exit code is 0 unless there is at least one `FAIL`. A `VIOL` is doctrine debt, not a broken launch, and does not change the exit code. There is no `--fix`.


**See what each report selector prints**

The report selectors resolve a launch completely, print a report and exit without starting `claude`. They combine, and always print in the order of this table.

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

| Flag | Prints |
|---|---|
| `--dry-run` | The binary, working directory, resolved environment and the argv `claude` would receive |
| `--prompt` | The assembled system prompt with the file and section each part came from, the `CLAUDE.md` chain, and which sections were available but unused |
| `--plugins` | Each plugin this launch resolved and the directory it resolved to, then the vendored plugins this launch does not load |
| `--doctor` | The `sc doctor` checks for this one workspace; always exits 0 |
| `--json` | The requested reports as one JSON document. On its own it implies `--prompt` |

The unused-sections part of `--prompt` matters most after an edit. A section a plugin publishes renders nothing until the manifest names it, and nothing else warns about it. `sc prompt --debug` prints the same table from inside a workspace directory.

`--json` works with `--prompt` and `--doctor`. Combining it with `--dry-run` or `--plugins` is an error. The JSON includes the full text of every part. To drop it:

```sh
sc <project> <agent> --json | jq 'del(.prompt.sources.chunks[].text)'
```

The selectors are long-form only; there are no short spellings.

> [!WARNING]
> Every selector still performs the launch's other side effects, including starting the daemon and gateway. Under `-i`, the reports describe the sandboxed launch.


**Try a change without touching the original**

`--spf <path>` launches an agent against a different manifest, in the same working directory. The whole manifest follows, `plugins = [...]` included, so `--spf` serves as an A/B switch for both prompts and plugin sets. A relative path resolves against the directory you run `sc` from.

Copy the manifest, change the copy, and compare the two:

```sh
cp <vault>/p/<project>/a/<agent>/.claude/superclaude.toml ./candidate.toml
sc validate --spf ./candidate.toml
sc <project> <agent> --prompt
sc <project> <agent> --spf ./candidate.toml --prompt
sc <project> <agent> --spf ./candidate.toml
```

The last line runs a real session on the candidate. When it behaves the way you want, copy the candidate over the original manifest, or apply the same change with `--sc-edit`.

To A/B one plugin rather than a whole manifest, use `--with <plugin>` and `--without <plugin>` on the launch line. Both apply to that launch only. `--with` delivers a plugin's skills, agents, hooks and MCP servers. `--without` drops a plugin the manifest declares.

```sh
sc <project> <agent> --without sc-web --plugins
sc <project> <agent> --with sc-frontend
```

See the [command reference](/docs/cli) for every launch flag.

+++
