AgentSkillsCN

shimmer

Shell 提示符与 Claude Code statusLine 的镜像同步。解析 Bash PS1、Zsh PROMPT、Fish fish_prompt,以及 PowerShell 提示符函数,生成兼容的 statusLine 配置。当用户希望将终端身份映射到 Claude Code 时,可使用此技能。

SKILL.md
--- frontmatter
name: shimmer
description: Shell prompt to Claude Code statusLine mirroring. Parses Bash PS1, Zsh PROMPT, Fish fish_prompt, and PowerShell prompt functions to generate compatible statusLine configuration. Use when users want their terminal identity reflected in Claude Code.

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

bash
# 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
# 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:

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

Or use apply --confirm to do this automatically.

Alias

For convenience, alias shimmer to shim:

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