whatisgithub

What is gcan?

applicative-systems/gcan — explained in plain English

Analysis updated 2026-05-18

18RustAudience · ops devopsComplexity · 2/5LicenseSetup · easy

In one sentence

gcan finds what is quietly pinning gigabytes in your Nix store and lets you review, sort, and safely delete those roots from the command line or a TUI.

Mindmap

mindmap
  root((gcan))
    What it does
      Finds GC roots
      Ranks by size
      Groups direnv projects
    Tech stack
      Rust
      Terminal UI
    Use cases
      Free disk space
      Clean old projects
      Script cleanup
    Audience
      Nix users
      DevOps teams

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Find out why nix-collect-garbage keeps freeing almost no disk space.

USE CASE 2

See which old direnv projects are still holding gigabytes of Nix store data.

USE CASE 3

Delete old build results and stale profile generations safely, with confirmation.

USE CASE 4

Export the full GC root inventory as JSON to feed into your own cleanup scripts.

What is it built with?

Rust

How does it compare?

applicative-systems/gcanadindazu/ultimatevocalataraxy-labs/lazydiff
Stars181818
LanguageRustRustRust
Setup difficultyeasymoderateeasy
Complexity2/52/52/5
Audienceops devopsdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires an existing Nix installation, it has nothing to scan without one.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

So what is it?

Nix is a package manager that stores everything it installs in a special folder called the Nix store. Over time this folder can grow to take up many gigabytes of disk space. Nix has a built-in garbage collection command to clean it up, but it often frees very little because things called GC roots are holding onto data. A GC root is any pointer that tells Nix to keep something: a symlink left over from a build, a directory-specific environment managed by a tool called direnv, an old version of your installed software profile, and so on. gcan (pronounced like the question "g-can") is a tool that shows you all these GC roots sorted by how much disk space each one is actually keeping alive. This is different from how large the root itself is: a tiny symlink can pin a 5 GB dependency tree. The tool shows you the true cost of each root, where it lives on disk, and how old it is, so you can make informed decisions about what to remove. The tool has three modes. The list command prints a table of roots you can safely delete, with options to filter by minimum size and minimum age. The delete command removes roots that match filters you specify, optionally running garbage collection afterward to actually reclaim the disk space. The tui command opens a full-screen keyboard-driven interface where you can browse, sort, and delete roots interactively without typing repeated commands. For projects using direnv, which creates per-project Nix environments, gcan groups all the roots from the same project directory into one line so you see the total cost per project rather than dozens of individual cryptic hashes. The tool is designed to be safe by default. It never offers to delete system roots, the currently running system generation, or anything root-owned. Deletions through the interactive interface and the delete command both ask for confirmation first. JSON output and plain path output are available for use in scripts. The project is built in Rust, released under the MIT license, and developed by Applicative Systems.

Copy-paste prompts

Prompt 1
Show me the gcan command to list GC roots over 1GB that have not been touched in 30 days, sorted by age.
Prompt 2
Write a script that pipes gcan's paths only output into rm for roots larger than 2GB.
Prompt 3
Explain how gcan decides which GC roots are safe to delete versus protected.
Prompt 4
Help me set up a weekly cron job that runs gcan delete with the gc flag to reclaim space automatically.

Frequently asked questions

What is gcan?

gcan finds what is quietly pinning gigabytes in your Nix store and lets you review, sort, and safely delete those roots from the command line or a TUI.

What language is gcan written in?

Mainly Rust. The stack also includes Rust.

What license does gcan use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is gcan to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is gcan for?

Mainly ops devops.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.