SLOPSHOPPER

account-badge

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

newband
A shopper browsing a rack in a slop shop
Preview · a replayed session in a sandbox
claude · ~/work/app · account-badge
› fix the failing auth test and add an audit log call ⏺ Read(src/auth.ts) ⎿ Read 6 lines ⏺ Update(src/auth.ts) ⎿ Added 2 lines, removed 1 line ⏺ Bash(bun test) ⎿ 3 pass, 1 fail ● Done. refresh now rejects expired claims and logs an audit event. ✻ Worked for 42s · done 4:20 PM [default] ⟨Claude Code's own drawing⟩ ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── › ? for shortcuts

Draws

Band
[default] ⟨Claude Code's own drawing⟩
README

claude-code-account-badge

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.

Install

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

What it can touch

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.

Status

Tests pass with claude plugin test on Windows. Not yet tried on macOS or Linux. Issues welcome.

License

MIT

Source 1 files
hooks/register.tsx 25 lines
1import 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