# A shell-native cd-compatible directory jumper using power-l…

I have used this tool privately since 2011 to manage directory jumping. While it is conceptually similar to tools like z or zoxide, the underlying ranking model is different. It uses a power-law convolution with the time series of cd actions to calculate a history-aware "frecency" metric instead of…

- **Page:** https://magpie.gallery/i/a-shell-native-cd-compatible-directory-jumper-usin-qgeb
- **Type:** Link to an idea elsewhere
- **Category:** Utilities
- **Runs on:** macos, linux
- **Tags:** shell, directory, cd, frecency, cli

## Source

Web · jghub: A shell-native cd-compatible directory jumper using power-law frecency

- **Original:** https://news.ycombinator.com/item?id=47245485

> I have used this tool privately since 2011 to manage directory jumping. While it is conceptually similar to tools like z or zoxide, the underlying ranking model is different. It uses a power-law convolution with the time series of cd actions to calculate a history-aware "frecency" metric instead of the standard heuristic counters and multipliers. This approach moves away from point-estimates for recency. Most tools look only at the timestamp of the last visit, which can allow a "one-off" burst of activity to clobber long-term habits. By convolving a configurable history window (typically the last 1,000+ events), the score balances consistent habits against recent flukes. On performance: Despite the O(N) complexity of calculating decay for 1,000+ events, query time is ~20-30ms (Real Time) in ksh/bash, which is well below the threshold of perceived lag. I intentionally chose a Logical Path (pwd -L) model. Preserving symlink names ensures that the "Name" remains the primary searchable key. Resolving to physical paths often strips away the very keyword the user intends to use for searching. https://github.com/jghub/sd-switchdir

## GitHub projects

- https://github.com/jghub/sd-switchdir

## Rules for reuse

- Build your own version: don't copy another product's code, look, icons, colours or copy.
- The original belongs to its author; Magpie only links to it.
- The original content's copyright belongs to its creator. Magpie doesn't download or re-upload it; we only show the link and the official preview.
