Skip to main content

Command Palette

Search for a command to run...

Claude Code Custom Status Line Setup Guide for Windows

Published
3 min readView as Markdown
H

I build systems that blend AI and automation to solve real-world problems

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:-)

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:

     New-Item -Path "~\.claude\claude-status.ps1" -ItemType File -Force
    
  3. Add the script content:

     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"}'@
    
  1. Create test data:

     $mockInput = @'
     {
       "workspace": {
         "current_dir": "C:\\Users\\YourUsername\\projects\\test-directory"
       },
       "model": {
         "display_name": "Claude Sonnet 4"
       }
     }
     '@
    
  2. Test the script:

     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:

     New-Item -Path "~\.claude\settings.json" -ItemType File -Force
    
  3. Add or update the settings file with this content:

     {
       "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:

     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:

     {
       "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:

     Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
    

What the Status Line Shows

The custom status line will display information in this format:

directory-name | Model Name | HH:MM

For example:

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:

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.ps1 - 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:-)

More from this blog

Harish Garg | AI Automation & Agentic CLI Consulting

119 posts

Agentic CLI consulting for startups and teams. Claude Code, Gemini CLI, and Rovo Dev in practice. Playbooks, checklists, and real workflows. Contact: [email protected]