See where your disk space went. A fast, zoomable treemap of your drives for Windows: filter in plain language, fly into folders, and clean up right from the map. Portable single exe or installer.
See the code
See where your disk space went.
A fast, zoomable treemap of your drives for Windows, in the spirit of SpaceMonger.
Illustration with sample data
SpaceSharp scans a drive or folder and draws every file and folder as a box whose area matches its size. Folders are boxes with a title bar, and their contents are laid out inside them, so the files and folders eating your space are obvious at a glance. Zoom into any folder, pan around, and send what you don't need to the Recycle Bin without leaving the map.
It's a single, portable .exe with no installer and no dependencies.
Scanning
WinSxS) is counted onceThe map
Users › adria › AppData › Local) are merged into a single box with a combined title, instead of a stack of thin framesZoom and navigation
Finding things
*.mp4, >500MB, older than 1 year, type:video or part of a name, and everything that doesn't match dims. The layout stays put, so you see where the matches are. Terms combine.Colors and themes
Cleaning up
Other
Two options on the Releases page, both for 64-bit Windows 10 and 11 (Windows on ARM works through x64 emulation):
| Download | Best for |
|---|---|
| SpaceSharp-win-x64.msi | A regular Windows installer where you choose the install folder and whether to install for you or for everyone. Adds a Start menu entry and updates itself. |
| SpaceSharp-win-Setup.exe | One-click install to your user profile (%LocalAppData%\SpaceSharp), no questions asked, no admin rights. Also updates itself. Run it as SpaceSharp-win-Setup.exe --installto "D:\Apps\SpaceSharp" to pick another folder. |
| SpaceSharp.exe | A single portable file. Nothing to install, but you update it by downloading the new version yourself. |
[!NOTE] The exe isn't code-signed, so Windows SmartScreen may show "Windows protected your PC" the first time you run it. Click More info, then Run anyway.
The first launch is a little slower than the ones after it, because the portable exe unpacks itself once.
To see protected system folders, run SpaceSharp as administrator. Otherwise those folders are skipped and marked as unreadable.
The gear button in the toolbar (or Ctrl+,) opens the settings window. Every change applies immediately and is saved.
| Setting | What it does |
|---|---|
| Theme | Match Windows, Light or Dark. |
| Palette and Color by | The same choices as in the toolbar. |
| Map style | Classic, Tiles, Cards, Bands, Terraces or Soft. Same layout, different look; S cycles. |
| Label size | Normal, Large or Larger text on the map. Title bars grow to match. |
| Outlined labels | A thin contrasting outline around every label. Recommended if the map is hard to read. |
| Cushion shading | Soft light-to-dark shading on each box in the Classic style. |
| Size measure | File size, or size on disk: the compressed size of compressed, sparse and cloud files, rounded up to whole clusters, like Explorer's "Size on disk". |
| Show free space | Adds a gray block for the drive's unused space when a whole drive is scanned. Off by default. |
| Merge single-folder chains | Draw folders that only contain one folder as a single box with a combined title. |
| Group small items | Replace children that would be smaller than about 30 × 22 px with a single "N files" box. |
| Hover details | The info card next to the mouse. |
| Show side panel | The panel on the left with your drives and the largest items. |
| Animate zoom | Fly into folders instead of jumping. |
| Include hidden and system files | Off leaves out Hidden and System items such as pagefile.sys. Applies to the next scan. |
| Count hard links once | Reads every file's link count so data with several names (Windows keeps thousands in WinSxS) is counted once. Slower on big drives, off by default, applies to the next scan. |
| Confirm before moving to the Recycle Bin | Ask before deleting. |
| Check for updates on startup | Installed copies look for a new release on GitHub a few seconds after launch. The portable exe can't update itself. |
Reset to defaults puts everything back. When folders couldn't be read, a notice appears under the toolbar with a Restart as administrator button; SpaceSharp restarts elevated and scans the same drive again.
Press Ctrl+F or click the filter box above the map. Everything that doesn't match is dimmed; the layout stays put so you can see where the matches are.
The easy way: click the funnel button in the box. A panel opens with quick filters ("Large files", "Big videos", "Untouched for 2 years"…), a name field, file type chips, size and age drop-downs, and a files/folders switch. It writes the filter text for you, so you can also learn the syntax from it.
The fast way: type it. Plain language works: videos over 500MB not touched in 2 years, photos larger than 10 MB, .iso, installer. Everything you type must match. The parts it understands:
| You can type | Meaning |
|---|---|
*.mp4 *.mkv, .iso, report | Name patterns (OR-ed), an extension, or text the name contains |
videos, photos, music, archives, programs, documents, code, type:video,audio | File type |
>1GB, over 500 MB, larger than 2 GB, at least 100MB | Minimum size (a bare number means MB) |
<10MB, under 1 GB, smaller than 500MB | Maximum size |
older than 2 years, not modified in 6 months, unused for 1 year, over 3 years old | Not changed for that long |
newer than 30 days, modified in the last week, last 2 months | Changed recently |
files, folders, is:file, is:folder | Only files or only folders |
The bar then shows how many files match and their total size. Select matches (Ctrl+A) selects all of them, and Del sends them to the Recycle Bin in one go.
| Mode | What the colors mean |
|---|---|
| Depth | Each nesting level gets its own color, like classic SpaceMonger. Files are a lighter shade of their folder's color. |
| File type | Files are colored by category (images, video, audio, archives, programs, documents, code, other) and folders are neutral gray. A legend appears next to the breadcrumb. |
| Palette | Look |
|---|---|
| Pastel | Soft colors, the default |
| Retro | Bright primaries, close to classic SpaceMonger |
| Ocean | Blues and teals |
| Sunset | Reds, oranges and plums |
| Forest | Greens and earth tones |
| Neon | Dark folders with bright neon files |
| Monochrome | Grays, with archives in amber in file-type mode |
| Color-blind safe | The Okabe-Ito palette, distinguishable with all common types of color blindness |
| Input | Action |
|---|---|
| Double-click, Enter | Zoom the map to a folder (a file zooms to its folder) |
| Mouse wheel | Zoom in or out around the cursor |
+ / − | Zoom in or out around the center |
| Left or middle drag | Pan while zoomed in |
| Backspace, mouse back button | Up one folder |
| Home, Ctrl+0 | Show the whole map |
| F5 | Rescan |
| Ctrl+C | Copy the selected paths |
| Ctrl+click, Shift+click | Select several items |
| Ctrl+F | Filter the map |
| Ctrl+A | Select every file matching the filter |
| L | Largest files, folders and types panel |
| Ctrl+, | Settings |
| Del | Move the selected items to the Recycle Bin |
| S | Next map style |
| C | Toggle cushion shading |
| G | Toggle grouping of small items |
| Esc | Cancel a scan |
| F1 | About |
Requirements
With Rider
SpaceSharp.sln.From the command line, in the cloned repository:
dotnet run --project .\SpaceSharp\SpaceSharp.csproj
The app's only NuGet dependency is Velopack, used for the installer and updates.
Tests
SpaceSharp.Tests covers the parts that don't need a screen: the treemap layout, the filter parser and matcher, size formatting, and the tree operations behind delete and free space.
dotnet test
Every push and pull request runs the build and the tests on GitHub Actions (.github/workflows/build.yml). Releases are built locally with the release script below, not by CI.
Three publish profiles are included in SpaceSharp/Properties/PublishProfiles.
Portable: one exe with .NET built in. Runs on any 64-bit Windows 10/11 PC. About 30–40 MB.
dotnet publish .\SpaceSharp\SpaceSharp.csproj -p:PublishProfile=Portable
Small: a much smaller exe that needs the .NET 10 Desktop Runtime installed. If it's missing, Windows shows a download prompt.
dotnet publish .\SpaceSharp\SpaceSharp.csproj -p:PublishProfile=Small
Installer with auto-update (Velopack). Install the packaging tool once with dotnet tool install -g vpk, then run the release script from the repository root:
.\installer\release.ps1
It runs the tests, publishes the portable exe and the Velopack folder, downloads the previous release for a delta package, runs vpk pack with the MSI options, and finishes with installer\brand-msi.ps1, which writes the branded dialog images into the MSI and fixes the desktop shortcut description. This is the only way releases are built; CI builds and tests but never publishes. Add -SkipDelta for a first release, or -Upload (with $env:GITHUB_TOKEN set) to publish straight to a GitHub release. If Windows refuses to run the scripts, Unblock-File .\installer\*.ps1 once.
The output lands in Releases\: SpaceSharp-win-Setup.exe, the .msi, SpaceSharp-win-Portable.zip, the .nupkg update packages and releases.win.json. Upload all of them to the GitHub release, because installed copies read releases.win.json and the .nupkg files to update. The installer folder holds the wizard's welcome, license and finish pages and the two dialog images (banner.bmp 493×58, logo.bmp 493×312), both generated by tools/make-assets.py.
The same steps by hand, if you prefer:
dotnet publish .\SpaceSharp\SpaceSharp.csproj -p:PublishProfile=Velopack
vpk download github --repoUrl https://github.com/ClearanceClarence/SpaceSharp
vpk pack --packId SpaceSharp --packVersion 1.2.1 --packDir .\publish\velopack --mainExe SpaceSharp.exe --packTitle SpaceSharp --packAuthors ClearanceClarence --icon .\SpaceSharp\Assets\SpaceSharp.ico --splashImage .\SpaceSharp\Assets\SpaceSharp-256.png --msi --instLocation Either --instWelcome .\installer\welcome.md --instLicense .\installer\license.txt --instConclusion .\installer\conclusion.md
.\installer\brand-msi.ps1
The plain exes are written to publish\portable\ and publish\small\. In Rider, all profiles also show up as run configurations.
Scanning (Services/DiskScanner.cs)
The scanner walks the folder tree on background threads with DirectoryInfo.EnumerateFileSystemInfos. The top three levels are scanned in parallel. Sizes are summed bottom-up, and each folder's children are sorted largest first, which the layout depends on. Progress counters are read by the UI a few times per second, so the scan never waits on the UI.
Layout (Layout/Squarify.cs)
Boxes are placed with the squarified treemap algorithm by Bruls, Huizing and van Wijk. Items are added to a row along the shorter side of the remaining space for as long as that improves the worst aspect ratio in the row, which produces boxes that are close to square.
Rendering and zoom (Controls/TreemapControl.cs)
The map is a custom WPF element that draws into DrawingVisuals instead of creating a control per box, so tens of thousands of boxes stay fast.
Zooming doesn't scale a picture. The map is laid out again on a virtual canvas that is the window size times the zoom level, shifted by the pan offset. Small files get real pixels and sharp labels as you zoom in, and only boxes that intersect the window are laid out and drawn, which keeps deep zoom fast.
Zooming to a folder is an animated camera move. It interpolates the zoom level logarithmically and moves the center so the camera appears to zoom toward a fixed point. Because title bars have a fixed pixel height, a folder's position shifts slightly with zoom, so the target is refined every frame and the view snaps to the exact framing at the end.
Hover and selection outlines live on a separate overlay, so moving the mouse doesn't redraw the map.
Themes (Util/ThemeManager.cs, Themes/)
All control styles are in Styles.xaml and reference colors through DynamicResource. Switching themes swaps Dark.xaml for Light.xaml, and every open window recolors immediately. In "Match Windows" mode, SpaceSharp reads the Windows app theme from the registry and listens for changes.
Sizes (Services/NativeFileInfo.cs)
Size on disk comes from GetCompressedFileSizeW for compressed, sparse, offline and cloud-placeholder files and from the plain length for everything else, rounded up to the volume's cluster size (GetDiskFreeSpaceW). Hard-link detection opens each file for attribute access only and reads its link count and file ID with GetFileInformationByHandle; a file whose ID was already seen is kept in the tree but contributes no size.
Filtering (Services/FileFilter.cs)
The filter text is parsed into a list of conditions. The whole tree is evaluated once per change (a few milliseconds per hundred thousand files); files match on their own, and a folder is kept lit when anything inside it matches, so the path to every hit stays visible. The map then draws non-matching boxes blended toward the background, without changing the layout.
Top lists (Services/TopLists.cs)
The largest files and folders are found with a priority queue in one pass over the tree, so the panel is instant even on millions of files. Space by type aggregates files by extension.
Updates (Services/Updater.cs, Program.cs)
The Velopack Setup.exe installs SpaceSharp per user and creates shortcuts; the .msi lets the user choose the folder and scope. Both update the same way afterwards. On startup Program.Main runs Velopack's hooks before WPF loads. When installed that way, SpaceSharp checks GitHub Releases a few seconds after launch (Settings → Updates), and offers a one-click "Install and restart" that downloads a delta package and swaps in the new version. The portable exe reports itself as not installed and never updates on its own.
Deleting (Services/RecycleBin.cs)
Items are sent to the Recycle Bin through the Windows shell (SHFileOperation with undo enabled). Windows warns you if an item is too big for the Recycle Bin. After a successful delete, the node is removed from the tree and its size is subtracted from every parent.
SpaceSharp.sln
SpaceSharp/
├── App.xaml(.cs) startup, theme setup, error dialog
├── MainWindow.xaml(.cs) main UI: toolbar, breadcrumb, map, status bar
├── AboutWindow.xaml(.cs) About window
├── SettingsWindow.xaml(.cs) settings window
├── Controls/
│ └── TreemapControl.cs map rendering, zoom camera, hit testing, input
├── Layout/
│ └── Squarify.cs squarified treemap algorithm
├── Models/
│ └── FsNode.cs file/folder tree
├── Program.cs entry point running Velopack before WPF
├── Services/
│ ├── FileFilter.cs filter text parser and tree evaluation
│ ├── TopLists.cs largest files/folders and space by type
│ ├── Updater.cs GitHub Releases update check and install
│ ├── DiskScanner.cs background scanner with progress, size on disk, hard links
│ ├── NativeFileInfo.cs Win32 calls for cluster size, compressed size and file IDs
│ └── RecycleBin.cs undoable delete through the Windows shell
├── Util/
│ ├── Palette.cs color palettes and file-type categories
│ ├── ThemeManager.cs light/dark switching
│ ├── TitleBarTheme.cs light/dark window title bars
│ ├── AppSettings.cs saved preferences
│ └── SizeFormatter.cs "1.23 GB" formatting
├── Themes/
│ ├── Styles.xaml control styles (buttons, drop-downs, menus, tooltips)
│ ├── Dark.xaml dark theme colors
│ └── Light.xaml light theme colors
├── Assets/
│ ├── SpaceSharp.svg icon source
│ ├── SpaceSharp-small.svg simplified icon for 16–24 px
│ ├── SpaceSharp.ico icon with all Windows sizes (16–256 px)
│ └── SpaceSharp-256.png icon used in the app UI
├── Properties/PublishProfiles/ Portable, Small and Velopack publish profiles
├── app.manifest DPI and long-path awareness
└── SpaceSharp.csproj
SpaceSharp.Tests/ xUnit tests for layout, filter, formatting and tree operations
docs/ landing page (GitHub Pages), screenshots, icon, header and social preview
tools/make-assets.py regenerates every icon, preview and installer image from the mark
installer/ MSI wizard pages, dialog images, release.ps1 and brand-msi.ps1
.github/ issue forms, pull request template, build workflow, Dependabot
Add a palette
Add an entry to BuildSchemes() in Util/Palette.cs. The simplest form is a name and a list of folder colors; file colors and file-type colors are derived from them:
FromList("Lavender",
new[] { "#7B6FD6", "#9A8FE0", "#B7A8E8", "#6C8FD6", "#A58CC9", "#8D7BB8", "#C6A0D8" }, 0.5),
You can also pass your own file-type colors as a third argument, one per category in the order of the FileCategory enum.
Change theme colors
Edit the hex values in Themes/Dark.xaml or Themes/Light.xaml. Both files must define the same keys.
Add file types
Extensions and their categories are listed in BuildExtensionMap() in Util/Palette.cs.
Name, version and author
These come from SpaceSharp.csproj (Version, Authors, Copyright, Description) and appear in the About window and in the exe's file properties.
Icon
The mark is nine cells on a charcoal tile; the gutters form the # in Sharp and brightness follows size. Every brand asset is generated from one definition in tools/make-assets.py (Python 3 with Pillow; it downloads Bricolage Grotesque from its GitHub repository for the wordmark). Running it rewrites Assets/SpaceSharp.svg, SpaceSharp-small.svg (the four-cell version used at 16 to 24 px), SpaceSharp.ico, SpaceSharp-256.png, the icons and previews in docs/, and the two installer bitmaps, so change the cells or colors there rather than editing the files by hand.
Your palette, color mode and theme are saved to:
%AppData%\SpaceSharp\settings.json
Delete the file to go back to the defaults.
C:\Windows\WinSxS can look bigger than it is by default.SpaceSharp is released under the MIT License. You're free to use, modify and share it, including in commercial projects, as long as the copyright notice is kept.
Made by ClearanceClarence.
18 commits
C#
91.8%
Python
5.3%
PowerShell
2.9%
See where your disk space went. A fast, zoomable treemap of your drives for Windows: filter in plain language, fly into folders, and clean up right from the map. Portable single exe or installer.
See the code
See where your disk space went.
A fast, zoomable treemap of your drives for Windows, in the spirit of SpaceMonger.
Illustration with sample data
SpaceSharp scans a drive or folder and draws every file and folder as a box whose area matches its size. Folders are boxes with a title bar, and their contents are laid out inside them, so the files and folders eating your space are obvious at a glance. Zoom into any folder, pan around, and send what you don't need to the Recycle Bin without leaving the map.
It's a single, portable .exe with no installer and no dependencies.
Scanning
WinSxS) is counted onceThe map
Users › adria › AppData › Local) are merged into a single box with a combined title, instead of a stack of thin framesZoom and navigation
Finding things
*.mp4, >500MB, older than 1 year, type:video or part of a name, and everything that doesn't match dims. The layout stays put, so you see where the matches are. Terms combine.Colors and themes
Cleaning up
Other
Two options on the Releases page, both for 64-bit Windows 10 and 11 (Windows on ARM works through x64 emulation):
| Download | Best for |
|---|---|
| SpaceSharp-win-x64.msi | A regular Windows installer where you choose the install folder and whether to install for you or for everyone. Adds a Start menu entry and updates itself. |
| SpaceSharp-win-Setup.exe | One-click install to your user profile (%LocalAppData%\SpaceSharp), no questions asked, no admin rights. Also updates itself. Run it as SpaceSharp-win-Setup.exe --installto "D:\Apps\SpaceSharp" to pick another folder. |
| SpaceSharp.exe | A single portable file. Nothing to install, but you update it by downloading the new version yourself. |
[!NOTE] The exe isn't code-signed, so Windows SmartScreen may show "Windows protected your PC" the first time you run it. Click More info, then Run anyway.
The first launch is a little slower than the ones after it, because the portable exe unpacks itself once.
To see protected system folders, run SpaceSharp as administrator. Otherwise those folders are skipped and marked as unreadable.
The gear button in the toolbar (or Ctrl+,) opens the settings window. Every change applies immediately and is saved.
| Setting | What it does |
|---|---|
| Theme | Match Windows, Light or Dark. |
| Palette and Color by | The same choices as in the toolbar. |
| Map style | Classic, Tiles, Cards, Bands, Terraces or Soft. Same layout, different look; S cycles. |
| Label size | Normal, Large or Larger text on the map. Title bars grow to match. |
| Outlined labels | A thin contrasting outline around every label. Recommended if the map is hard to read. |
| Cushion shading | Soft light-to-dark shading on each box in the Classic style. |
| Size measure | File size, or size on disk: the compressed size of compressed, sparse and cloud files, rounded up to whole clusters, like Explorer's "Size on disk". |
| Show free space | Adds a gray block for the drive's unused space when a whole drive is scanned. Off by default. |
| Merge single-folder chains | Draw folders that only contain one folder as a single box with a combined title. |
| Group small items | Replace children that would be smaller than about 30 × 22 px with a single "N files" box. |
| Hover details | The info card next to the mouse. |
| Show side panel | The panel on the left with your drives and the largest items. |
| Animate zoom | Fly into folders instead of jumping. |
| Include hidden and system files | Off leaves out Hidden and System items such as pagefile.sys. Applies to the next scan. |
| Count hard links once | Reads every file's link count so data with several names (Windows keeps thousands in WinSxS) is counted once. Slower on big drives, off by default, applies to the next scan. |
| Confirm before moving to the Recycle Bin | Ask before deleting. |
| Check for updates on startup | Installed copies look for a new release on GitHub a few seconds after launch. The portable exe can't update itself. |
Reset to defaults puts everything back. When folders couldn't be read, a notice appears under the toolbar with a Restart as administrator button; SpaceSharp restarts elevated and scans the same drive again.
Press Ctrl+F or click the filter box above the map. Everything that doesn't match is dimmed; the layout stays put so you can see where the matches are.
The easy way: click the funnel button in the box. A panel opens with quick filters ("Large files", "Big videos", "Untouched for 2 years"…), a name field, file type chips, size and age drop-downs, and a files/folders switch. It writes the filter text for you, so you can also learn the syntax from it.
The fast way: type it. Plain language works: videos over 500MB not touched in 2 years, photos larger than 10 MB, .iso, installer. Everything you type must match. The parts it understands:
| You can type | Meaning |
|---|---|
*.mp4 *.mkv, .iso, report | Name patterns (OR-ed), an extension, or text the name contains |
videos, photos, music, archives, programs, documents, code, type:video,audio | File type |
>1GB, over 500 MB, larger than 2 GB, at least 100MB | Minimum size (a bare number means MB) |
<10MB, under 1 GB, smaller than 500MB | Maximum size |
older than 2 years, not modified in 6 months, unused for 1 year, over 3 years old | Not changed for that long |
newer than 30 days, modified in the last week, last 2 months | Changed recently |
files, folders, is:file, is:folder | Only files or only folders |
The bar then shows how many files match and their total size. Select matches (Ctrl+A) selects all of them, and Del sends them to the Recycle Bin in one go.
| Mode | What the colors mean |
|---|---|
| Depth | Each nesting level gets its own color, like classic SpaceMonger. Files are a lighter shade of their folder's color. |
| File type | Files are colored by category (images, video, audio, archives, programs, documents, code, other) and folders are neutral gray. A legend appears next to the breadcrumb. |
| Palette | Look |
|---|---|
| Pastel | Soft colors, the default |
| Retro | Bright primaries, close to classic SpaceMonger |
| Ocean | Blues and teals |
| Sunset | Reds, oranges and plums |
| Forest | Greens and earth tones |
| Neon | Dark folders with bright neon files |
| Monochrome | Grays, with archives in amber in file-type mode |
| Color-blind safe | The Okabe-Ito palette, distinguishable with all common types of color blindness |
| Input | Action |
|---|---|
| Double-click, Enter | Zoom the map to a folder (a file zooms to its folder) |
| Mouse wheel | Zoom in or out around the cursor |
+ / − | Zoom in or out around the center |
| Left or middle drag | Pan while zoomed in |
| Backspace, mouse back button | Up one folder |
| Home, Ctrl+0 | Show the whole map |
| F5 | Rescan |
| Ctrl+C | Copy the selected paths |
| Ctrl+click, Shift+click | Select several items |
| Ctrl+F | Filter the map |
| Ctrl+A | Select every file matching the filter |
| L | Largest files, folders and types panel |
| Ctrl+, | Settings |
| Del | Move the selected items to the Recycle Bin |
| S | Next map style |
| C | Toggle cushion shading |
| G | Toggle grouping of small items |
| Esc | Cancel a scan |
| F1 | About |
Requirements
With Rider
SpaceSharp.sln.From the command line, in the cloned repository:
dotnet run --project .\SpaceSharp\SpaceSharp.csproj
The app's only NuGet dependency is Velopack, used for the installer and updates.
Tests
SpaceSharp.Tests covers the parts that don't need a screen: the treemap layout, the filter parser and matcher, size formatting, and the tree operations behind delete and free space.
dotnet test
Every push and pull request runs the build and the tests on GitHub Actions (.github/workflows/build.yml). Releases are built locally with the release script below, not by CI.
Three publish profiles are included in SpaceSharp/Properties/PublishProfiles.
Portable: one exe with .NET built in. Runs on any 64-bit Windows 10/11 PC. About 30–40 MB.
dotnet publish .\SpaceSharp\SpaceSharp.csproj -p:PublishProfile=Portable
Small: a much smaller exe that needs the .NET 10 Desktop Runtime installed. If it's missing, Windows shows a download prompt.
dotnet publish .\SpaceSharp\SpaceSharp.csproj -p:PublishProfile=Small
Installer with auto-update (Velopack). Install the packaging tool once with dotnet tool install -g vpk, then run the release script from the repository root:
.\installer\release.ps1
It runs the tests, publishes the portable exe and the Velopack folder, downloads the previous release for a delta package, runs vpk pack with the MSI options, and finishes with installer\brand-msi.ps1, which writes the branded dialog images into the MSI and fixes the desktop shortcut description. This is the only way releases are built; CI builds and tests but never publishes. Add -SkipDelta for a first release, or -Upload (with $env:GITHUB_TOKEN set) to publish straight to a GitHub release. If Windows refuses to run the scripts, Unblock-File .\installer\*.ps1 once.
The output lands in Releases\: SpaceSharp-win-Setup.exe, the .msi, SpaceSharp-win-Portable.zip, the .nupkg update packages and releases.win.json. Upload all of them to the GitHub release, because installed copies read releases.win.json and the .nupkg files to update. The installer folder holds the wizard's welcome, license and finish pages and the two dialog images (banner.bmp 493×58, logo.bmp 493×312), both generated by tools/make-assets.py.
The same steps by hand, if you prefer:
dotnet publish .\SpaceSharp\SpaceSharp.csproj -p:PublishProfile=Velopack
vpk download github --repoUrl https://github.com/ClearanceClarence/SpaceSharp
vpk pack --packId SpaceSharp --packVersion 1.2.1 --packDir .\publish\velopack --mainExe SpaceSharp.exe --packTitle SpaceSharp --packAuthors ClearanceClarence --icon .\SpaceSharp\Assets\SpaceSharp.ico --splashImage .\SpaceSharp\Assets\SpaceSharp-256.png --msi --instLocation Either --instWelcome .\installer\welcome.md --instLicense .\installer\license.txt --instConclusion .\installer\conclusion.md
.\installer\brand-msi.ps1
The plain exes are written to publish\portable\ and publish\small\. In Rider, all profiles also show up as run configurations.
Scanning (Services/DiskScanner.cs)
The scanner walks the folder tree on background threads with DirectoryInfo.EnumerateFileSystemInfos. The top three levels are scanned in parallel. Sizes are summed bottom-up, and each folder's children are sorted largest first, which the layout depends on. Progress counters are read by the UI a few times per second, so the scan never waits on the UI.
Layout (Layout/Squarify.cs)
Boxes are placed with the squarified treemap algorithm by Bruls, Huizing and van Wijk. Items are added to a row along the shorter side of the remaining space for as long as that improves the worst aspect ratio in the row, which produces boxes that are close to square.
Rendering and zoom (Controls/TreemapControl.cs)
The map is a custom WPF element that draws into DrawingVisuals instead of creating a control per box, so tens of thousands of boxes stay fast.
Zooming doesn't scale a picture. The map is laid out again on a virtual canvas that is the window size times the zoom level, shifted by the pan offset. Small files get real pixels and sharp labels as you zoom in, and only boxes that intersect the window are laid out and drawn, which keeps deep zoom fast.
Zooming to a folder is an animated camera move. It interpolates the zoom level logarithmically and moves the center so the camera appears to zoom toward a fixed point. Because title bars have a fixed pixel height, a folder's position shifts slightly with zoom, so the target is refined every frame and the view snaps to the exact framing at the end.
Hover and selection outlines live on a separate overlay, so moving the mouse doesn't redraw the map.
Themes (Util/ThemeManager.cs, Themes/)
All control styles are in Styles.xaml and reference colors through DynamicResource. Switching themes swaps Dark.xaml for Light.xaml, and every open window recolors immediately. In "Match Windows" mode, SpaceSharp reads the Windows app theme from the registry and listens for changes.
Sizes (Services/NativeFileInfo.cs)
Size on disk comes from GetCompressedFileSizeW for compressed, sparse, offline and cloud-placeholder files and from the plain length for everything else, rounded up to the volume's cluster size (GetDiskFreeSpaceW). Hard-link detection opens each file for attribute access only and reads its link count and file ID with GetFileInformationByHandle; a file whose ID was already seen is kept in the tree but contributes no size.
Filtering (Services/FileFilter.cs)
The filter text is parsed into a list of conditions. The whole tree is evaluated once per change (a few milliseconds per hundred thousand files); files match on their own, and a folder is kept lit when anything inside it matches, so the path to every hit stays visible. The map then draws non-matching boxes blended toward the background, without changing the layout.
Top lists (Services/TopLists.cs)
The largest files and folders are found with a priority queue in one pass over the tree, so the panel is instant even on millions of files. Space by type aggregates files by extension.
Updates (Services/Updater.cs, Program.cs)
The Velopack Setup.exe installs SpaceSharp per user and creates shortcuts; the .msi lets the user choose the folder and scope. Both update the same way afterwards. On startup Program.Main runs Velopack's hooks before WPF loads. When installed that way, SpaceSharp checks GitHub Releases a few seconds after launch (Settings → Updates), and offers a one-click "Install and restart" that downloads a delta package and swaps in the new version. The portable exe reports itself as not installed and never updates on its own.
Deleting (Services/RecycleBin.cs)
Items are sent to the Recycle Bin through the Windows shell (SHFileOperation with undo enabled). Windows warns you if an item is too big for the Recycle Bin. After a successful delete, the node is removed from the tree and its size is subtracted from every parent.
SpaceSharp.sln
SpaceSharp/
├── App.xaml(.cs) startup, theme setup, error dialog
├── MainWindow.xaml(.cs) main UI: toolbar, breadcrumb, map, status bar
├── AboutWindow.xaml(.cs) About window
├── SettingsWindow.xaml(.cs) settings window
├── Controls/
│ └── TreemapControl.cs map rendering, zoom camera, hit testing, input
├── Layout/
│ └── Squarify.cs squarified treemap algorithm
├── Models/
│ └── FsNode.cs file/folder tree
├── Program.cs entry point running Velopack before WPF
├── Services/
│ ├── FileFilter.cs filter text parser and tree evaluation
│ ├── TopLists.cs largest files/folders and space by type
│ ├── Updater.cs GitHub Releases update check and install
│ ├── DiskScanner.cs background scanner with progress, size on disk, hard links
│ ├── NativeFileInfo.cs Win32 calls for cluster size, compressed size and file IDs
│ └── RecycleBin.cs undoable delete through the Windows shell
├── Util/
│ ├── Palette.cs color palettes and file-type categories
│ ├── ThemeManager.cs light/dark switching
│ ├── TitleBarTheme.cs light/dark window title bars
│ ├── AppSettings.cs saved preferences
│ └── SizeFormatter.cs "1.23 GB" formatting
├── Themes/
│ ├── Styles.xaml control styles (buttons, drop-downs, menus, tooltips)
│ ├── Dark.xaml dark theme colors
│ └── Light.xaml light theme colors
├── Assets/
│ ├── SpaceSharp.svg icon source
│ ├── SpaceSharp-small.svg simplified icon for 16–24 px
│ ├── SpaceSharp.ico icon with all Windows sizes (16–256 px)
│ └── SpaceSharp-256.png icon used in the app UI
├── Properties/PublishProfiles/ Portable, Small and Velopack publish profiles
├── app.manifest DPI and long-path awareness
└── SpaceSharp.csproj
SpaceSharp.Tests/ xUnit tests for layout, filter, formatting and tree operations
docs/ landing page (GitHub Pages), screenshots, icon, header and social preview
tools/make-assets.py regenerates every icon, preview and installer image from the mark
installer/ MSI wizard pages, dialog images, release.ps1 and brand-msi.ps1
.github/ issue forms, pull request template, build workflow, Dependabot
Add a palette
Add an entry to BuildSchemes() in Util/Palette.cs. The simplest form is a name and a list of folder colors; file colors and file-type colors are derived from them:
FromList("Lavender",
new[] { "#7B6FD6", "#9A8FE0", "#B7A8E8", "#6C8FD6", "#A58CC9", "#8D7BB8", "#C6A0D8" }, 0.5),
You can also pass your own file-type colors as a third argument, one per category in the order of the FileCategory enum.
Change theme colors
Edit the hex values in Themes/Dark.xaml or Themes/Light.xaml. Both files must define the same keys.
Add file types
Extensions and their categories are listed in BuildExtensionMap() in Util/Palette.cs.
Name, version and author
These come from SpaceSharp.csproj (Version, Authors, Copyright, Description) and appear in the About window and in the exe's file properties.
Icon
The mark is nine cells on a charcoal tile; the gutters form the # in Sharp and brightness follows size. Every brand asset is generated from one definition in tools/make-assets.py (Python 3 with Pillow; it downloads Bricolage Grotesque from its GitHub repository for the wordmark). Running it rewrites Assets/SpaceSharp.svg, SpaceSharp-small.svg (the four-cell version used at 16 to 24 px), SpaceSharp.ico, SpaceSharp-256.png, the icons and previews in docs/, and the two installer bitmaps, so change the cells or colors there rather than editing the files by hand.
Your palette, color mode and theme are saved to:
%AppData%\SpaceSharp\settings.json
Delete the file to go back to the defaults.
C:\Windows\WinSxS can look bigger than it is by default.SpaceSharp is released under the MIT License. You're free to use, modify and share it, including in commercial projects, as long as the copyright notice is kept.
Made by ClearanceClarence.
18 commits
C#
91.8%
Python
5.3%
PowerShell
2.9%