Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

providers-claude.md

236 lines7.6 KB

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## Reduce Context Usage
38​
39In Settings, open your Claude provider and set **Auto-compact after** to a token count between
40`100000` and `1000000`. For example, `300000` compacts the conversation into a summary once it
41reaches about 300,000 tokens, without changing the model's context window. Leave the field
42empty to keep Claude Code's default behavior.
43​
44On web and desktop, when you return to an older Claude thread with a large context, T3 Code
45offers to compact the conversation before you continue. You can also select **Compact context**
46from the context meter. On every client, you can enter `/compact` in the message composer, and
47Claude can show its own resume prompt when you continue an old session.
48​
49## Where Claude Skills Are Loaded
50​
51T3 Code looks for Claude skills in the Claude config directory's `skills` folder and
52`<workspace>/.claude/skills`, the two places Claude Code loads them from.
53​
54If the same skill name exists in more than one folder, the one in the Claude config directory
55wins, the same way Claude Code resolves it.
56​
57A skill set to `off` in Claude Code's `skillOverrides` is left out of both composer menus. A skill
58marked `disable-model-invocation` still appears, because you start it yourself when you pick it.
59Claude Code runs one skill per message; when a message names several, the last one runs directly and
60Claude starts the others through its Skill tool, which refuses skills marked
61`disable-model-invocation`.
62​
63## I Want Work And Personal Claude Accounts
64​
65Use a different Claude config directory for each account.
66​
67Example:
68​
69```text
70default config dir work account
71~/.claude_personal_home personal account
72```
73​
74### Set Up The First Account
75​
76Log in normally:
77​
78```bash
79claude auth login
80```
81​
82In T3 Code Settings:
83​
84```text
85Display name: Claude Work
86Binary path: claude
87CLAUDE_CONFIG_DIR path: empty
88```
89​
90### Set Up The Second Account
91​
92Log in with a separate config directory:
93​
94```bash
95mkdir -p ~/.claude_personal_home
96CLAUDE_CONFIG_DIR=~/.claude_personal_home claude auth login
97```
98​
99Use `CLAUDE_CONFIG_DIR`, not `HOME`. Setting `HOME` writes the login to
100`~/.claude_personal_home/.claude`, which is not where T3 Code looks.
101​
102Then add another Claude provider in T3 Code:
103​
104```text
105Display name: Claude Personal
106Binary path: claude
107CLAUDE_CONFIG_DIR path: ~/.claude_personal_home
108```
109​
110Use the email shown in Settings to confirm each provider is using the intended account. Emails are
111blurred by default; click the blurred email to reveal it.
112​
113## Can I Switch Claude Accounts In An Existing Thread?
114​
115Usually, no.
116​
117T3 Code only offers Claude providers that use the same config directory for an existing thread. A
118different config directory is treated as a different Claude environment.
119​
120This is different from the recommended Codex setup. Claude Code keeps account and local state across
121multiple files under its config directory, so T3 Code keeps separate config directories isolated
122instead of trying to share part of the state.
123​
124## I Want To Use OpenRouter
125​
126Use this when you want Claude Code to talk to OpenRouter directly, without running a local router.
127This is the simplest external-provider setup.
128​
129OpenRouter provides a Claude Code integration through Claude's Anthropic-compatible environment
130variables.
131​
132### Configure A Claude OpenRouter Provider
133​
134Add or edit a Claude provider in T3 Code Settings:
135​
136```text
137Display name: Claude OpenRouter
138Binary path: claude
139CLAUDE_CONFIG_DIR path: ~/.claude_openrouter_home
140```
141​
142In that provider's Environment variables section, add:
143​
144```text
145ANTHROPIC_BASE_URL https://openrouter.ai/api
146ANTHROPIC_AUTH_TOKEN sk-or-... Sensitive
147ANTHROPIC_API_KEY Empty value
148```
149​
150Mark `ANTHROPIC_AUTH_TOKEN` as sensitive. T3 Code stores the value as a server secret and does not
151send it back to the app after saving.
152​
153If you want this setup isolated from your normal Claude account, create that home first:
154​
155```bash
156mkdir -p ~/.claude_openrouter_home
157```
158​
159If you previously used the same Claude home with a normal Anthropic login, run `/logout` in a Claude
160Code session for that home before using OpenRouter. Otherwise Claude Code may keep using cached
161Anthropic credentials instead of the OpenRouter token.
162​
163### Pick OpenRouter Models
164​
165OpenRouter can route Claude Code's default model roles to OpenRouter model IDs.
166​
167Example:
168​
169```text
170ANTHROPIC_DEFAULT_OPUS_MODEL anthropic/claude-opus-4.6
171ANTHROPIC_DEFAULT_SONNET_MODEL anthropic/claude-sonnet-4.6
172ANTHROPIC_DEFAULT_HAIKU_MODEL anthropic/claude-haiku-4.5
173CLAUDE_CODE_SUBAGENT_MODEL anthropic/claude-sonnet-4.6
174```
175​
176Add those to the same provider's Environment variables section if you want stable model choices.
177​
178### Verify OpenRouter Is Being Used
179​
180Open a Claude session and run:
181​
182```text
183/status
184```
185​
186You should see the Anthropic base URL set to:
187​
188```text
189https://openrouter.ai/api
190```
191​
192You can also check the OpenRouter activity dashboard for requests from your API key.
193​
194### Common OpenRouter Mistakes
195​
196- Use `https://openrouter.ai/api`, not `https://openrouter.ai/api/v1`, for Claude Code.
197- Set `ANTHROPIC_AUTH_TOKEN` to your OpenRouter API key.
198- Set `ANTHROPIC_API_KEY` to an empty string so Claude Code does not try to use an Anthropic login.
199- Put these variables on the Claude provider instance, not in global shell startup files.
200​
201OpenRouter's setup can change over time. Use its upstream Claude Code guide for the current details:
202<https://openrouter.ai/docs/guides/guides/claude-code-integration>.
203​
204## I Want To Use Claude Code Router
205​
206Claude Code Router is useful when you want a local routing layer with more control than a direct
207OpenRouter setup.
208​
209T3 Code does not need a special Claude Code Router provider. Treat the router as a Claude
210environment: give a Claude provider its own `CLAUDE_CONFIG_DIR path`, and put whatever variables
211the router tells you to export into that provider's Environment variables section. Mark tokens
212and API keys as sensitive.
213​
214```text
215Display name: Claude Router
216Binary path: claude
217CLAUDE_CONFIG_DIR path: ~/.claude_router_home
218```
219​
220Follow the upstream project's README for the router's own install, startup, and configuration
221steps: <https://github.com/musistudio/claude-code-router>.
222​
223## I Want Different Claude Settings, Not A Different Account
224​
225Create another Claude provider with the same account if you want a named preset.
226​
227Examples:
228​
229- "Claude Default"
230- "Claude Router"
231- "Claude Experimental"
232​
233If the preset needs different Claude files, give it a different `CLAUDE_CONFIG_DIR path`. If it needs
234different API keys, base URLs, or router settings, use Environment variables.
235​
236Do not put environment variable assignments in `Launch arguments`.