Expose account email in statusLine hook JSON payload
Feature Request
Problem
The statusLine hook receives a JSON payload via stdin with session metadata (model, context_window, workspace, cost, version, output_style). However, there is no account/user information included in this payload.
This makes it impossible to display the logged-in user identity in a custom status line without resorting to manual workarounds (e.g., maintaining a separate identity file that the user must update when switching accounts).
Current statusLine JSON payload (v2.1.38)
{
"session_id": "...",
"transcript_path": "...",
"cwd": "...",
"model": { "id": "claude-opus-4-6", "display_name": "Opus 4.6" },
"workspace": { "current_dir": "...", "project_dir": "..." },
"version": "2.1.38",
"output_style": { "name": "default" },
"cost": { ... },
"context_window": { ... },
"exceeds_200k_tokens": false
}
Requested addition
Include an account object in the statusLine JSON payload:
{
"account": {
"email": "user@example.com",
"organization": "Org Name",
"login_method": "Claude Max Account"
},
...existing fields
}
Use case
Users who work with multiple Claude accounts (e.g., personal and business) need a way to identify which account is active at a glance in their status line. The account info is already available internally (/status displays it), but it's not exposed to the statusLine hook.
Workaround attempted
- Checked statusLine JSON payload -- no account fields
- Checked SessionStart hook JSON -- no account fields
- Checked environment variables -- only
CLAUDECODE=1, no account info - Checked
%APPDATA%/Claude/config files -- auth is encrypted claude auth whoamiandclaude config listspawn full sessions (hang when called from hooks)
Current workaround: manually maintained ~/.claude/.user_identity file that must be updated each time the user switches accounts.
Suggestion
This would also be valuable for the SessionStart hook payload, enabling hooks to behave differently per account (e.g., loading different project contexts or permissions).
Environment
- Claude Code v2.1.38
- Windows 11
- Multiple accounts on same machine
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗