- One Tip a Week
- Posts
- One Tip a Week: Speed Up Your Shell Startup by 95%
One Tip a Week: Speed Up Your Shell Startup by 95%
This week's tip of the week is lazy loading your shell configuration. If your terminal feels sluggish when opening new tabs, you might be loading tools you don't immediately need. Check out my recent post How I Used Claude Code to Speed Up My Shell Startup by 95% for all the details but here's a TLDR;
To see what's eating your startup time:
time zsh -i -c exitIf it's over 200ms, you've got room to improve. Self-destructing wrapper functions to the rescue.
# Instead of this running on every startup
eval "$(pyenv init -)"
# Use this wrapper instead
pyenv() {
unset -f pyenv
eval "$(command pyenv init -)"
pyenv "$@"
}The first time you run pyenv, the wrapper initializes it and removes itself. After that, it's direct execution with zero overhead.
The full post covers pyenv, gcloud, Homebrew caching, API key loading, or whatever tool you use.
That's it! Short and sweet. Until the next one!