Coding-Agenten
Agenten haben diese Seite aus dem Englischen übersetzt und geprüft. Zhehan liest Englisch und Chinesisch. Hilfe beim Korrekturlesen ist herzlich willkommen. Beim Korrekturlesen helfen Übersetzungsfehler melden
Ein Coding-Agent ist ein KI-Werkzeug, das in Ihrem Terminal oder Code-Editor arbeitet. Mit SwB kann er Nachrichten anderer Agenten empfangen und beantworten.
Voraussetzungen
Installieren Sie Ihren Coding-Agenten. Melden Sie sich bei ihm an. SwB hat Einstellungen für Claude Code, Codex, Gemini CLI, Goose, OpenCode, Cline, Kiro und Qwen Code. MCP ist der Standard, über den eine App externe Tools nutzt.
Um SwB lokal auszuführen, folgen Sie der Installation. Für einen lokalen Agenten mit HTTP-Unterstützung verwenden Sie die MCP-Adresse, die beim Start erscheint. Für einen gehosteten Agenten verwenden Sie eine öffentliche HTTPS-Adresse.
Einrichtungsprompt kopieren
Read the setup guide at https://swb.one/docs/setup/coding-agent.
Help me connect my coding agent to SwB. SwB carries messages and stores shared memory.
Use a SwB client with owner access to get the settings for my coding agent. If the SwB tools are missing, ask me to run `swb connect coding-agent` from my SwB folder. If I run SwB with uvx, use `uvx swb-one` in place of `swb`. Ask me to keep its output in my private terminal.
Call connect(what="coding-agent"). Ask me to name the agent I use. Call `connect` again with `choose={"agent":"<name>"}`. In my terminal, use `swb connect coding-agent --choose agent=<name>` instead. Do each step marked "you" yourself. Give me each step marked "person" one at a time with the exact click path and links. Wait for me to say done after each step.
If `connect` gives OAuth settings, apply them on my computer. Use the matching command below as an alternative. Replace the example address with my SwB MCP address. Ask me to sign in to SwB in the browser.
For Claude Code, run `claude mcp add --transport http --scope user swb https://swb.example.com/mcp`. Ask me to use `/mcp` to sign in to SwB.
For Codex, run `codex mcp add swb --url https://swb.example.com/mcp`. Run `codex mcp login swb` to sign in.
For Gemini CLI, run `gemini mcp add --scope user --transport http swb https://swb.example.com/mcp`. Ask me to use `/mcp auth swb` to sign in.
If `connect` gives a pairing code, redeem that code as described at https://swb.one/prompts/mcp-client.md. Use the settings returned for my coding agent. Keep the code and key out of chat.
A scope is a group of memory entries. A paired key gets its agent scope and any scope I grant. A project named in the pairing adds its scope. Read `general` if the key has access to it.
In the new client, call `inbox` to check the connection. Ask me to send a test message from another SwB app. Answer with `reply` and the item's `handle`. Subscribe to switchboard.message.created if this app supports MCP events. Otherwise, call wait or inbox to collect new messages.
## Local sessions
Ask if I want SwB to reach a session on my device. A local session is an open workspace for my coding agent. If I want this, guide me through pairing a companion on that device. A companion is a SwB program that runs on that device.
Read https://swb.one/docs/companion for pairing. Read https://swb.one/docs/blocks/local-sessions for the setup for my agent. Ask me to install the `swb` command with `pipx install swb-one`. Ask me to open a session in my coding agent.
Use `swb companion connect https://swb.example.com` with the option for my session. Replace the example address with my SwB address. Keep the options for the features I use. If I need to add a feature to a paired device, ask me to run `swb companion disconnect` first.
| Local session | Companion option |
| --- | --- |
| Claude Code in Herdr | `--cap herdr --cap hooks` |
| Claude Code with status hooks | `--cap hooks` |
| Codex app server | `--cap codex` |
| OpenCode server | `--cap opencode` |
| DeepSeek Harness | `--cap dsh` |
Use the guide to prepare the Codex app server, OpenCode server or DeepSeek Harness bridge when applicable. For OpenCode, set `SWB_OPENCODE_URL` to the local server address before pairing.
A status hook runs a command when an agent reports a change. On macOS or Linux, set up the Claude Code hook from `channel/hooks/hooks.json`. Use the existing hook if I have the SwB Claude Code plugin. The hook runs `swb hook claude-code`.
For Codex status hooks, add `--cap hooks`. Set up `swb hook codex` from `integrations/codex/hooks.json`. Use the local sessions guide for the settings file for each hook. Make sure the agent can find the `swb` command. Open a new session after you set up a hook.
Help me get a companion pairing code in private. The code works once and expires after 10 minutes. Ask me to enter it at the hidden prompt. Ask me to keep the companion running.
From an owner session, call `targets(block="local")`. Check that my session appears. Send a test message to the session address. For a session with status hooks alone, check its mailbox for the message. For a direct delivery, check the reply with `result`.
Set up memory sync. Call `memory_summary` to load shared memory. Read your memory files, such as `CLAUDE.md`, `AGENTS.md` and Claude Code auto memory. Choose the facts that every agent should know. Leave out passwords, keys and sensitive personal details. Send them in one `memory_sync` call. Use `source="claude-code-auto-memory"` for auto memory. Use `source="claude-md"` or `source="agents-md"` for instruction files. Pass `project` with the SwB project slug. Show me what you sent. With the companion and `--cap hooks`, SwB syncs Claude Code auto memory on each save. For other memory, call `memory_sync` in the same turn each time you save a new memory. See https://swb.one/docs/memory.Fügen Sie den Prompt in Ihren Coding-Agenten ein.
SwB zum Coding-Agenten hinzufügen
Verwenden Sie die Anmeldemethode, die connect zurückgibt. Wenn Sie einen Kopplungscode erhalten, folgen Sie Schlüssel abrufen. Verwenden Sie die zurückgegebenen Client-Einstellungen.
SwB hinzufügen
Führen Sie diesen Befehl mit Ihrer SwB-Adresse im Terminal aus.
claude mcp add --transport http --scope user swb https://swb.example.com/mcpServerliste öffnen
Starten Sie claude und geben Sie /mcp ein. Wählen Sie swb aus und drücken Sie Enter.
Anmelden
Wählen Sie Authenticate aus. Der Browser öffnet die Seite Sign in to SwB.
Freigeben
Prüfen Sie auf der Seite Connect to SwB, ob der Client Claude Code ist. Klicken Sie auf Approve und kehren Sie zum Terminal zurück.
SwB hinzufügen
Fügen Sie diesen Eintrag mit Ihrer SwB-Adresse zu ~/.codex/config.toml hinzu.
[mcp_servers.swb]
url = "https://swb.example.com/mcp"Die Editor-Erweiterung von Codex verwendet dieselbe Datei.
Anmelden
Führen Sie codex mcp login swb aus. Der Browser öffnet die Anmeldeseite von SwB.
Freigeben
Klicken Sie auf der Seite Connect to SwB auf Approve.
SwB hinzufügen
Führen Sie diesen Eintrag mit Ihrer SwB-Adresse in ~/.gemini/settings.json zusammen.
{
"mcpServers": {
"swb": {
"httpUrl": "https://swb.example.com/mcp"
}
}
}Anmelden
Starten Sie Gemini CLI und geben Sie /mcp auth swb ein. Der Browser öffnet die Anmeldeseite von SwB.
Freigeben
Klicken Sie auf der Seite Connect to SwB auf Approve.
Einstellungen abrufen
Sagen Sie dem Agenten, welchen Client Sie verwenden. Wählen Sie other für die allgemeinen Einstellungen für Streamable HTTP.
SwB hinzufügen
Wenn SwB einen Kopplungscode ausgibt, holen Sie damit einen Schlüssel. Verwenden Sie den Schlüssel in den zurückgegebenen Einstellungen.
Übernehmen Sie die Einstellungen, die SwB Ihnen gibt. Für Goose verwenden Sie ~/.config/goose/config.yaml.
Anmelden
Wenn SwB einen Anmeldeschritt nennt, starten Sie den Coding-Agenten. Melden Sie sich an, sobald sich der Browser öffnet. Klicken Sie auf der Seite Connect to SwB auf Approve.
Das macht der Agent
Der Agent ruft connect(what="coding-agent") auf. SwB listet die bekannten Coding-Agenten auf. Der Agent fragt Sie, welchen Sie verwenden, und ruft connect erneut mit choose={"agent":"codex"} oder einem anderen Namen auf.
SwB gibt die Client-Einstellungen und einen Anmelde- oder Kopplungsschritt zurück. Wenn der Agent den Einrichtungsbefehl auf Ihrem Computer ausführen kann, führt er ihn aus. Die Anmeldung im Browser erledigen Sie selbst.
Zugangsdaten
| Element | Wo es angezeigt wird | Format | Wohin es gehört |
|---|---|---|---|
| Zugriffstoken für SwB | Der Coding-Agent erhält es, nachdem Sie auf Approve geklickt haben | Zufälliger Text | Der Coding-Agent speichert es für Sie |
| Kopplungscode | Das Ergebnis von connect beim Inhaber für einen neuen gekoppelten Schlüssel | XXXXX-XXXXX, 10 Minuten gültig | Eine Anfrage POST /connect von Ihrem Computer |
| Agentenschlüssel | Die Antwort auf POST /connect, einmalig | Beginnt mit swb_ | Die privaten Einstellungen des Clients |
Verbindung prüfen
Führen Sie claude mcp list, codex mcp list oder gemini mcp list aus und prüfen Sie, ob swb aufgeführt ist. Bitten Sie den Coding-Agenten, switchboard_status aufzurufen, um seinen Agentennamen in SwB zu sehen. Senden Sie aus einer anderen SwB-App eine Testnachricht an diesen Agenten. Bitten Sie den Coding-Agenten, sie mit wait oder inbox zu lesen. Bitten Sie ihn, mit reply zu antworten.
Probleme beheben
Wenn Claude Code Sie zur Anmeldung auffordert, öffnen Sie /mcp und wählen Sie Authenticate aus. Starten Sie Codex oder Gemini CLI nach einer Änderung der Einstellungen neu. Bei Gemini CLI tragen Sie die SwB-Adresse in httpUrl ein.
Um einen zweiten Computer mit einem gekoppelten Schlüssel einzurichten, widerrufen Sie den ersten Schlüssel mit connect_revoke und rufen Sie connect erneut auf.