#git #git-repository #frecency #compute #score #git-repository-analysis #cache-directory

bin+lib frecenfile

Compute frecency scores for files in a Git repository

8 unstable releases (3 breaking)

Uses new Rust 2024

0.4.1 Dec 20, 2025
0.4.0 May 10, 2025
0.3.0 May 5, 2025
0.2.3 May 1, 2025
0.1.0 May 1, 2025

#1443 in Development tools

Download history 1726/week @ 2025-11-12 3788/week @ 2025-11-19 1649/week @ 2025-11-26 1266/week @ 2025-12-03 1903/week @ 2025-12-10 2751/week @ 2025-12-17 1472/week @ 2025-12-24 400/week @ 2025-12-31 891/week @ 2026-01-07 1180/week @ 2026-01-14 443/week @ 2026-01-21 506/week @ 2026-01-28 107/week @ 2026-02-04 3/week @ 2026-02-11 24/week @ 2026-02-18 2/week @ 2026-02-25

139 downloads per month
Used in 3 crates

MIT license

18KB
382 lines

frecenfile

frecenfile computes frecency scores for files in Git repositories. Frecency combines the frequency and recency of events.

This is useful as a heauristic for finding relevant or trending files when all you have to work with is the commit history.

Performance

frecenfile is highly scalabe, producing a sorted output within miliseconds for mid-sized repositories, and processing the entire commit history Linux in under a minute. Processing the last 3000 commits in the Linux repository takes just around a second.

For most purposes, the results should be easily cacheable.

Cache

frecenfile stores a per-repo cache in the OS cache directory. You can override the location with FRECENFILE_CACHE_DIR. If the cache directory is not writable, frecenfile falls back to a temporary cache or no-cache mode instead of failing.

Git history

By default, frecenfile processes the last 3000 commits, but this can be modified using the --max-commits flag. Processing an excessive amounts of commits would not usually be usueful, as "trending" files are not likely to be buried deep in the commit history. Processing only a smaller amount of commits is not likely to be needed for performance reasons, but might be useful for some use cases.

📦 Installation

cargo install frecenfile

🚀 Usage

Score every file in the current repo, highest first

frecenfile

Only list paths, omit scores

frecenfile --path-only

Restrict analysis to certain directories

frecenfile --paths src tests

Sort oldest/least-touched files first

frecenfile --ascending

Example output

12.9423   src/lib.rs
 9.3310   src/analyze.rs
 2.7815   README.md

Dependencies

~19MB
~385K SLoC