GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [FEATURE]: Claude Agent: configDir setting to use another Claude Code login · Issue #60793 · anomalyco/opencode

[FEATURE]: Claude Agent: configDir setting to use another Claude Code login #60793

New issue
Copy link
New issue
Copy link
Closed
#62514
Closed
[FEATURE]: Claude Agent: configDir setting to use another Claude Code login#60793
#62514
Copy link

Description

@mr-karan
mr-karan
opened on Oct 31, 2026
Issue body actions

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Claude Agent always runs claude on the login from the shell's CLAUDE_CONFIG_DIR, or ~/.claude. You can't give one model a different login, so with more than one Claude login you have to restart OpenCode with another environment to switch.

Claude Code already supports this with CLAUDE_CONFIG_DIR ("Useful for running multiple accounts side by side", https://code.claude.com/docs/en/env-vars). You sign in to each directory with CLAUDE_CONFIG_DIR=/path claude auth login, so OpenCode still never sees a token.

Proposal: add settings.configDir to the Claude Agent connection settings, mapped to CLAUDE_CONFIG_DIR, next to baseURL and apiKey. Like those, it works on the provider or on one model, so a model alias can run on another login:

{
  "providers": {
    "claude-agent": {
      "models": {
        "opus-second": {
          "modelID": "opus",
          "settings": { "configDir": "/home/you/.claude-second" }
        }
      }
    }
  }
}

One limit: the Agent SDK's session functions read CLAUDE_CONFIG_DIR only from OpenCode's own environment, so on a custom configDir a chat rebuilds from history after the idle timeout or an edit instead of resuming. Filed upstream: anthropics/claude-agent-sdk-typescript#527

I have this implemented with tests and will open a PR that references this issue.

Reacted by rimless-casualty and Thomas Mol

Activity

  1. opencodejr commented on Oct 31, 2026

    @opencodejr
    opencodejrBot
    on Oct 31, 2026
    Contributor
    More actions

    Thanks for the detailed proposal, @mr-karan!

    To restate it: you'd like a settings.configDir option for the Claude Agent provider, set on the provider or on a single model and mapped to CLAUDE_CONFIG_DIR. That way different model aliases can use different Claude Code logins without restarting OpenCode under another environment. Today the connection settings map only baseURL, apiKey, authToken, headers and timeouts to claude's environment, so this would be a new option rather than a bug fix.

    I couldn't find an existing request for this. Related but different:

    • opencode doesn't respect CLAUDE_CONFIG_DIR environment variable #6551 / feat(core): honor CLAUDE_CONFIG_DIR for user-level Claude state #38354 / feat(core): honor CLAUDE_CONFIG_DIR for user-level Claude state #38370: honoring CLAUDE_CONFIG_DIR for OpenCode's own Claude state, not for the Claude Agent provider's login
    • feat(core): add Claude Agent provider #58782: the PR that added the Claude Agent provider

    Thanks for already noting the session-resume limit (anthropics/claude-agent-sdk-typescript#527). Maintainers will consider the request and review your PR when it's up.

  2. garysassano commented on Nov 2, 2026

    @garysassano
    garysassano
    on Nov 2, 2026
    More actions

    The multiple-account setup this needs is documented by Anthropic: Log in with multiple accounts says to give each account its own CLAUDE_CONFIG_DIR, and that each directory keeps its own settings, session history and login.

    That is exactly the setup that breaks here. With two Claude accounts:

    1. Sign in to each directory: claude auth login for ~/.claude, and CLAUDE_CONFIG_DIR=~/.claude-alt claude auth login for the second.
    2. Connect Claude Agent and send a message. The provider spawns claude with the server environment, so it always uses ~/.claude. A shell alias like claude-alt never applies, because OpenCode does not go through the interactive shell.
    3. When the first account hits its weekly limit, there is no way to switch to the second from /connect or /models. The only option is to restart the whole server with a different CLAUDE_CONFIG_DIR.

    A settings.configDir on the provider or a model, mapped to CLAUDE_CONFIG_DIR, would fix this without a restart and would let one OpenCode instance use several Claude Code logins side by side, which is the documented Anthropic pattern.

    Workarounds on 2.2.5:

    • opencode service stop, then CLAUDE_CONFIG_DIR=$HOME/.claude-alt opencode service start
    • Or a private server for the other account: CLAUDE_CONFIG_DIR=$HOME/.claude-alt opencode --standalone
    • opencode service set env CLAUDE_CONFIG_DIR ... did not apply for me: opencode service start starts with the caller's environment rather than the saved config, and running service set env inside an OpenCode session is cancelled when the service restarts before it saves.

    Environment: opencode 2.2.5, WSL2, no plugins.

  3. thomasmol commented on Nov 18, 2026

    @thomasmol
    thomasmol
    on Nov 18, 2026
    More actions

    Would very much want this!

  4. Tarquinen
    closed this as completedin #62514on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.