Open History to see the last commit
1# Claude
2
3This guide is for people who want to use more than one Claude setup in T3 Code. For Codex, see
4[Codex](./providers-codex.md). For first-time setup, see [Install T3 Code](./install.md).
5
6Common reasons:
7
8- use separate work and personal Claude accounts
9- try a different Claude Code configuration without disturbing your main setup
10- run Claude through a router such as Claude Code Router
11- use external providers exposed through a Claude-compatible workflow
12
13## I Only Use One Claude Account
14
15Use the default provider.
16
17Log in with Claude Code normally:
18
19```bash
20claude auth login
21```
22
23In T3 Code Settings, your Claude provider can stay like this:
24
25```text
26Display name: Claude
27Binary path: claude
28CLAUDE_CONFIG_DIR path: empty
29```
30
31An empty `CLAUDE_CONFIG_DIR path` means T3 Code uses Claude Code's normal config directory.
32
33When you set this field, T3 Code points Claude Code at that directory with the
34`CLAUDE_CONFIG_DIR` environment variable. It does not change `HOME`, so your system keychain and
35the rest of your environment stay as they are.
36
37## I Want Work And Personal Claude Accounts
38
39Use a different Claude config directory for each account.
40
41Example:
42
43```text
44default config dir work account
45~/.claude_personal_home personal account
46```
47
48### Set Up The First Account
49
50Log in normally:
51
52```bash
53claude auth login
54```
55
56In T3 Code Settings:
57
58```text
59Display name: Claude Work
60Binary path: claude
61CLAUDE_CONFIG_DIR path: empty
62```
63
64### Set Up The Second Account
65
66Log in with a separate config directory:
67
68```bash
69mkdir -p ~/.claude_personal_home
70CLAUDE_CONFIG_DIR=~/.claude_personal_home claude auth login
71```
72
73Use `CLAUDE_CONFIG_DIR`, not `HOME`. Setting `HOME` writes the login to
74`~/.claude_personal_home/.claude`, which is not where T3 Code looks.
75
76Then add another Claude provider in T3 Code:
77
78```text
79Display name: Claude Personal
80Binary path: claude
81CLAUDE_CONFIG_DIR path: ~/.claude_personal_home
82```
83
84Use the email shown in Settings to confirm each provider is using the intended account. Emails are
85blurred by default; click the blurred email to reveal it.
86
87## Can I Switch Claude Accounts In An Existing Thread?
88
89Usually, no.
90
91T3 Code only offers Claude providers that use the same config directory for an existing thread. A
92different config directory is treated as a different Claude environment.
93
94This is different from the recommended Codex setup. Claude Code keeps account and local state across
95multiple files under its config directory, so T3 Code keeps separate config directories isolated
96instead of trying to share part of the state.
97
98## I Want To Use OpenRouter
99
100Use this when you want Claude Code to talk to OpenRouter directly, without running a local router.
101This is the simplest external-provider setup.
102
103OpenRouter provides a Claude Code integration through Claude's Anthropic-compatible environment
104variables.
105
106### Configure A Claude OpenRouter Provider
107
108Add or edit a Claude provider in T3 Code Settings:
109
110```text
111Display name: Claude OpenRouter
112Binary path: claude
113CLAUDE_CONFIG_DIR path: ~/.claude_openrouter_home
114```
115
116In that provider's Environment variables section, add:
117
118```text
119ANTHROPIC_BASE_URL https://openrouter.ai/api
120ANTHROPIC_AUTH_TOKEN sk-or-... Sensitive
121ANTHROPIC_API_KEY Empty value
122```
123
124Mark `ANTHROPIC_AUTH_TOKEN` as sensitive. T3 Code stores the value as a server secret and does not
125send it back to the app after saving.
126
127If you want this setup isolated from your normal Claude account, create that home first:
128
129```bash
130mkdir -p ~/.claude_openrouter_home
131```
132
133If you previously used the same Claude home with a normal Anthropic login, run `/logout` in a Claude
134Code session for that home before using OpenRouter. Otherwise Claude Code may keep using cached
135Anthropic credentials instead of the OpenRouter token.
136
137### Pick OpenRouter Models
138
139OpenRouter can route Claude Code's default model roles to OpenRouter model IDs.
140
141Example:
142
143```text
144ANTHROPIC_DEFAULT_OPUS_MODEL anthropic/claude-opus-4.6
145ANTHROPIC_DEFAULT_SONNET_MODEL anthropic/claude-sonnet-4.6
146ANTHROPIC_DEFAULT_HAIKU_MODEL anthropic/claude-haiku-4.5
147CLAUDE_CODE_SUBAGENT_MODEL anthropic/claude-sonnet-4.6
148```
149
150Add those to the same provider's Environment variables section if you want stable model choices.
151
152### Verify OpenRouter Is Being Used
153
154Open a Claude session and run:
155
156```text
157/status
158```
159
160You should see the Anthropic base URL set to:
161
162```text
163https://openrouter.ai/api
164```
165
166You can also check the OpenRouter activity dashboard for requests from your API key.
167
168### Common OpenRouter Mistakes
169
170- Use `https://openrouter.ai/api`, not `https://openrouter.ai/api/v1`, for Claude Code.
171- Set `ANTHROPIC_AUTH_TOKEN` to your OpenRouter API key.
172- Set `ANTHROPIC_API_KEY` to an empty string so Claude Code does not try to use an Anthropic login.
173- Put these variables on the Claude provider instance, not in global shell startup files.
174
175OpenRouter's setup can change over time. Use its upstream Claude Code guide for the current details:
176<https://openrouter.ai/docs/guides/guides/claude-code-integration>.
177
178## I Want To Use Claude Code Router
179
180Claude Code Router is useful when you want a local routing layer with more control than a direct
181OpenRouter setup.
182
183T3 Code does not need a special Claude Code Router provider. Treat the router as a Claude
184environment: give a Claude provider its own `CLAUDE_CONFIG_DIR path`, and put whatever variables
185the router tells you to export into that provider's Environment variables section. Mark tokens
186and API keys as sensitive.
187
188```text
189Display name: Claude Router
190Binary path: claude
191CLAUDE_CONFIG_DIR path: ~/.claude_router_home
192```
193
194Follow the upstream project's README for the router's own install, startup, and configuration
195steps: <https://github.com/musistudio/claude-code-router>.
196
197## I Want Different Claude Settings, Not A Different Account
198
199Create another Claude provider with the same account if you want a named preset.
200
201Examples:
202
203- "Claude Default"
204- "Claude Router"
205- "Claude Experimental"
206
207If the preset needs different Claude files, give it a different `CLAUDE_CONFIG_DIR path`. If it needs
208different API keys, base URLs, or router settings, use Environment variables.
209
210Do not put environment variable assignments in `Launch arguments`.