Last active
September 26, 2025 10:52
-
-
Save happyjake/ac7417a808a7eff5aed6c61859435677 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Claude Code Status Bar with Current Directory | |
| # Prepends the current working directory to your Claude Code status bar | |
| # Home directory is displayed as ~ for cleaner output | |
| # Read the input JSON from Claude Code | |
| input=$(cat) | |
| # Extract the current working directory from the workspace data | |
| current_dir=$(echo "$input" | jq -r '.workspace.current_dir') | |
| # Replace home directory with ~ if applicable | |
| home_dir="$HOME" | |
| if [[ "$current_dir" == "$home_dir" ]]; then | |
| display_dir="~" | |
| elif [[ "$current_dir" == "$home_dir"/* ]]; then | |
| display_dir="~${current_dir#$home_dir}" | |
| else | |
| display_dir="$current_dir" | |
| fi | |
| # Get the original status line from ccusage | |
| # Replace this with your own status line command if not using ccusage | |
| original_status=$(bunx ccusage statusline <<< "$input") | |
| # Prepend the directory to the status line with a separator | |
| echo "$display_dir | $original_status" | |
| # ============================================================================== | |
| # INSTALLATION (run this one-liner): | |
| # curl -sL https://gist.github.com/happyjake/ac7417a808a7eff5aed6c61859435677/raw/claude-statusline-pwd.sh -o ~/.claude/statusline-with-pwd.sh && chmod +x ~/.claude/statusline-with-pwd.sh && echo '{"statusline":{"command":"bash ~/.claude/statusline-with-pwd.sh","padding":0}}' > ~/.claude/settings.json | |
| # ============================================================================== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment