Show HN: A shell-native cd-compatible directory jumper using power-law frecency

cd gets a memory upgrade — fans rave, skeptics ask 'why bother'

TLDR: SD replaces cd with a smarter folder jumper that learns your habits using frequency and recency. The crowd is split: some cheer the math and frecency tricks, while others ask why it’s better than zoxide or plain cd, putting usability front and center.

Meet SD, the command that swaps in for your boring old cd and jumps to the folder you actually meant — because it remembers where you’ve been, how often, and how recently. Think “Spotify Wrapped” for directories, ranked by a math-y ‘power-law’ score. It even plays nice with Bash and Zsh, and shows matches in a fuzzy finder if you’ve got fzf. The creator insists it’s a drop-in replacement: type sd or cd, same result, but smarter. Patterns? It’ll match them, cycle through the best hits, and keep your next move feeling psychic. Nerds nod; newbs want fewer typos.

But the comments? On fire. Leftium rides in with a flex: you can compute “frecency” in constant time and links to Mozilla’s NewFrecency wiki. zahlman asks the blunt question: what problem is this solving over just using cd? Meanwhile ekropotin pokes the bear: if it’s “like z or zoxide,” does the fancy ranking actually matter for users? That sparked a mini identity crisis: is this smarter math or just a new spin on muscle memory? Jokes fly—“cd with ADHD,” “power-law for my messy home dir,” and “finally, my directories get clout.” Verdict: hype meets healthy skepticism, with a side of math flex.

Key Points

  • SD is a shell-native directory jumper that acts as a cd-compatible replacement for pathname arguments and adds pattern-based selection.
  • It ranks directories using a configurable power-law frecency model over a trailing window of recorded directory-change events.
  • Commands include sd (change directory by path or pattern) and ds (inspect/manage the ranked directory stack); cd is provided identically to sd.
  • Pattern matching uses regular expressions against full paths with smart case; multiple arguments merge into one pattern and whitespace is normalized.
  • If fzf is installed, matches are shown interactively; repeated identical invocations cycle deterministically through rank-ordered matches.

Hottest takes

"it is possible to efficiently compute frecency in O(1) complexity" — Leftium
"What happens differently when you use this command, versus when you use built-in `cd`?" — zahlman
"Does it really matter from usability perspective?" — ekropotin
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.