claude-code - 💡(How to fix) Fix Feature request: Per-project account switching for claude.ai subscription users [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52793Fetched 2026-04-25 06:20:47
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
1
Participants
Timeline (top)
labeled ×2

Support configuring different claude.ai subscription accounts on a per-project basis, similar to how apiKeyHelper works for API key users.

Error Message

  • Manual /login switching — error-prone and disruptive to workflow

Root Cause

Support configuring different claude.ai subscription accounts on a per-project basis, similar to how apiKeyHelper works for API key users.

Code Example

{
  "account": "[email protected]"
}
RAW_BUFFERClick to expand / collapse

Summary

Support configuring different claude.ai subscription accounts on a per-project basis, similar to how apiKeyHelper works for API key users.

Use case

Many users have both a personal claude.ai subscription and a company subscription. Today, switching between accounts requires manually running /login every time you switch projects. There is no way to bind a specific account to a project directory.

Example scenario: A developer has:

  • Personal claude.ai account for personal/open-source projects
  • Company claude.ai account (e.g. tied to their work email) for work projects

They want ~/Code/work-project to always use the company account and all other projects to use the personal account — without manual /login switching.

Proposed solution

Allow a project-level setting in .claude/settings.json to specify which logged-in account to use:

{
  "account": "[email protected]"
}

Claude Code would:

  1. Keep multiple authenticated sessions (already partially supported via /login)
  2. Check the project-level account setting when launching in a directory
  3. Automatically activate the matching session — or prompt the user to log in with that account if not yet authenticated

Alternatives considered

  • apiKeyHelper — only works for API key users, not subscription users
  • Manual /login switching — error-prone and disruptive to workflow
  • direnv + ANTHROPIC_API_KEY — not applicable to subscription auth

Additional context

This is a common workflow in tools like git (per-repo user config), aws-vault (per-profile credentials), and gcloud (per-project configurations).

extent analysis

TL;DR

Implement a project-level setting in .claude/settings.json to specify the claude.ai account to use for each project.

Guidance

  • Add an "account" field to the .claude/settings.json file in each project directory to specify the desired claude.ai account.
  • Update the Claude Code to check this setting when launching in a directory and automatically activate the matching authenticated session.
  • If the specified account is not yet authenticated, prompt the user to log in with that account.
  • Consider implementing a fallback mechanism to handle cases where the specified account is not found or the user is not authenticated.

Example

{
  "account": "[email protected]"
}

This example shows how to specify a claude.ai account in the .claude/settings.json file.

Notes

This solution assumes that the Claude Code already supports multiple authenticated sessions via the /login command. Additional development may be required to fully implement this feature.

Recommendation

Apply the proposed solution by implementing the project-level setting in .claude/settings.json and updating the Claude Code to support automatic account switching based on this setting. This will provide a more seamless experience for users with multiple claude.ai accounts.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Feature request: Per-project account switching for claude.ai subscription users [1 participants]