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
- Filters system folders – Hides Library, Applications, Desktop, Downloads, etc.
- Preview pane – Shows
ls -laof the hovered folder so you know what's inside - Runs once per session – Opening new tabs won't re-trigger the picker
- 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:
- My request: "every new terminal… if inside ~ folder… let me choose from folders"
- Claude investigates: Checked my shell config, found I'm using bash
- First attempt: Added to
.bashrc - My feedback: "doesn't work"
- Claude debugs: Realized macOS Terminal sources
.bash_profile, not.bashrc - Fixed: Moved the source to
.bash_profile - Done.
This is what working with Claude Code feels like. You describe the friction, and it disappears.
Try It Yourself
- Install fzf:
brew install fzf - Create the script at
~/bin/claude-picker.sh - Add
source ~/bin/claude-picker.shto your shell profile - 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.
כתיבת תגובה