Claude Multi-Auth Plugin for Claude Code
Run multiple Claude Code subagent instances from a single session, each authenticated with a different auth method (API keys, Bedrock, Vertex, LiteLLM, etc.).
This plugin is for Claude Code users who need to delegate tasks to Claude Code instances that use different authentication backends — without leaving their current session.
What You Get
/cma:setup to manage named auth profiles with per-profile environment variables
/cma:task to delegate work to a subagent using a specific auth profile
/cma:status, /cma:result, and /cma:cancel to manage background tasks
- The
cma:cma-rescue subagent for direct task delegation
Requirements
- Node.js 18.18 or later
@anthropic-ai/claude-agent-sdk — installed automatically when Claude Code runs the plugin
Install
Add the marketplace in Claude Code:
/plugin marketplace add wagnersza/claude-multi-auth
Install the plugin:
/plugin install cma@wagnersza
Reload plugins:
/reload-plugins
Then set up your first profile:
/cma:setup add bedrock --env CLAUDE_CODE_USE_BEDROCK=1 --env AWS_PROFILE=my-aws-profile
After install, you should see:
- the slash commands listed below
- the
cma:cma-rescue subagent in /agents
One simple first run is:
/cma:setup add bedrock --env CLAUDE_CODE_USE_BEDROCK=1 --env AWS_PROFILE=my-aws-profile
/cma:setup test bedrock
/cma:task --profile bedrock summarize the README
Usage
/cma:setup
Manages named auth profiles. Each profile stores environment variables that are injected into the subagent process at runtime.
Profiles are stored in ~/.claude-multi-auth/profiles.json with 0600 permissions.
Add a profile
/cma:setup add bedrock --env CLAUDE_CODE_USE_BEDROCK=1 --env AWS_PROFILE=my-aws-profile
/cma:setup add vertex --env CLAUDE_CODE_USE_VERTEX=1 --env CLOUD_ML_REGION=us-east5
/cma:setup add litellm --env ANTHROPIC_BASE_URL=http://localhost:4000 --env ANTHROPIC_API_KEY=sk-litellm-key
/cma:setup add direct --env ANTHROPIC_API_KEY=sk-ant-...
If you omit --env, the command will interactively ask which environment variables to set.
Common environment variables:
| Variable | Purpose |
|---|
ANTHROPIC_API_KEY | Direct API key authentication |
ANTHROPIC_BASE_URL | Custom API endpoint (LiteLLM, proxy) |
CLAUDE_CODE_USE_BEDROCK | Enable AWS Bedrock backend |
CLAUDE_CODE_SKIP_BEDROCK_AUTH | Skip Bedrock auth check |
AWS_PROFILE | AWS profile for Bedrock |
CLAUDE_CODE_USE_VERTEX | Enable Google Vertex backend |
CLOUD_ML_REGION | Vertex AI region |
ANTHROPIC_DEFAULT_SONNET_MODEL | Override default Sonnet model |
ANTHROPIC_DEFAULT_OPUS_MODEL | Override default Opus model |
ANTHROPIC_DEFAULT_HAIKU_MODEL | Override default Haiku model |
Remove a profile
/cma:setup remove bedrock
Set default profile
/cma:setup default bedrock
Show profile details
/cma:setup show bedrock
Displays the profile configuration with secrets masked.
Test a profile
/cma:setup test bedrock
Sends a quick test message to verify the profile authenticates successfully.
List all profiles
/cma:setup
/cma:task
Delegates a task to a Claude Code subagent using the specified auth profile.
/cma:task --profile bedrock explain the authentication flow in this repo
/cma:task --profile vertex --model claude-sonnet-4-6 summarize the main module
/cma:task --profile litellm --write refactor the utils module
/cma:task --profile bedrock --background analyze the test coverage
/cma:task --profile bedrock --max-turns 5 find unused imports
Options:
| Flag | Description |
|---|
--profile <name>, -p | Auth profile to use (uses default if omitted) |
--model <model>, -m | Override model for the subagent |
--write | Allow the subagent to use write tools (Edit, Write, Bash) |
--background | Run the task in the background |
--max-turns <n> | Limit the number of agentic turns |
Note: Without --write, the subagent runs in read-only mode. It can read files and search the codebase but cannot make changes.
/cma:status
Shows running and recent tasks for the current repository.
/cma:status
/cma:status task-abc123
Use it to:
- check progress on background work
- see the latest completed task
- confirm whether a task is still running
/cma:result
Shows the stored final output for a finished task.
/cma:result
/cma:result task-abc123
/cma:cancel
Cancels an active background task.
/cma:cancel
/cma:cancel task-abc123
Typical Flows
Quick Question with a Different Backend
/cma:task --profile bedrock what does the main function do?
Delegate a Write Task
/cma:task --profile vertex --write add error handling to the API client