[BUG] Status line fails silently when home directory and project are on different drives (Windows)

Resolved 💬 4 comments Opened Nov 10, 2025 by rohiitshankar Closed Jan 12, 2026

Description

Status line does not appear when the user's home directory (C: drive) and project directory (different drive like G:) are on separate physical drives on Windows.

Environment

  • OS: Windows 11
  • Claude Code Version: 2.0.36
  • Shell: Git Bash / PowerShell

Steps to Reproduce

  1. Have home directory on C: drive (C:\Users\username)
  2. Have project on different drive (e.g., G:\Projects\myproject)
  3. Configure status line in ~/.claude/settings.json:
{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/statusline.sh"
  }
}
  1. Script attempts to access git info from project directory on G: drive
  2. Restart Claude Code

Expected Behavior

Status line appears with project information including git branch, directory name, etc.

Actual Behavior

Status line area remains completely blank (black). Script fails silently when trying to access G: drive from C: drive context.

Root Cause

Cross-drive directory operations (cd, Push-Location, Pop-Location) fail silently in scripts launched from C: drive trying to access G: drive, causing the script to produce no output. When the status line script produces no output, Claude Code displays nothing in the status line area.

Workaround

Use git -C <path> instead of changing directories, and add proper error handling:

PowerShell example:

$cwdPath = $cwd -replace '/', '\'
$gitDir = Join-Path $cwdPath ".git"
if (Test-Path $gitDir -ErrorAction SilentlyContinue) {
    $branch = & git -C $cwdPath branch --show-current 2>$null
    if ($branch) {
        $gitBranch = " ($branch)"
    }
}

Key fixes:

  • Use git -C $path instead of cd $path && git ...
  • Add -ErrorAction SilentlyContinue for file system operations
  • Wrap all cross-drive operations in try-catch blocks
  • Ensure script always produces output even if some operations fail

Related Issues

  • #8265 (Path duplication on non-C drives)
  • #6526 (StatusLine not displaying on Windows)

Additional Notes

This issue is particularly difficult to diagnose because:

  1. The script works perfectly when tested manually from the command line
  2. The failure is completely silent - no error messages
  3. Many Windows users with multiple drives use this configuration (OS on C:, projects on D:/G:/etc.)

The /statusline setup command and documentation don't account for cross-drive scenarios on Windows.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗