Skip to content

[BUG] Auth conflict between ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY after running claude logout #115

@GratefulDave

Description

@GratefulDave

Describe the bug
When launching claudish, the CLI throws an Auth conflict error stating that both an API key and an Auth token are set. This happens even immediately after running claude logout.

To Reproduce
Steps to reproduce the behavior:

  1. Configure ~/.claudish/settings.json to route Anthropic models to external providers (DeepSeek V4 in this case).
  2. Run claude logout in the terminal to clear authentication.
  3. Run claudish.
  4. See the following error:
⚠Auth conflict: Both a token (ANTHROPIC_AUTH_TOKEN) and an API key (ANTHROPIC_API_KEY) are set. This may lead to unexpected behavior.
    · Trying to use ANTHROPIC_AUTH_TOKEN? Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.
    · Trying to use ANTHROPIC_API_KEY? Unset the ANTHROPIC_AUTH_TOKEN environment variable.

Expected behavior
claudish should either launch cleanly using the provided API configuration, or smoothly prompt for re-authentication. It appears claudish (or the underlying claude CLI) is holding onto a ghost environment variable or conflicting with existing shell exports even after a formal logout.

Configuration (~/.claudish/settings.json)

{
  "version": "1.0.0",
  "defaultProfile": "default",
  "profiles": {
    "default": {
      "name": "default",
      "models": {
        "opus": "deepseek/deepseek-v4-pro",
        "sonnet": "deepseek/deepseek-v4-flash",
        "haiku": "deepseek/deepseek-v4-flash",
        "subagent": "deepseek/deepseek-v4-flash"
      },
      "createdAt": "2026-04-25T04:58:08.784Z",
      "updatedAt": "2026-05-02T03:03:05.782Z"
    }
  },
  "stats": {
    "enabled": false,
    "lastMonthlyPrompt": "2026-04-25T04:58:15.397Z",
    "promptedVersion": "7.0.3"
  },
  "autoApproveConfirmedAt": "2026-04-25T04:58:15.385Z"
}

Environment details:

  • OS: Tahoe 26.4.1
  • Claudish Version: 7.03
  • Claude Code Version: 2.1.126

Additional context
I suspect this might be an issue with claudish injecting or retaining ANTHROPIC_API_KEY to route requests, which then collides with an internal ANTHROPIC_AUTH_TOKEN generated by Claude Code, but claude logout doesn't clear the environment context appropriately for the wrapper.

*ANTHROPIC_API_KEY NOT permanently exported in my ~/.bashrc or ~/.zshrc file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions