SLOPSHOPPER

AWS Profile

Shows each AWS profile above the prompt with whether its login still works, a one-click `aws sso login` in the app's Terminal for the expired ones, and the…

newbandguardtoastprocesstimer
A shopper browsing a rack in a slop shop
README

claude-mods

Dracula-themed mods for Claude Code: a live diff pane, Kubernetes, Docker, CodeBuild and worktree panes, a pull request dashboard, AWS SSO status, guardrails for risky shell commands and a few workflow helpers. Each mod is its own plugin, so install only the ones you want.

Mods use Claude Code's function hooks API, which is in early access and may change between releases. Mods run on your machine with your permissions: read the code before installing, like any plugin.

Install

In Claude Code (terminal or the desktop app's Code tab):

/plugin marketplace add lucasleandro08/claude-mods
/plugin install mod-manager@dracula-mods

The marketplace is named dracula-mods. Open /mods (or click the ⚙ Mods chip above the prompt; the pane also opens by itself while no mod is on): install the mods you want from there (Install or Install all) and turn them on. Every mod ships turned off. Your choices are saved in ~/.claude/dracula-mods.json, so they hold in every session; each mod's other options are in /config.

Mods

ModWhat it doesCommands
mod-managerThe only mod on by default: a pane that lists every mod with an on/off switch and an Install button for the ones not installed yet (it runs claude plugin install, or puts the /plugin install command in your prompt when the CLI is not found), plus a ⚙ Mods · n/12 chip above the prompt. After an install it runs /reload-plugins, so the new mod shows up in the session you are in; ↻ Reload does the same by hand./mods, /mods reload
live-diffA pane with the diff of every Edit and Write Claude makes: file navigator with M/A status, +/- counts, line numbers and red/green rows. A Δ Diff chip above the prompt reopens it./diff, /diff-clear
kube-paneA ⎈ context chip above the prompt (red on production) and a pods pane: context and namespace pickers, filter, pages, unhealthy pods first, and a ⌘ Shell button that opens kubectl exec in the app's Terminal, with a container picker for multi-container pods. Switching context only affects Claude's session: your kubeconfig is never written./pods
pr-paneYour open pull requests grouped by repo, with CI status, the Codex review state and whether each PR already reached your integration branch. A ⑂ PRs chip flags failing CI and Codex findings. Needs the GitHub CLI./prs
guardrailsBlocks risky commands before they run: killing a port owned by a Docker container, pkill docker, printing secrets (env, printenv, echo $API_TOKEN), rewriting the kubeconfig. Asks before kubectl writes on production contexts. Each rule can be switched off.—
promote-branch/promote previews merging the current branch into your integration branch (commits, files, test files touched). /promote go does a full merge in a temporary worktree and pushes it, refusing dirty trees and protected branches./promote, /promote go
codex-loopHands Claude the review loop with the Codex GitHub bot: request a review, weigh each finding, fix or 👎 it, reply, resolve, repeat until 👍, for at most 5 rounds (and 15 minutes of waiting per round) before it stops and reports what is still open./codex-loop <PR> [--max <rounds>]
turn-doneA toast and a chime when a long turn finishes.—
aws-profileEach AWS profile above the prompt with whether its login still works (aws sts get-caller-identity, only the exit code is kept). Expired ones get a login button that runs aws sso login --profile … in the app's Terminal and turns green once you finish. The AWS_PROFILE Claude Code runs with is marked ●; production profiles are red.—
docker-paneA 🐳 Docker · n up chip (unhealthy and stale counts) and a pane grouped by compose project: ports, health, Start/Stop/Restart by container name (never by port), Logs and compose Recreate in the app's Terminal. Flags containers created before your last git checkout in the session's repo, the usual cause of a test failing for no reason./docker
deploy-watchWatches AWS CodeBuild projects: a 🚀 chip with the last build, a warning (chip and toast) when a git push to a project's branch started no build after a few minutes, and a pane with recent builds, their logs in the Terminal and a Start build button that asks first./deploys
worktreesA 🌳 n worktrees chip and a pane with every worktree of the session's repo and of the repos under your roots: branch, uncommitted changes, PR state, a Terminal button, and Remove (asks first, never --force) for clean worktrees whose branch is merged./worktrees
dotAn always-on assistant with a name and a face: Vlad, a chibi vampire drawn in SVG that lives in its own pane and animates by mood (working, waiting on you, idle, paused), with what it is doing right under its name; the mods bar keeps a one-word tile that opens it. Rename it with /dot name. Give it goals in its pane or with /dot <goal>; background rounds (the desktop app's scheduled tasks, every 30 min) pick one goal at a time and work on it, following ~/.claude/dot/rules.md: act alone, ask first, or hand off to you. When it needs a decision it notifies you and the goal shows under Waiting on you, where you answer it. A weekday morning briefing sums up what needs you. Its memory is a file you can read and edit. Rounds run while the desktop app is open./dot, /dot <goal>, `/dot on \pause \resume \run`

Options

ModOptionDefault
mod-managerShow the Mods chip · open on start until a mod is on · claude CLI pathon · on · PATH
kube-paneProduction context pattern · default namespace · refresh interval · pods per page · kubectl pathprod · default · 15 s · 25 · PATH
pr-paneIntegration branch · Codex bot login · refresh interval · PRs to load · gh pathstaging · chatgpt-codex-connector[bot] · 5 min · 50 · PATH
guardrailsProduction pattern · confirm production writes · block kubeconfig changes · block printing secrets · protect Docker portsprod · on · on · on · on
promote-branchTarget branch · protected branchesstaging · main,master
live-diffContext lines · edits kept2 · 100
turn-doneLong turn threshold · play sound60 s · on
codex-loopCodex bot login · maximum review rounds · wait for Codexchatgpt-codex-connector[bot] · 5 · 15 min
aws-profileProduction pattern · profiles · check interval · aws pathprod · all · 5 min · PATH
docker-paneRefresh interval · docker path60 s (10 s while open) · PATH
deploy-watchProjects (name=branch, comma-separated) · AWS profile · region · poll interval · missing build warning · production pattern · aws pathnone · CLI default · profile's · 60 s · 3 min · prod · PATH
worktreesRoots (folders holding your repos) · refresh interval · gh pathsession repo only · 5 min · PATH
dotWork round interval · morning briefing (weekdays) · open its pane on start30 min · 09:00 · on

With the mod-manager on, every mod's chip is drawn in one bar above the prompt: a tile per mod, its name dimmed over its value (like a usage band), wrapping between tiles with a blank row between lines; each mod publishes its chip as state and the bar sends presses back to it. Without the manager, or if it stops, each mod draws its own row again. Either way the band keeps whatever other mods draw beneath it.

Rolling out to a whole organization

Admins can register the marketplace and install mods for everyone through managed settings (extraKnownMarketplaces and enabledPlugins); people then turn on what they use in /mods. See Plugins for organizations and Mods for admins.

Development

git clone https://github.com/lucasleandro08/claude-mods
cd claude-mods
scripts/check.sh            # validate + test every plugin (CLAUDE_BIN overrides the CLI path)
scripts/check.sh kube-pane  # only one

Load your checkout instead of the published version by adding it as a local marketplace and installing from it:

claude plugin marketplace add ~/claude-mods
claude plugin install mod-manager@dracula-mods --scope user

Plugins of a marketplace added from a local folder load in place, so edits and newly installed mods reach open sessions with /reload-plugins (or ↻ Reload in /mods); see Plugin loading. Avoid CLAUDE_CODE_PLUGIN_DIRS for this: it is read only when a session starts, so a mod added to it shows up only in new sessions.

Layout

.claude-plugin/marketplace.json
plugins/<mod>/
  .claude-plugin/plugin.json   manifest and /config options
  hooks/register.tsx           event wiring, state atoms, everything that touches $
  src/                         pure logic (diffing, parsing kubectl and gh output, rules)
  src/shared/                  vendored copies of scripts/shared (theme, binary lookup)
  ui/                          components the panes and chips draw
  types/index.d.ts             state contract
  tests/                       claude plugin test suites
scripts/shared/                source of the shared files; scripts/sync-shared.sh copies them

Two rules of the hooks runtime shape this layout: $ can only be passed to functions declared in register.tsx itself, and state atoms must be declared there too. Plugins cannot import files from each other, which is why small shared helpers are vendored.

License

MIT


🇧🇷 Em português: mods para o Claude Code com tema Dracula. Instale com /plugin marketplace add lucasleandro08/claude-mods e /plugin install mod-manager@dracula-mods, instale os mods que quiser e ligue cada um em /mods (todos vêm desligados); as demais opções ficam em /config.

Source 8 files
hooks/register.tsx 175 lines
1import { atom, read, update } from 'claude-code'
2import type { EngineInterface, PluginOptions, Register } from 'claude-code'
3
4import { classify, LOGIN_PATTERN, loginCommand, pickProfiles, withStatus } from '../src/sessions'
5import { binaryCandidates } from '../src/shared/bin'
6import { isOn, parseState, statePath } from '../src/shared/toggle'
7import { barIsLive, sameChip, type Chip, type ChipPress } from '../src/shared/chip'
8import { ProfileChip, profileChip } from '../ui/chip'
9
10const MOD = 'aws-profile'
11const CHECK_MS = 5000
12const active = atom({ plugin: 'aws-profile', key: 'active' } as const, false)
13let checkedAt = 0
14
15async function isActive($: EngineInterface) {
16  if (Date.now() - checkedAt > CHECK_MS) {
17    checkedAt = Date.now()
18    const home = await $.env.get('HOME').catch(() => undefined)
19    const text = await $.fs.read(statePath(home)).catch(() => '')
20    const on = isOn(parseState(text), MOD)
21    await update($, active, prev => (prev === on ? prev : on))
22  }
23  return read($, active)
24}
25
26const chip = atom({ plugin: 'aws-profile', key: 'chip' } as const, null)
27
28async function barOwnsChips($: EngineInterface) {
29  const { value } = await $.state.get({ plugin: 'mod-manager', key: 'bar' })
30  return barIsLive(value, Date.now())
31}
32
33async function setChip($: EngineInterface, next: Chip | null) {
34  await update($, chip, prev => (sameChip(prev, next) ? prev : next))
35}
36
37const PENDING_WINDOW_MS = 180_000
38
39const profile = atom({ plugin: 'aws-profile', key: 'profile' } as const, '')
40const sessions = atom({ plugin: 'aws-profile', key: 'sessions' } as const, [])
41const pending = atom({ plugin: 'aws-profile', key: 'pending' } as const, [])
42let pendingUntil = 0
43let fullCheckAt = 0
44
45type Settings = { production: RegExp; profiles: string; awsPath: string; checkMs: number }
46
47function readSettings(options: PluginOptions): Settings {
48  return {
49    production: new RegExp(String(options.productionPattern ?? 'prod'), 'i'),
50    profiles: String(options.profiles ?? ''),
51    awsPath: String(options.awsPath ?? ''),
52    checkMs: Math.max(1, Number(options.checkMinutes ?? 5)) * 60_000,
53  }
54}
55
56async function aws($: EngineInterface, settings: Settings, args: readonly string[]) {
57  for (const bin of binaryCandidates('aws', await $.env.get('HOME'), settings.awsPath)) {
58    try {
59      return await $.process.run([bin, ...args], { timeoutMs: 20_000, env: { AWS_PAGER: '' } })
60    } catch {
61      continue
62    }
63  }
64  return undefined
65}
66
67async function readProfile($: EngineInterface) {
68  const current = (await $.env.get('AWS_PROFILE')) ?? ''
69  await update($, profile, prev => (prev === current ? prev : current))
70  return current
71}
72
73// Only the exit code matters: the identity the call prints is never kept or shown
74async function checkProfile($: EngineInterface, settings: Settings, name: string) {
75  const ran = await aws($, settings, ['sts', 'get-caller-identity', '--profile', name, '--output', 'text'])
76  const state = ran === undefined ? 'error' : classify(ran.exitCode, ran.stderr)
77  await update($, sessions, prev => withStatus(prev, name, state))
78  if (state === 'valid') await update($, pending, prev => prev.filter(p => p !== name))
79}
80
81async function checkAll($: EngineInterface, settings: Settings) {
82  const current = await readProfile($)
83  const listed = settings.profiles === '' ? await aws($, settings, ['configure', 'list-profiles']) : undefined
84  const names = pickProfiles(listed?.exitCode === 0 ? listed.stdout : '', settings.profiles, current)
85  await update($, sessions, prev => names.map(name => prev.find(s => s.name === name) ?? { name, state: 'checking' as const }))
86  await Promise.all(names.map(name => checkProfile($, settings, name)))
87}
88
89async function checkPending($: EngineInterface, settings: Settings) {
90  const waiting = await read($, pending)
91  if (waiting.length === 0) return
92  if (Date.now() > pendingUntil) {
93    await update($, pending, () => [])
94    return
95  }
96  await Promise.all(waiting.map(name => checkProfile($, settings, name)))
97}
98
99async function tick($: EngineInterface, settings: Settings) {
100  if (!(await isActive($))) return
101  if (Date.now() - fullCheckAt < settings.checkMs) return checkPending($, settings)
102  fullCheckAt = Date.now()
103  await checkAll($, settings)
104}
105
106async function login($: EngineInterface, name: string) {
107  try {
108    await $.tool.call({ tool: 'mcp__terminal__run_in_terminal', command: loginCommand(name), title: `aws sso login ${name}`.slice(0, 40) })
109    pendingUntil = Date.now() + PENDING_WINDOW_MS
110    await update($, pending, prev => (prev.includes(name) ? prev : [...prev, name]))
111  } catch (err) {
112    $.ui.toast(`Could not open the terminal: ${err instanceof Error ? err.message : String(err)}`)
113  }
114}
115
116async function publishChip($: EngineInterface, settings: Settings) {
117  const next = (await read($, active))
118    ? profileChip(await read($, profile), await read($, sessions), await read($, pending), name => settings.production.test(name))
119    : null
120  await setChip($, next)
121}
122
123async function pressProfile($: EngineInterface, action: string) {
124  if (action.startsWith('login:')) await login($, action.slice('login:'.length))
125}
126
127export const register: Register = (on, options) => {
128  const settings = readSettings(options)
129
130  on('state.set', async ($, e, next) => {
131    const ran = await next(e)
132    if (e.plugin === 'mod-manager' && e.key === 'press') {
133      const pressed = e.value as ChipPress | null
134      if (pressed?.plugin === MOD && (await isActive($))) await pressProfile($, pressed.action)
135    }
136    return ran
137  })
138
139  on('session.start', async ($, e, next) => {
140    fullCheckAt = 0
141    $.clock.every(CHECK_MS, () => void tick($, settings).catch(() => undefined))
142    $.clock.every(CHECK_MS, () => void publishChip($, settings).catch(() => undefined))
143    return next(e)
144  })
145
146  on('tool.call', { tool: 'Bash' }, async ($, e, next) => {
147    if (!(await isActive($))) return next(e)
148    const ran = await next(e)
149    if (LOGIN_PATTERN.test(e.command)) await checkAll($, settings)
150    else if (/\baws\b|AWS_PROFILE/.test(e.command)) await readProfile($)
151    return ran
152  })
153
154  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
155    if (!(await read($, active)) || (await barOwnsChips($))) return next(e)
156    const rest = await next(e)
157    if (e.props.hasSurvey) return rest
158
159    const ui = $.ui.resolve(e)
160    return (
161      <ui.Box flexDirection="column">
162        <ProfileChip
163          ui={ui}
164          profile={await read($, profile)}
165          sessions={await read($, sessions)}
166          pending={await read($, pending)}
167          isProduction={name => settings.production.test(name)}
168          onLogin={name => login($, name)}
169        />
170        {rest}
171      </ui.Box>
172    )
173  })
174}
175
src/sessions.ts 24 lines
1import type { SessionState, SessionStatus } from '../types'
2
3export function pickProfiles(listed: string, option: string, current: string): string[] {
4  const chosen = option.split(/[,\s]+/).map(p => p.trim()).filter(Boolean)
5  const profiles = chosen.length > 0 ? chosen : listed.split('\n').map(p => p.trim()).filter(Boolean)
6  return [...new Set(current === '' ? profiles : [...profiles, current])]
7}
8
9export function classify(exitCode: number, stderr: string): SessionState {
10  if (exitCode === 0) return 'valid'
11  return /expired|sso|token|login|refresh/i.test(stderr) ? 'expired' : 'error'
12}
13
14export function withStatus(statuses: SessionStatus[], name: string, state: SessionState): SessionStatus[] {
15  const known = statuses.some(s => s.name === name)
16  return known ? statuses.map(s => (s.name === name ? { name, state } : s)) : [...statuses, { name, state }]
17}
18
19export const LOGIN_PATTERN = /\baws\s+sso\s+(login|logout)\b/
20
21export function loginCommand(profile: string) {
22  return `aws sso login --profile ${/^[\w.-]+$/.test(profile) ? profile : `'${profile.replace(/'/g, `'\\''`)}'`}`
23}
24
src/shared/bin.ts 9 lines
1const COMMON_DIRS = ['/opt/homebrew/bin', '/usr/local/bin', '/usr/bin']
2
3export function binaryCandidates(name: string, home: string | undefined, override?: string): string[] {
4  const homeDirs = home ? [`${home}/bin`, `${home}/.local/bin`] : []
5  return [override, name, ...[...COMMON_DIRS, ...homeDirs].map(dir => `${dir}/${name}`)].filter(
6    (bin): bin is string => typeof bin === 'string' && bin !== '',
7  )
8}
9
src/shared/toggle.ts 31 lines
1export const MARKETPLACE = 'dracula-mods'
2export const STATE_FILE = '.claude/dracula-mods.json'
3export const OFF_TEXT = 'This mod is off. Turn it on in /mods.'
4
5export type ModsState = { enabled: Record<string, boolean> }
6
7export function statePath(home: string | undefined) {
8  return `${home ?? ''}/${STATE_FILE}`
9}
10
11export function parseState(text: string): ModsState {
12  try {
13    const parsed = JSON.parse(text) as Partial<ModsState>
14    return { enabled: typeof parsed.enabled === 'object' && parsed.enabled !== null ? parsed.enabled : {} }
15  } catch {
16    return { enabled: {} }
17  }
18}
19
20export function isOn(state: ModsState, name: string) {
21  return state.enabled[name] === true
22}
23
24export function withToggle(state: ModsState, name: string, on: boolean): ModsState {
25  return { enabled: { ...state.enabled, [name]: on } }
26}
27
28export function serializeState(state: ModsState) {
29  return `${JSON.stringify(state, null, 2)}\n`
30}
31
src/shared/chip.ts 28 lines
1import { DRACULA } from './theme'
2
3// The mod-manager draws every mod's chip in one bar; each mod publishes its chip as data
4export type ChipTone = 'text' | 'muted' | 'ok' | 'warn' | 'bad' | 'info' | 'accent'
5export type ChipPart = { text: string; tone: ChipTone; bold?: boolean; action?: string }
6export type Chip = { icon: string; label: string; tone: ChipTone; parts: ChipPart[] }
7export type ChipPress = { plugin: string; action: string; at: number }
8
9export const TONE_COLOR: Record<ChipTone, string> = {
10  text: DRACULA.foreground,
11  muted: DRACULA.comment,
12  ok: DRACULA.green,
13  warn: DRACULA.orange,
14  bad: DRACULA.red,
15  info: DRACULA.cyan,
16  accent: DRACULA.purple,
17}
18
19export function sameChip(a: Chip | null, b: Chip | null) {
20  return JSON.stringify(a) === JSON.stringify(b)
21}
22
23export const BAR_STALE_MS = 30_000
24
25export function barIsLive(beat: number | undefined, now: number) {
26  return typeof beat === 'number' && now - beat < BAR_STALE_MS
27}
28
ui/chip.tsx 63 lines
1import type { Elements, RenderSurface } from 'claude-code'
2
3import type { SessionStatus } from '../types'
4import type { Chip, ChipPart } from '../src/shared/chip'
5import { DRACULA } from '../src/shared/theme'
6
7type Ui = Elements[RenderSurface]
8
9type ChipProps = {
10  ui: Ui
11  profile: string
12  sessions: SessionStatus[]
13  pending: string[]
14  isProduction: (name: string) => boolean
15  onLogin: (name: string) => unknown
16}
17
18export function ProfileChip({ ui, profile, sessions, pending, isProduction, onLogin }: ChipProps) {
19  const { Box, Text, Button } = ui
20
21  if (sessions.length === 0) {
22    const prod = isProduction(profile)
23    return (
24      <Box flexDirection="row" marginBottom={1}>
25        <Text>
26          <Text color={prod ? DRACULA.red : DRACULA.orange} bold={prod}>☁ </Text>
27          <Text color={prod ? DRACULA.red : DRACULA.comment} bold={prod} dimColor={profile === ''}>{profile === '' ? 'no AWS_PROFILE' : profile}</Text>
28        </Text>
29      </Box>
30    )
31  }
32
33  return (
34    <Box flexDirection="row" flexWrap="wrap" columnGap={1} alignItems="center" marginBottom={1}>
35      <Text color={DRACULA.orange}>☁</Text>
36      {sessions.map(({ name, state }) => {
37        const label = `${name === profile ? '● ' : ''}${name}`
38        const color = isProduction(name) ? DRACULA.red : DRACULA.foreground
39        if (pending.includes(name)) return <Text key={`aws-${name}`} color={DRACULA.yellow}>{label} ⟳</Text>
40        if (state === 'valid') return <Text key={`aws-${name}`} color={color}>{label} <Text color={DRACULA.green}>✓</Text></Text>
41        if (state === 'checking') return <Text key={`aws-${name}`} color={DRACULA.comment}>{label} …</Text>
42        return <Button key={`login-${name}`} label={`${label} ✗ login`} dimColor onPress={() => onLogin(name)} />
43      })}
44    </Box>
45  )
46}
47
48export function profileChip(profile: string, sessions: SessionStatus[], pending: string[], isProduction: (name: string) => boolean): Chip {
49  if (sessions.length === 0) {
50    const tone = profile === '' ? 'muted' : isProduction(profile) ? 'bad' : 'text'
51    return { icon: '☁', label: 'aws', tone: 'warn', parts: [{ text: profile === '' ? 'no AWS_PROFILE' : profile, tone }] }
52  }
53  const parts: ChipPart[] = sessions.flatMap(({ name, state }): ChipPart[] => {
54    const label = `${name === profile ? '● ' : ''}${name}`
55    const tone = isProduction(name) ? 'bad' : 'text'
56    if (pending.includes(name)) return [{ text: `${label} ⟳`, tone: 'warn' }]
57    if (state === 'valid') return [{ text: label, tone }, { text: '✓', tone: 'ok' }]
58    if (state === 'checking') return [{ text: `${label} …`, tone: 'muted' }]
59    return [{ text: `${label} ✗ login`, tone: 'bad', action: `login:${name}` }]
60  })
61  return { icon: '☁', label: 'aws', tone: 'warn', parts }
62}
63
src/shared/theme.ts 15 lines
1// Dracula palette: https://draculatheme.com/contribute#color-palette
2export const DRACULA = {
3  background: '#282a36',
4  currentLine: '#44475a',
5  foreground: '#f8f8f2',
6  comment: '#6272a4',
7  cyan: '#8be9fd',
8  green: '#50fa7b',
9  orange: '#ffb86c',
10  pink: '#ff79c6',
11  purple: '#bd93f9',
12  red: '#ff5555',
13  yellow: '#f1fa8c',
14} as const
15
types/index.d.ts 16 lines
1export type ChipTone = 'text' | 'muted' | 'ok' | 'warn' | 'bad' | 'info' | 'accent'
2export type ChipPart = { text: string; tone: ChipTone; bold?: boolean; action?: string }
3export type Chip = { icon: string; label: string; tone: ChipTone; parts: ChipPart[] }
4export type ChipPress = { plugin: string; action: string; at: number }
5
6export type AwsProfile = string
7export type SessionState = 'checking' | 'valid' | 'expired' | 'error'
8export type SessionStatus = { name: string; state: SessionState }
9
10declare module 'claude-code' {
11  interface PluginState {
12    'mod-manager': { bar: number; press: ChipPress | null }
13    'aws-profile': { active: boolean; profile: AwsProfile; sessions: SessionStatus[]; pending: string[]; chip: Chip | null }
14  }
15}
16