January 20, 2026
harpoon.zsh - quick access hooks for directories
harpoon.zsh is a small zsh script that allows hooking paths to aliases in order to be able to quickly jump between them.
I find this useful as I often encounter situations in my workflow where I jump back and forth between a few directories.
Hooking these directories to short aliases is much easier than having to remember and reference the full path of each directory when running cd.
When attaching a hook, the script associates a given name with the path of the current working directory, which is saved to a file. This name can then be referenced to quickly jump to the corresponding path.
Harpoon usage
Commands:
hook <name> add a hook <name> to the current directory
jump <name> cd to the directory referenced by <name>
unhook <name> remove hook <name>
hooks list current hooks
harpoon print this message
Example usage:
cd ~/projects/myapp
hook app
cd ~
jump app # instantly back to ~/projects/myapp
hooks # list all hooks
unhook app # remove the hook