Feature: when login choose anthropic workspace

Status Open
Maintainer reply ✓ Yes — bcherny
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.

View original on GitHub ↗

15 Comments

bcherny collaborator · 1 year ago

Hey! Curious, why can't you use the Claude Code workspace?

fredysierra · 1 year ago

@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.

joelybahh · 1 year ago

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

deepakcv · 1 year ago

Hi, any progress on this?

It will be very helpful to have specific cost/budget limit available in per workspace while using Claude Code

iknowcss-invenco · 1 year ago

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_KEY locally which ends up showing a big ol warning.

jotka · 11 months ago

we need this as well, as it's stopping us from a broader release in the organization.

arvenom · 9 months ago

Must have for use to continue to use it.

github-actions[bot] · 8 months ago

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.

seebi · 8 months ago

still relevant

nzeigler-ac · 7 months ago

this is still a problem. i can't switch API keys and I have multiple workspaces.

marton78 · 7 months ago

it's crazy that this trivial problem has not been solved for almost a year!

swedishdeveloper · 6 months ago

I built a workaround for this: Claude Workspace Switcher

It lets you create isolated profiles with separate CLAUDE_CONFIG_DIR directories - each with its own API key from a specific Console workspace. You can also mix OAuth and API key profiles.

brew install swedishdeveloper/claude-workspace-switcher/cw

cw add work
cw login work
cw use work

Works as a solution until/if Claude Code natively supports choosing a workspace at login.

VincentGW · 6 months ago

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.

marton78 · 6 months ago

@VincentGW that's not what workspace means in this context. Please read the above.

indrajra · 6 months ago

How about attaching the API key to the workspace and then doing the following?

export ANTHROPIC_API_KEY = sk-ant-... claude

The system detects the environment custom key. And we can choose "Yes" to use that for the session.