Shows which Claude account (CLAUDE_CONFIG_DIR) this session uses, above the prompt

A small Claude Code mod that shows which Claude account the current session uses, in the band above the prompt:
[work]
The name comes from the CLAUDE_CONFIG_DIR folder the session runs with: ~/.claude-work shows work, ~/.claude-personal shows personal, and default means CLAUDE_CONFIG_DIR isn't set. It pairs with claude-code-multi-account, which picks the account per project, but works with any setup that sets CLAUDE_CONFIG_DIR.
Whatever other mods draw in the band stays there, under the badge. Pairs well with claude-code-wait-clock.
Needs Claude Code v2.1.287 or later (claude --version).
claude plugin marketplace add TusharKanjariya/claude-code-account-badge
claude plugin install account-badge@claude-code-account-badge
Or try it for one session without installing:
git clone https://github.com/TusharKanjariya/claude-code-account-badge.git
claude --plugin-dir ./claude-code-account-badge/plugins/account-badge
A mod is code that runs with your permissions, inside Claude Code. Check before you install:
claude plugin validate ./plugins/account-badge
It reports one hook (ui.render on AbovePrompt), one env read (CLAUDE_CONFIG_DIR), and the calls $.env.get and $.ui.resolve. No file, network or process access.
Tests pass with claude plugin test on Windows. Not yet tried on macOS or Linux. Issues welcome.
hooks/register.tsx 25 lines1import type { Register } from 'claude-code'
2
3// ~/.claude-work -> "work", ~/.claude-personal -> "personal", unset -> "default"
4function accountLabel(dir: string | undefined): string {
5 if (!dir) return 'default'
6 const base = dir.replace(/[\\/]+$/, '').split(/[\\/]/).pop() ?? dir
7 return base.replace(/^\.?claude[-_]?/, '') || base
8}
9
10export const register: Register = on => {
11 on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
12 if (e.props.hasSurvey) return next(e)
13 const { Box, Text } = $.ui.resolve(e)
14 const account = accountLabel(await $.env.get('CLAUDE_CONFIG_DIR'))
15 const others = await next(e) // keep whatever other mods draw in the band
16
17 return (
18 <Box flexDirection="column">
19 <Text color="claude" bold>[{account}]</Text>
20 {others}
21 </Box>
22 )
23 })
24}
25