Feature: when login choose anthropic workspace
Status Open
Maintainer reply ✓ Yes — bcherny
Workaround ✓ Mentioned in thread ↓
Activity 15 comments · opened Mar 19, 2025
💡 Likely answer: A maintainer (bcherny, collaborator)
responded on this thread — see the highlighted reply below.
Inside https://console.anthropic.com/settings/workspaces/ in my organization we have created different workspaces for each use case.
Unfortunately, when using in Claude Code /login it is always adding the user automatically into "Claude Code" workspace and creating a key automatically in this workspace.
As an alternative I tried to use the key as environment variable ANTHROPIC_API_KEY but this only works when using claude -p
When /login I would like to have control of which anthropic workspace the key will be created.
15 Comments
Hey! Curious, why can't you use the Claude Code workspace?
@bcherny it is a large company and we want to rollout the tool but we want to maintain control of the cost. We see that we can control and add cost limits per workspace. Our idea is to control/limit per use cases or departments inside our organization.
Plus one for the above, per workspace cost control is awesome, but it needs the ability for custom workspace for each Claude code instance for it to work in more nuanced cost control scenarios
Hi, any progress on this?
It will be very helpful to have specific cost/budget limit available in per workspace while using Claude Code
This would be helpful for us as well. I want to have different groups of engineers in different workspaces so that I can have finer grain control over the max spend for each group.
Ideally I'd like to be able to grant developers within a workspace/group access to create API keys and Claude /login only the workspace they belong to. Fallback is to manually generate API keys for them and have them set
ANTHROPIC_API_KEYlocally which ends up showing a big ol warning.we need this as well, as it's stopping us from a broader release in the organization.
Must have for use to continue to use it.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
still relevant
this is still a problem. i can't switch API keys and I have multiple workspaces.
it's crazy that this trivial problem has not been solved for almost a year!
I built a workaround for this: Claude Workspace Switcher
It lets you create isolated profiles with separate
CLAUDE_CONFIG_DIRdirectories - each with its own API key from a specific Console workspace. You can also mix OAuth and API key profiles.Works as a solution until/if Claude Code natively supports choosing a workspace at login.
I'm on the novice side of developer compared to most people here (more of an analyst), but I still see a lot of value in this enhancement. Very often I want to continue a project into a new "branch" (or folder), and when I login to claude in that new folder, I don't have any conversation history. Sometimes I'd like to copy conversation history to a new workspace and begin a different history with it, etc. I appreciate @swedishdeveloper 's workaround, but an official functionality would be nice.
@VincentGW that's not what workspace means in this context. Please read the above.
How about attaching the API key to the workspace and then doing the following?
The system detects the environment custom key. And we can choose "Yes" to use that for the session.