Claude Code Enterprise Account Migration: CI Still on Old Billing? 2026 Troubleshooting
A successful interactive /login does not prove that CI has switched credentials or billing accounts. Keep the old automation credential, or configure the approved Enterprise credential, until a real pipeline run confirms the credential source and the organization’s usage records.
This guide is for IT and platform teams migrating Claude Code users from Console or API authentication to an Enterprise organization. Security and FinOps teams can use it to verify usage attribution before retiring keys.
Last updated November 15, 2026; checked against the official migration guide, Claude Code authentication documentation, and enterprise network configuration guidance. A specific pipeline’s credential source and charge attribution still require evidence from that pipeline and the organization’s usage records.
Start with the billing signal, not the login screen
A charge or usage record that appears unchanged after migration is a signal to investigate, not proof that the migration failed. CI may still be reading an old API key, a token from a different environment, or a credential supplied by a settings file. Conversely, a developer signing in to the Enterprise organization interactively does not establish which credential an automated process reads.
Start with the run that produced the unexpected usage. Record its job identifier, timestamp, repository or workflow, runner, Claude Code invocation, and the location where the job receives credentials. Save relevant usage or billing evidence from the organization’s available records. Do not copy secret values into tickets, screenshots, or logs.
Keep these questions separate:
- What authenticated the process? Identify the credential source the running CI process actually read.
- Which organization recorded the usage? Verify this against the available organization usage records; do not infer it from a developer’s terminal.
- Did the job use the intended configuration? Compare the run’s environment and settings with the configuration expected by the pipeline.
The official migration guidance distinguishes interactive sign-in from CI and other automation credentials. It also warns that credentials left in environment variables or settings can affect authentication. Apply that distinction to the pipeline rather than assuming a user migration automatically updates every automation job. See the Console-to-Enterprise migration instructions.
Interactive sign-in and CI credentials are different paths
Can CI switch Enterprise accounts through interactive /login?
No. A job running non-interactively cannot complete a human sign-in flow just because an administrator or developer has used /login in a terminal. Interactive authentication and automation authentication are separate paths. The official authentication documentation describes the supported authentication context; use the migration guide for the Enterprise-specific transition.
A local terminal can therefore show the expected Enterprise account while a CI job continues using a Console API key. The two processes may have different shells, environment variables, home directories, settings files, or secret-injection rules.
| Authentication path | Where to check | What counts as useful evidence |
|---|---|---|
| Developer’s interactive session | Terminal account and local user settings | A successful sign-in confirms that session, not the CI job |
| CI automation credential | Job environment, injected secret reference, and settings available to the job | A redacted configuration capture plus evidence from the actual run |
| Enterprise organization access | Organization provisioning and administrator controls | Confirmation that the organization has enabled the required access |
| Usage attribution | Organization’s available usage records, matched to the run | A traceable run and corresponding usage evidence; not a local login screen |
Which migration path fits the pipeline?
Use this decision branch before changing secrets:
- If the existing Console credential is still authorized for this automation and its continued use is deliberate, keep it temporarily, document its owner and rotation plan, and verify usage attribution. Do not describe that as an Enterprise credential migration.
- If the team is migrating a developer’s interactive session only, migrate that user according to the official instructions, but leave CI acceptance open until the automation path is separately verified.
- If CI must use Enterprise credentials, confirm the required organization and account state in the official migration instructions, then configure the documented automation credential in the CI secret store and pass it to the process that launches Claude Code.
- If nobody can identify which source the job reads, do not revoke either candidate credential. Trace the runtime environment first.
This avoids a common operational mistake: treating “the login worked” as evidence that every pipeline is now using the intended organization.
Trace overrides from the running process outward
A newly added secret may not be the value the job uses. The process can inherit variables from a runner, receive a secret at job or step scope, or read user-level or repository-level settings. An apiKeyHelper or a configured base URL can also affect the authentication route. The official environment variable reference and authentication guidance are the references for supported variables and behavior; do not infer a universal precedence order from the name of a CI secret.
| Item to inspect | Why it matters | Safe evidence to collect |
|---|---|---|
CLAUDE_CODE_OAUTH_TOKEN |
An inherited token can differ from the credential expected by the migration plan | Whether it is set in the job process; redact its value |
ANTHROPIC_API_KEY |
A Console/API key may remain injected after a user’s interactive migration | Secret reference name, scope, and rotation owner |
ANTHROPIC_AUTH_TOKEN |
Another authentication input may be present in the environment | Presence or absence and the source that injects it |
ANTHROPIC_BASE_URL |
A custom endpoint or proxy route can change where requests go | Redacted endpoint configuration and network path |
apiKeyHelper |
A settings-based helper may provide credentials at runtime | Relevant settings entry and helper execution result, with output redacted |
| User and repository settings | Different home directories or checkout paths can load different configuration | File path, effective non-secret settings, and the job’s working directory |
How do you check competing CLAUDE_CODE_OAUTH_TOKEN and ANTHROPIC_API_KEY values?
Inspect the environment of the same process context that runs Claude Code. Checking a developer shell or a separate diagnostic step is not sufficient if the actual job has a different container, user, working directory, or secret scope.
Use a redacted diagnostic that reveals only whether a variable is present, not its value. For example:
for name in CLAUDE_CODE_OAUTH_TOKEN ANTHROPIC_API_KEY \
ANTHROPIC_AUTH_TOKEN ANTHROPIC_BASE_URL; do
if printenv "$name" >/dev/null 2>&1; then
printf '%s is set\n' "$name"
else
printf '%s is not set\n' "$name"
fi
done
This output does not establish which credential Claude Code accepted. It only records what the diagnostic process can see. Capture settings paths and non-secret configuration separately, then use supported diagnostic output and the actual job result to confirm the authentication path. Review the official troubleshooting guidance if authentication still fails.
Never print a token to “prove” that CI received it. Record the variable name, secret reference, scope, and whether it was present. Redact diagnostic output before sharing it.
A useful evidence bundle contains the run identifier, runner identity, command and working directory, redacted variable-presence output, relevant settings paths, and the resulting authentication error or success. Store it with restricted access. Avoid enabling verbose logs in a way that could expose credentials.
Separate rejected credentials from access and network failures
A CI authentication error can have more than one cause. Treating every rejection as an expired key can lead to unnecessary rotation; broadening permissions can hide the real fault without resolving it.
Check these layers independently:
- Organization access: Confirm that the account and organization are in the state required by the official migration process, and that administrators have enabled the relevant Claude Code access. A developer’s successful sign-in does not prove that the CI credential is authorized.
- Credential validity: Confirm that the intended credential is still valid and that the pipeline’s secret reference points to the expected secret version. Do not test by pasting its value into a shell command or log.
- Process visibility: Confirm that the Claude Code process—not merely a preparation step—receives the intended variable or settings.
- Network route: Check whether the runner uses a proxy, custom certificate authority, or restricted egress path. Compare the runner’s configuration with the enterprise network configuration documentation.
- Failure details: Compare the sanitized error and relevant request or connection evidence with the user FAQ and official authentication troubleshooting guidance.
Do not treat a proxy or SSO connectivity problem as proof that a credential is invalid. Likewise, a network connection that succeeds does not prove the organization authorized the credential. The evidence must match the layer being tested.
For billing questions, compare a traceable pipeline run with the organization’s available usage records. The official models, usage, and limits guidance can help interpret usage behavior, but it cannot identify the credential injected into a particular job. That requires runtime evidence from the job and the organization’s records.
Retire the old key only after a real pipeline run
A migration is not complete when a secret is renamed or an interactive session changes accounts. It is complete for a given workflow only when the team can show what the workflow read and verify the resulting use against the expected organization records.
Use this sequence:
- Choose a representative workflow. Select a real CI job that invokes Claude Code and uses the same runner type, secret scope, and settings path as the affected pipeline.
- Document the current credential path. Record the secret reference, variable names present, settings locations, helper configuration, and responsible owner. Keep values redacted.
- Configure the intended path. If the job must use Enterprise credentials, follow the official migration requirements and inject the approved credential through the CI secret mechanism. Do not substitute a developer’s interactive SSO ticket.
- Run the job without removing the rollback path. Capture the job result and sanitized authentication evidence. Keep the old credential available to the authorized rollback process while the new path is being validated.
- Match the run to organization evidence. Confirm that the intended organization’s available usage records show activity consistent with the test. If the evidence is missing or ambiguous, pause key retirement and investigate.
- Approve retirement and retain ownership. Have the credential owner and the team responsible for usage attribution agree on the evidence, rotation or revocation timing, and rollback condition. Then remove or rotate the old credential according to internal controls.
A green job alone is not enough for a billing migration. The acceptance record should connect the job, the credential source, and the organization’s usage evidence.
Use the following decision conditions:
- If the process sees the intended credential, the job succeeds, and the expected organization records support the attribution, schedule the old key’s controlled retirement.
- If the job succeeds but the usage evidence is inconclusive, keep the old key under restricted access and resolve attribution before declaring the migration complete.
- If the job fails and the failure points to network access or organization authorization, fix that layer before rotating credentials or expanding permissions.
- If the process still sees an old credential or helper, correct the injection or settings source, rerun the same workflow, and preserve the existing rollback route until the rerun is verified.
Choose the CI host separately from the credential design
Moving a pipeline to a different Mac host does not, by itself, change which Claude Code credential the process reads. The same environment-variable, settings, secret-scope, and organization checks apply whether CI runs on an existing machine or another Mac environment.
If the current setup depends on a developer’s Mac, it can leave build capacity tied to that machine and its maintenance owner. If a shared host is used, teams still need clear ownership of secrets, access, patching, and incident response. A remote Mac rental can be worth evaluating when the constraint is access to a managed Mac execution environment rather than authentication design. It is not a fix for stale credentials, unclear billing attribution, or an unverified Enterprise configuration.
Before selecting that option, compare the existing runner’s operational gaps with the published SFTPMAC service information and Mac rental pricing details. Confirm the actual access method, environment boundaries, and delivery terms against current published information. If the team already has suitable Mac capacity, stable ownership, and controlled access, retaining it may be the simpler choice. If the constraint is procurement or maintaining another Mac host, rental may offer a more suitable way to evaluate remote capacity without purchasing hardware first.
The decision is therefore two separate checks: prove which credential CI reads, then decide whether the current Mac execution environment meets the team’s operational needs.