Skip to content

feat(widgets): add Claude account email widget#295

Merged
sirmalloc merged 5 commits intosirmalloc:mainfrom
FA387:feature/claude-account-email-widget
Apr 8, 2026
Merged

feat(widgets): add Claude account email widget#295
sirmalloc merged 5 commits intosirmalloc:mainfrom
FA387:feature/claude-account-email-widget

Conversation

@FA387
Copy link
Copy Markdown
Contributor

@FA387 FA387 commented Apr 8, 2026

Summary

  • Adds a new Claude Account Email widget in the Session category
  • Displays the currently authenticated user's email directly in the ccstatusline status bar
  • Resolves email by reading git config user.email first, then falls back to common environment variables (GIT_AUTHOR_EMAIL, GIT_COMMITTER_EMAIL, EMAIL, USER_EMAIL)
  • Returns null gracefully if no email source is found (widget is hidden)
  • Supports raw value mode and color customization

Widget details

Property Value
Display name Claude Account Email
Category Session
Default color blue
Preview value you@example.com

Why this is useful

When using Claude Code with multiple accounts (e.g. via ccswitch), it's helpful to see at a glance which account/email is active in the status line — no need to run git config user.email separately.

Test plan

  • Add the widget via the TUI (bun run start) under the Session category
  • Verify it shows your git config email in the status bar
  • Test fallback: unset git config user.email, set EMAIL env var instead
  • Verify preview shows you@example.com in the TUI editor

🤖 Generated with Claude Code

FA387 and others added 2 commits April 8, 2026 11:13
Adds a new ClaudeAccountEmail widget in the Session category that displays
the user's email by reading from git config user.email or falling back to
common environment variables (GIT_AUTHOR_EMAIL, GIT_COMMITTER_EMAIL, EMAIL, USER_EMAIL).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sirmalloc
Copy link
Copy Markdown
Owner

@FA387 Can you explain how the configured git email relates to the authenticated Claude account? To pull the Claude account email you'd need to look in ~/.claude.json. I'd be happy to add this as a Git Email widget, but it doesn't seem related at all to the Claude account.

Replaces the git config approach with reading oauthAccount.emailAddress
directly from ~/.claude.json — the actual Claude account credentials file.
Respects CLAUDE_CONFIG_DIR environment variable. No external tools required.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@FA387
Copy link
Copy Markdown
Contributor Author

FA387 commented Apr 8, 2026

Good catch, thanks for the feedback! You're right — git email and Claude account email are completely unrelated.

I've updated the widget to read oauthAccount.emailAddress directly from ~/.claude.json (with CLAUDE_CONFIG_DIR support), which is the actual logged-in Claude account. No dependency on any external tool.

@FA387
Copy link
Copy Markdown
Contributor Author

FA387 commented Apr 8, 2026

P.S.
I modify it with Claude Code for me to easily distinguish between my personal account and my work account with Teams.

I think it will help other people in the same situations

Best regards
FA

@sirmalloc sirmalloc merged commit e87ce2e into sirmalloc:main Apr 8, 2026
3 checks passed
@sirmalloc
Copy link
Copy Markdown
Owner

Thanks for this. It'll be published in the next release.

@FA387
Copy link
Copy Markdown
Contributor Author

FA387 commented Apr 8, 2026

Thank you, sir! Glad that I can contribute~

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.

2 participants