Skip to content

Account identity for multi-account credential overlays - #4

Merged
lroolle merged 1 commit into
feat/v0.18.0-cache-expiry-deadlinefrom
feat/account-scope
Jul 27, 2026
Merged

Account identity for multi-account credential overlays#4
lroolle merged 1 commit into
feat/v0.18.0-cache-expiry-deadlinefrom
feat/account-scope

Conversation

@lroolle

@lroolle lroolle commented Jul 27, 2026

Copy link
Copy Markdown
Member

One ~/.claude used to imply one account. deva-style runners bind-mount a
different .credentials.json per container over the same shared config
home — the account-scoped caches then bleed across accounts: B renders
A's 5h/7d bars whenever A fetched last, profile.cache sticks to the
first account for 24h, usage.jsonl interleaves both histories.

Tokens rotate, so the credentials file cannot identify itself. The
runner says who the session is:

  • STATUSLINE_ACCOUNT (explicit) or DEVA_AUTH_TAG (deva --auth-with,
    feat: export DEVA_AUTH_TAG for in-container account identity deva#497) -> account tag, sanitized before pathing
  • user segment renders @tag chip: [MAX|@work]; tag beats profile
    display name (two accounts can carry the same human name)
  • account state moves to accounts// under the shared statusline
    dir: same-account sessions still share one fetch, different accounts
    stop clobbering each other
  • auth-default and explicit CLAUDE_DATA_DIR/CLAUDE_CACHE_DIR overrides
    change nothing; chip also renders for api-key sessions that skip the
    OAuth quota block

Tests: 3 unit + 6 integration, full suite 287 green. Helpers now unset
host DEVA_AUTH_TAG so suites running inside tagged deva containers stay
hermetic.

Stacked on feat/v0.18.0-cache-expiry-deadline (branch base) to keep the
diff to this change only.

🤖 Generated with Claude Code

One ~/.claude used to imply one account; deva-style runners bind-mount
a different .credentials.json per container over the same shared config
home, and the account-scoped caches bled across accounts: B rendered
A's 5h/7d bars whenever A fetched last, profile.cache stuck to the
first account for 24h. Tokens rotate, so the credentials file cannot
identify itself — the runner says who the session is.

- STATUSLINE_ACCOUNT (explicit) or DEVA_AUTH_TAG (deva --auth-with)
  resolve to an account tag; sanitized before touching any path
- user segment renders @tag chip; tag beats profile display name
  (two accounts can carry the same human name)
- account state moves to accounts/<tag>/ under the shared statusline
  dir: same-account sessions share one fetch, different accounts stop
  clobbering each other; auth-default and explicit CLAUDE_DATA_DIR /
  CLAUDE_CACHE_DIR overrides change nothing
- chip also renders for api-key/custom-endpoint sessions that skip the
  OAuth quota block — the sessions only a tag can tell apart
- legacy-state migration never lands in a tagged account dir
- tests: 3 unit + 6 integration; helpers unset host DEVA_AUTH_TAG so
  suites running inside tagged deva containers stay hermetic

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lroolle
lroolle merged commit 0239e7d into feat/v0.18.0-cache-expiry-deadline Jul 27, 2026
@lroolle
lroolle deleted the feat/account-scope branch July 27, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant