Chapter 08
How each agent is written
Where each agent's prompt goes, which files its adapter touches, and what turning off and cleaning up put back.
Deploys and turn-offs are written by each agent’s open-source adapter; emptying memory files during cleanup and the setting input rewrite changes are written by Switch itself, see How it works. This is how the current versions behave (adapter versions are pinned to the app). Switch deploys user-level settings only and never writes into a project folder.
Claude Code · claude-keysmith 7.2
-
Prompt: written to
~/.claude/keysmith/and imported by a marked block in~/.claude/CLAUDE.md:<!-- claude-keysmith:start name=claude-project-rules --> @keysmith/claude-project-rules.md <!-- claude-keysmith:end name=claude-project-rules -->Everything outside the markers (your own rules) is left alone.
-
Turn off: removes only that block and Keysmith’s prompt file.
-
Clean up: can empty
CLAUDE.md(after you tick a box) and saves/removesrules,agents,commands,hooks,skillsandoutput-styles; deletes sessions, plugins, caches and the login in the system keychain. -
The adapter never touches: the Claude Code program, network settings, credentials, MCP configuration or running processes.
-
Input rewrite: changes only
env.ANTHROPIC_BASE_URLinsettings.json; Bedrock and Vertex aren’t supported.
Codex · codex-keysmith 0.6.0
- Prompt: placed in
~/.codex/, withmodel_instructions_filewritten toconfig.toml.config.tomlis backed up first. - Hooks: a
hooks.jsonthat could interfere with loading the instructions is set aside, with a timestamped backup. - Turn off: removes the managed line and the prompt file, and restores the hooks.
- Clean up: can empty
~/.codex/AGENTS.md(after you tick a box); thememoriesfolder needs its own checkbox and Codex must be closed.config.tomlstays. - Input rewrite: adds
[model_providers.keysmith-relay], a copy of your provider with onlybase_urlchanged; needs a custom provider (wire_api = "responses").
Grok Build · grok-keysmith 0.7.0
- Prompt: written to
~/.grok/rules/99-keysmith.md. These home rules are read by every Grok session, independent ofAGENTS.mdand any persona card. - Compat layers: a block marked
# === grok-keysmith compat isolation begin/end ===inconfig.tomlturns off the Claude / Cursor compatibility layers, and~/.grok/hooks/*.jsonare set aside so they can’t interfere. - Turn off: removes only the file and block it wrote; if the pre-deploy config backup is gone, choose “Keep current config and turn off”.
- Input rewrite’s region: the part between
# === keysmith-switch input rewrite ===markers belongs to Switch. The adapter never writes inside it and keeps it through deploys, turn-offs, tidying and recovery. - Input rewrite: Grok must have run once and fetched its model list.
ZCode · zcode-keysmith 0.3.2
- Prompt: written to
~/.zcode-keysmith/system-role.mdand applied as a true system role, ahead of ZCode’s own system prompt. - Newer ZCode (3.12 and later): ZCode’s
zcode.cjsis backed up, then patched to read the file above first, and restored when turned off. - Environment variables: set by a LaunchAgent on macOS and as user variables on Windows. The previous values (including
NODE_OPTIONS) are recorded first and put back when turned off. - No recovery: the ZCode adapter has no interrupted-run recovery.
- Input rewrite: changes
baseUrlof each personal provider in~/.zcode/v2/provider_config.json; Coding Plan sign-in isn’t supported.
Adapter source
All four adapters are MIT-licensed and also work on their own from the command line: