cddigi avatar

shimmer

Shell prompt to Claude Code statusLine mirroring. Parses Bash PS1, Zsh PROMPT, Fish fish_prompt, and

作者 cddigi|オープンソース

Shimmer

Reflect your shell prompt into Claude Code's status line.

shimmer /ˈʃɪmər/ — shell + mirror. Your prompt, reflected.

Purpose

Your terminal prompt is your digital signature - the face you've crafted for your command line. Shimmer reflects that identity into Claude Code, keeping your environment consistent and familiar.

Usage

# Parse a PS1 string and generate statusLine config
python scripts/shim.py parse "\u@\h:\w\$"

# Auto-detect from common shell config locations
python scripts/shim.py detect

# Detect from a specific file
python scripts/shim.py detect --file ~/.bashrc

# Preview what the statusLine would look like
python scripts/shim.py preview "\u@\h:\w"

# Apply directly to Claude Code settings
python scripts/shim.py apply --preview
python scripts/shim.py apply --confirm

Supported Shells

Bash PS1

EscapeMeaningStatusLine
\uUsername{user}
\hHostname (short){hostname}
\HHostname (full){hostname}
\wWorking directory{cwd}
\WBasename only{cwd_basename}
\$$ or #$
\tTime (24h){time}
\TTime (12h){time_12}
\dDate{date}

Zsh PROMPT

EscapeMeaningStatusLine
%nUsername{user}
%mHostname (short){hostname}
%~Working directory{cwd}
%.Basename only{cwd_basename}
%#% or #$
%TTime (24h){time}
%tTime (12h){time_12}

Fish

Fish prompts are functions. Shimmer detects common patterns:

PatternStatusLine
$USER, whoami{user}
$hostname, hostname{hostname}
$PWD, pwd, prompt_pwd{cwd}
basename $PWD{cwd_basename}
date{time}

Config locations checked:

  • ~/.config/fish/functions/fish_prompt.fish
  • ~/.config/fish/config.fish

PowerShell

PatternStatusLine
$env:USERNAME{user}
$env:COMPUTERNAME{hostname}
Get-Location, $PWD{cwd}

Examples

# Bash
$ python scripts/shim.py parse "\u@\h:\w\$ "
{user}@{hostname}:{cwd}$

# Zsh
$ python scripts/shim.py parse --zsh "%n@%m:%~%# "
{user}@{hostname}:{cwd}$

# Fish (auto-detected)
$ python scripts/shim.py detect --file ~/.config/fish/functions/fish_prompt.fish
{user}@{hostname}:{cwd}$

# Preview with your actual values
$ python scripts/shim.py preview "\u@\h:\w"
alice@wonderland:~/projects

Integration

After generating your statusLine format, add it to .claude/settings.local.json:

{
  "statusLine": "{user}@{hostname}:{cwd}$ "
}

Or use apply --confirm to do this automatically.

Alias

For convenience, alias shimmer to shim:

alias shim="python /path/to/shimmer/scripts/shim.py"