Claude Picker: Smart Terminal Startup That Reads Your Mind

לחץ להאזנה

The micro-friction that kills flow: Every time I opened a new terminal, it landed in my home directory. I knew exactly which project I wanted to work on, but I still had to type cd project-name and then cld (my Claude Code alias). Two commands. Every. Single. Time.

So I asked Claude Code to fix it. Five minutes later, I had a smart terminal that reads my mind.

The Solution: Context-Aware Terminal Startup

Now when I open a terminal:

  • If I'm in home (~): An interactive project picker appears with fuzzy search
  • If I'm already in a project folder: Claude Code launches immediately

The picker uses fzf – the fuzzy finder that lets you type to filter, with a preview pane showing what's in each folder.

What It Looks Like

📂 Select project folder (or ESC to stay in ~)
┌──────────────────────────────────────────┐
│ Project:                                 │
├──────────────────────────────────────────┤
│ > ai-video-maker                         │
│   architect-workshops                    │
│   aviz-crm                               │
│   claude-skills-library                  │
│   inbox                                  │
│   remotion-assistant                     │
│   sb                                     │
│   tasks                                  │
└──────────────────────────────────────────┘

Type a few letters, hit Enter, and you're in your project with Claude Code running. Press ESC to stay in home.

Smart Features

  1. Filters system folders – Hides Library, Applications, Desktop, Downloads, etc.
  2. Preview pane – Shows ls -la of the hovered folder so you know what's inside
  3. Runs once per session – Opening new tabs won't re-trigger the picker
  4. Context-aware – Skips the picker inside VS Code or Claude Code subshells

The Implementation

It's a bash script that sources from .bash_profile:

#!/bin/bash
# Skip if not interactive / already ran / inside Claude
[[ $- != *i* ]] && return
[[ -n "$CLAUDE_PICKER_RAN" ]] && return
export CLAUDE_PICKER_RAN=1

claude_picker() {
    if [[ "$(pwd)" == "$HOME" ]]; then
        selected=$(find "$HOME" -maxdepth 1 -type d \
            ! -name ".*" ! -name "Library" ! -name "Applications" \
            ! -name "Desktop" ! -name "Downloads" -print | \
            sed "s|$HOME/||" | sort | \
            fzf --height=40% --reverse --border \
                --prompt="Project: " \
                --preview="ls -la $HOME/{} | head -20")

        if [[ -n "$selected" ]]; then
            cd "$HOME/$selected"
            cld  # Claude Code alias
        fi
    else
        cld
    fi
}

claude_picker

How Claude Code Built This in 5 Minutes

The conversation went like this:

  1. My request: "every new terminal… if inside ~ folder… let me choose from folders"
  2. Claude investigates: Checked my shell config, found I'm using bash
  3. First attempt: Added to .bashrc
  4. My feedback: "doesn't work"
  5. Claude debugs: Realized macOS Terminal sources .bash_profile, not .bashrc
  6. Fixed: Moved the source to .bash_profile
  7. Done.

This is what working with Claude Code feels like. You describe the friction, and it disappears.

Try It Yourself

  1. Install fzf: brew install fzf
  2. Create the script at ~/bin/claude-picker.sh
  3. Add source ~/bin/claude-picker.sh to your shell profile
  4. Open a new terminal and enjoy

Small automations like this compound. Every terminal session saved 5 seconds and a mental context switch. Over a day of heavy coding, that's real focus preserved.


Comments

כתיבת תגובה

האימייל לא יוצג באתר. שדות החובה מסומנים *