Where is the login state stored? #2781

Closed
opened 2026-02-16 17:37:13 -05:00 by yindo · 3 comments
Owner

Originally created by @tee-writes-code on GitHub (Nov 11, 2025).

Question

I'm developing projects using devcontainer(s) in VsCode and claude-code, which means I'm running codes and editing the files inside the docker container.

I've been able to share the auth state of claude-code from my host by mounting the directory ~/.claude/ in the devcontainer (docker container). This avoids having to re-login everytime I boot up the devcontainer.

Meanwhile for opencode, when I mount the ~/.config/opencode/ to the devcontainer, I noticed it doesn't seem to contain the auth state because I still need to manually run opencode auth login everytime I boot up the devcontainer as the session is not automatically logged in.

My question is, where does opencode store its auth state so that I could share it to the devcontainer?

Originally created by @tee-writes-code on GitHub (Nov 11, 2025). ### Question I'm developing projects using `devcontainer(s)` in VsCode and `claude-code`, which means I'm running codes and editing the files inside the docker container. I've been able to share the auth state of `claude-code` from my host by mounting the directory `~/.claude/` in the devcontainer (docker container). This avoids having to re-login everytime I boot up the devcontainer. Meanwhile for `opencode`, when I mount the `~/.config/opencode/` to the devcontainer, I noticed it doesn't seem to contain the auth state because I still need to manually run `opencode auth login` everytime I boot up the devcontainer as the session is not automatically logged in. My question is, where does `opencode` store its auth state so that I could share it to the devcontainer?
yindo closed this issue 2026-02-16 17:37:13 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 11, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #4170: Specifically addresses the same concern about where auth credentials, config, and other important data are stored across different directories, with detailed documentation about the actual locations.

The issue #4170 provides the exact answer to your question - authentication credentials are stored in ~/.local/share/opencode/auth.json, not in ~/.config/opencode/.

Feel free to ignore if this doesn't address your specific case.

@github-actions[bot] commented on GitHub (Nov 11, 2025): This issue might be a duplicate of existing issues. Please check: - #4170: Specifically addresses the same concern about where auth credentials, config, and other important data are stored across different directories, with detailed documentation about the actual locations. The issue #4170 provides the exact answer to your question - authentication credentials are stored in `~/.local/share/opencode/auth.json`, not in `~/.config/opencode/`. Feel free to ignore if this doesn't address your specific case.
Author
Owner

@OpeOginni commented on GitHub (Nov 11, 2025):

@tee-writes-code I think the github action answered it for you its at ~/.local/share/opencode/auth.json

@OpeOginni commented on GitHub (Nov 11, 2025): @tee-writes-code I think the github action answered it for you its at `~/.local/share/opencode/auth.json`
Author
Owner

@tee-writes-code commented on GitHub (Nov 11, 2025):

Yes it did, thanks for the heads up! 👍

@tee-writes-code commented on GitHub (Nov 11, 2025): Yes it did, thanks for the heads up! 👍
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2781