howto
2026-01-18 → 2026-01-18
As I use Claude Code more, my workflow also becomes more commandline-centric. As you may know, a small annoyance that tags along the power of Command line interface is that it is hard to memorize all the how-tos (nobody remembers how to tar!). And that’s just one command among hundreds of CLI tools with their own flags and quirks.
I’ve tried tools like sgpt and llm, but I felt that they are too general & powerful, so overkills for this simple use case. I’ve also tried Warp as a modern terminal that has LLM integration, but it felt too heavy; I preferred the super lightweight Ghostty instead.
So, I wanted something simpler that doesn’t require API setting and maintenance. Basically, All I wanted to do:
howto clone anthropics/claude-code with gh # → gh repo clone anthropics/claude-code
howto find python files over 1mb # → fd -e py -S +1m
howto -m opus complex k8s query # use opus for harder tasks
Since I already have Claude Code installed, why not just use it? Claude Code could iterate on the prompt and generate this short script very quickly:
A gotcha was that running a script spawns a subshell, so commands like cd, export, and source won’t affect the current shell. The fix is a shell function that captures the command and evals it in the current shell. Add to .zshrc (or see the instructions on the gist):
howto() {
local cmd
cmd=$("$HOME/.local/bin/howto" "$@") || return 1
echo "$cmd"
echo -n "Execute? [Y/n/e] "
read -r REPLY
case "$REPLY" in
[nN]) echo "Aborted." ;;
[eE]) vared -p "Edit: " cmd && eval "$cmd" ;;
*) eval "$cmd" ;;
esac
}
Note that the shell script simply prints the command and then the wrapper lets you run the command & handles the subshell issue. So you want both implemented.