# Claude Code Custom Status Line Setup Guide for Windows

This guide will help you set up a custom status line for Claude Code on Windows that displays the current directory, model name, and time.

First some background…

I don’t think anyone in Anthropic’s Claude code team uses anything other then Mac because the documentation is really lacking as far as using Claude Code on Windows is concerned.

For example, try setting up the status-line inside claude code on windows and see what happens. I wasted couple of hours. But i got it working:-)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1755140186639/fe7f02de-65de-4f59-a97d-45131eae0c75.png align="center")

So in case, i have to do it again or when another lone windows claude code user is banging their head, here is how to setup Claude Code status-line on Windows inside Powershell.

## Step 1: Create the PowerShell Script

1. Open PowerShell
    
2. Create the script file:
    
    ```powershell
    New-Item -Path "~\.claude\claude-status.ps1" -ItemType File -Force
    ```
    
3. Add the script content:
    
    ```powershell
    Set-Content -Path "~\.claude\claude-status.ps1" -Value @'$input = $input | Out-Stringif ($input.Trim().Length -gt 0) {    try {        $json = $input | ConvertFrom-Json        $cwd = if ($json.workspace.current_dir) { Split-Path $json.workspace.current_dir -Leaf } else { "unknown" }        $model = if ($json.model.display_name) { $json.model.display_name } else { "unknown" }        $time = Get-Date -Format 'HH:mm'        Write-Output "$cwd | $model | $time"    } catch {        Write-Output "parse-error: $($_.Exception.Message)"    }} else {    Write-Output "no-input"}'@
    ```
    

## Step 2: Test the Script (Optional but Recommended)

1. Create test data:
    
    ```powershell
    $mockInput = @'
    {
      "workspace": {
        "current_dir": "C:\\Users\\YourUsername\\projects\\test-directory"
      },
      "model": {
        "display_name": "Claude Sonnet 4"
      }
    }
    '@
    ```
    
2. Test the script:
    
    ```powershell
    echo $mockInput | powershell -ExecutionPolicy Bypass -File ~\.claude\claude-status.ps1
    ```
    
    **Expected output**: `test-directory | Claude Sonnet 4 | 14:30`
    

## Step 3: Update Claude Code Settings

1. Find your Claude settings file at `~\.claude\settings.json`
    
2. If the file doesn't exist, create it:
    
    ```powershell
    New-Item -Path "~\.claude\settings.json" -ItemType File -Force
    ```
    
3. Add or update the settings file with this content:
    
    ```json
    {
      "statusLine": {
        "type": "command",
        "command": "powershell -ExecutionPolicy Bypass -File ~\\.claude\\claude-status.ps1"
      }
    }
    ```
    
    **⚠️ Important**: Use double backslashes (`\\`) in the JSON file for proper escaping.
    

## Step 4: Restart Claude Code

Close and reopen Claude Code. You should now see a status line showing:

* **Current directory name**
    
* **Model name**
    
* **Current time** (updates when the status refreshes)
    

## Troubleshooting

### If the status line doesn't appear:

1. **Check the script path exists**:
    
    ```powershell
    Test-Path ~\.claude\claude-status.ps1
    ```
    
2. **Test the script manually**: Run the test from Step 2 to verify the script works correctly.
    
3. **Verify settings file syntax**: Make sure your `settings.json` file has valid JSON syntax.
    
4. **Try full path format**: If using `~` doesn't work, replace `YourUsername` with your actual username:
    
    ```json
    {
      "statusLine": {
        "type": "command", 
        "command": "powershell -ExecutionPolicy Bypass -File C:\\Users\\YourUsername\\.claude\\claude-status.ps1"
      }
    }
    ```
    
5. **Check PowerShell execution policy**: If you get execution policy errors, you can temporarily allow script execution:
    
    ```powershell
    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
    ```
    

## What the Status Line Shows

The custom status line will display information in this format:

```bash
directory-name | Model Name | HH:MM
```

For example:

```bash
my-project | Claude Sonnet 4 | 14:30
```

## Customizing the Display

You can modify the script to change what information is shown or how it's formatted. Edit the line in the script that says:

```powershell
Write-Output "$cwd | $model | $time"
```

Some customization ideas:

* Change the separator from `|` to something else like `•` or `-`
    
* Add more information like git branch status
    
* Change the time format (e.g., `Get-Date -Format 'yyyy-MM-dd HH:mm'`)
    
* Add colors using PowerShell color codes
    

## Files Created

This setup creates two files in your `~\.claude\` directory:

* [`claude-status.ps`](http://claude-status.ps)`1` - The PowerShell script that generates the status
    
* `settings.json` - Claude Code configuration file (if it didn't exist already)
    

Both files can be safely edited or removed if you want to change or disable the custom status line.

Good Luck, fellow Windows claude code user:-)
