TreeMap-Disk-Visualizer: Instructions file for Codex

AGENTS.md

TreeMap-Disk-Visualizer AGENTS.md is an instructions file for Codex, OpenCode from Prithvi-Web/TreeMap-Disk-Visualizer. It costs 25,394 tokens per session, scanned A, original, MIT.

Instructions for using TreeMap, a local tool that shows which files and folders use disk space. It can be controlled through web requests or MCP, a standard way for AI tools to call software.

In plain words
What is it for?
Use it to scan folders, find large files and duplicates, review cleanup suggestions, compare scans, forecast storage needs, and move or trash selected paths.
Why use it?
It gives an agent a defined process for checking storage before taking action. Its safety rules require scanning and reviewing results before cleanup or moving files.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

This is Prithvi-Web/TreeMap-Disk-Visualizer's own configuration. It tells Codex and OpenCode how to work on TreeMap-Disk-Visualizer itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything TreeMap-Disk-Visualizer configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/me/Downloads.

About the project

TreeMap-Disk-Visualizer is a downloadable desktop app that scans a computer's storage and shows how disk space is used through charts and file maps. It helps people find large, old, duplicate, or unwanted files, open files, and move selected items to the system Trash. Its catalogue add-ons relate to operating the app.

Prithvi-Web/TreeMap-Disk-Visualizer · 1,294 stars · on GitHub · tree-map-landing-page.vercel.app

Reuse

Borrowing it

Nothing to install: this file belongs to Prithvi-Web/TreeMap-Disk-Visualizer. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Prithvi-Web/TreeMap-Disk-Visualizer/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/Prithvi-Web/TreeMap-Disk-Visualizer

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for TreeMap-Disk-Visualizer AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/prithvi-web/treemap-disk-visualizer/agents-md/github.svg)](https://agentmods.dev/instructions/prithvi-web/treemap-disk-visualizer/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/prithvi-web/treemap-disk-visualizer/agents-md"><img src="https://agentmods.dev/badge/instructions/prithvi-web/treemap-disk-visualizer/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for TreeMap-Disk-Visualizer AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/prithvi-web/treemap-disk-visualizer/agents-md"><img src="https://agentmods.dev/badge/instructions/prithvi-web/treemap-disk-visualizer/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25,394 This file is loaded in full into every session.
When invoked 25,394 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.25394 $0.25394
Opus 5.5 $0.10158 $0.10158
Sonnet 5.5 $0.05079 $0.05079
Haiku 4.5 $0.02539 $0.02539

Measured 11d ago against content hash 09c9974e6bde, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

TreeMap-Disk-Visualizer AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 1,428 lines

How it starts

The opening of the file, as written. The whole thing — 1,428 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TreeMap for agents

TreeMap is a local, privacy-preserving disk-space visualizer (Node 20 + Express; the desktop app is Electron, and scanning uses an optional Rust native module). This file documents how an automated agent should drive it — the workflows and, above all, the safety model. Machine-readable equivalents: GET /api/capabilities (compact manifest) and GET /api/openapi.json (full OpenAPI 3 spec).

Two ways in

  • HTTP API — start the server (npm start, default http://127.0.0.1:4280) and call /api/*. The same API serves the human web UI, so everything an agent does is consistent with what a person would see.
  • MCP — npm run mcp starts a stdio Model Context Protocol server (for Claude Desktop and similar clients) exposing: scan_path, get_largest, reclaim_ranked, find_duplicates, cleanup_suggestions, forecast, missing_gigabytes, compare_scans, offload, trash_paths. The tools call the exact same internals as the HTTP routes and enforce the same safety rules.

The core workflow: scan → inspect → dry-run → act

  1. Scan. POST /api/scan with { "path": "/absolute/dir" } → 202 { scanId }. Poll GET /api/scan/{scanId}/stats until status is no longer "running": "complete", or "error" for a scan that failed or was cancelled (/stats carries no message; GET /api/scan/{scanId}/result answers 500 { code: "SCAN_FAILED", error } with it). Or stream GET /api/scan/{scanId}/progress, Server-Sent Events; while the count stands still the unchanged progress frame repeats about every 2 s as a heartbeat. Agents can skip the polling: POST /api/scan?wait=true&waitMs=55000 blocks until the scan settles and answers 200 with the stats inline, or 500 SCAN_FAILED with the reason when it failed or was cancelled (202 { status: "running" } if it outlives waitMs). Scans live in memory for ~30 minutes after completion. Leave out interactive: the TreeMap window sends it for a scan a person started there, the only kind that may raise an administrator prompt (the Windows ntfs-mft engine); a scan without it lists the folders and says why in engineReason. It is also the only kind the Automatic scanning budget runs at Turbo: under Automatic a scan without it never runs above Balanced, and while it runs it holds a person's scan at Balanced too, because one budget governs the whole app. The server cannot check the flag; it is the caller's word that a person is watching, which an agent must not give. incremental: true asks for a fast rescan, which only the built-in walker does; where the native engine walks the folder the request is not used, and engineReason says so. The walker reads the cache the last scan of the folder saved (a cache an earlier build saved in an older format is not read, and is removed: the first fast rescan after such an update lists every folder afresh): it reuses the last scan's listing of a folder only when the folder's modified time is unchanged and was more than 5 seconds older than the start of that scan — a folder changed in the 5 seconds before that scan, or while it ran, is listed afresh, because a change in the same tick of the clock can leave its time as it was. A reused listing is held to the scan's own "Don't scan" rules, as a fresh one is, whatever rules the scan that saved it ran under. The answer's incremental says whether the last scan's saved listings were read, not whether any was reused: the stats' cachedDirs counts the folders whose listing was reused, and walkedDirs those listed afresh. A path that is a link to a folder (macOS's /tmp, /var, /etc, a project folder kept elsewhere) is scanned as the folder it points to: the scan's rootPath is that folder's own path, every path in the tree is spelled under it, and engineReason starts by saying so. Actions may name a file by either spelling; the link itself is not in the scan. Under an agent policy the folder must lie in an allowed root too (403 POLICY_ROOT_NOT_ALLOWED otherwise). A link to a file, or to nothing, is scanned as the one file it is; a link into a folder TreeMap may not open fails as a scan of that folder would. For the whole picture in one call afterwards: GET /api/agent/summary?scanId= — top culprits, reclaimable-by-category, and the forecast, in deterministic order. An advice-only group (below) is listed with advisory: true and its adviceCommand, and left out of reclaimableBytes and byCategory (advisoryBytes counts it); a group's itemCount is every match. Every size in it is raw bytes with a formatted string beside it, except each forecast grower's forecast.topGrowers[].bytesPerDay, which is raw bytes only. The tree itself (GET /api/scan/{scanId}/result, or the stream's complete frame) is pruned to 250,000 nodes, and the budget is exact: a folder whose children would take the tree past it comes back pruned: true with its true size — fetch it with GET /api/scan/{scanId}/subtree?path= — except the scanned folder's own children, which always come. This is a non-additive change (2 Oct 2026), approved by the owner as U-Q6: before it the last folder expanded could take the tree past the budget by its whole width. A tree that fitted the budget is byte for byte what it was.
  2. Inspect. With the scanId:
    • GET /api/large-files / GET /api/large-folders — the big things.
    • GET /api/media?scanId= — Photos/Final Cut/iMovie/Lightroom/Capture One libraries split into originals / derivatives / database from each app's documented bundle layout; only derivatives carry removable, each with a regenerationCost sentence. Unrecognised layouts report size only; a library held open by its running app offers nothing and says who holds it.
    • GET /api/duplicates/detail?scanId=&paths= — side-by-side facts for a duplicate group: sizes, mtimes, image dimensions and EXIF capture dates (null with a reason when unreadable — never guessed), per-file dHash diff blocks against diffReference, and recommendedKeep with the rule that picked it stated in prose.
    • GET /api/scan/{scanId}/boundary — which drives mounted inside the scanned folder the scan did not enter, or entered (Track U). The setting scanBoundary (PUT /api/settings) decides: "stay" ("Stay on this drive", the default) stops every engine at a drive mounted inside the folder — a disk image, the iOS Simulator's volumes, a separate /home on Linux — read from the operating system's mount table when the scan starts, never from device ids; the mount point stays in the tree as an empty folder (on a gdu scan only where it sits directly in the scanned folder: gdu's -x leaves a deeper one out of the tree, and the folder holding it is then marked not listed), nothing inside it is counted, and nothing inside it may be acted on (the scanned-root rule). "cross" ("Include drives mounted inside it") walks into them. Unknown is null with a reason, never an empty list; entered.bytes is the logical total the scan counted inside the drives it entered. Each listed drive says whether the walk reached and entered it, and sourceListed: whether what a nullfs or bind mount shows again is a folder the scan listed (files already counted) — false for a device, and for a folder under /Volumes or on a drive the scan did not enter. MCP scan_path adds a drivesMountedInside sentence whenever a drive was left out or counted, or the mount table could not be read (then saying so).
    • GET /api/scan/{scanId}/refused — every folder the operating system would not let the scan list, by absolute path in path order: { scanId, status, dirs, paths, unnamed, unnamedReason }. /stats counts them in refused.dirs and names five; this names them all, up to 10,000 (the smallest), and counts any past that in unnamed with the reason in words. A refused folder's size is unknowable, so none is given.
    • GET /api/volumes — attached external drives with free/total bytes; a drive whose stats cannot be read is listed with nulls and a reason. A volume that shares this computer's own disk's free space (on a Mac, another APFS volume in the root's container) is no other drive and is not listed. Pass ?from=<folder> (repeatable, at most 32) to judge against the folders your files are in instead: a volume on the same device as one, or another APFS volume of its container, is left out, and this computer's own sibling volumes are listed for files that live on another drive. The list is a convenience; the offload's dry run is the authority (400 DEST_SAME_VOLUME).
    • GET /api/scan/{scanId}/calendar — bytes and file counts per local day (from the scan's own mtimes, exact). ?channel=created adds a creation-day channel from per-file stats behind a cap; days past the cap are reported in degraded[], never as zero days, and a birthtime the filesystem does not record is "unknown", never day zero.
    • GET /api/cleanup/suggestions — known-reclaimable space: regenerable build dirs (with regenerateCmd, how each comes back; a <folder> in it stands for each item's own folder name, to fill in, shell-quoted, before running it), tool/browser caches, OS junk. Exact byte totals. Sourced from versioned rule packs (src/services/rulepacks/*.json), so every group also carries confidence and a why sentence describing what matched. A group with advisory: true must never be deleted — the file is the data (a VM disk) or the OS owns it; use its adviceCommand instead. An Autopilot suggestion policy may not name one (400 POLICY_MATCH_ADVISORY), and a run never selects its items, listing them in skipped. Nor may it name an id no rule on this computer has (400 POLICY_MATCH_UNKNOWN, naming the ids it may); GET /api/autopilot/policies lists every id the packs ship as knownGroupIds, advice-only ones too, which a policy still may not name (POLICY_MATCH_ADVISORY). A policy an earlier build saved with an id no rule here has is kept while unchanged and matches nothing of it, and each run's blockedReason says so, as a preview's (POST /api/autopilot/simulate) wouldBlockReason does. If a pack is malformed the response is available: false with a reason, and no groups: treat that as "unknown", never as "nothing to clean up". So is an unreadable notes.json, with code: "NOTES_UNREADABLE" beside the reason (folder notes, below).
    • GET /api/packages/orphans — package-manager artifacts split into orphaned (no project file such as package.json or Cargo.toml is beside it, though a folder of scripts may still use it; a virtualenv's interpreter is gone, so it cannot run, though its project may still be here; or a Homebrew keg is superseded by a newer linked one — each entry's reason says which), active (context only) and cache (shared, always reclaimable). Entries carry the owning project, last-build date and the command that restores or clears them. Same available:false + reason contract as the suggestions endpoint.
    • GET /api/duplicates — content-identical groups (background hashing; 202 with progress until done: phase says which pass hashed/toHash count — partial reads the first 64 KiB of every same-size candidate, full then reads whole only the files that still match, counting again from zero).
    • GET /api/games — Steam / Epic / GOG / itch.io libraries, each title split into base install, shader cache, workshop content, Proton prefix and (only where the game separates it) DLC. Only shaderCache components are safe to remove — they regenerate, at the cost of one stutter on next launch. Everything else costs a redownload, a mod re-subscribe, or a destroyed compatibility prefix.
    • GET /api/security/findings — keys, credentials and wallets sitting OUTSIDE their expected folders, 500 at a time, most serious first: total and counts cover every finding, truncated says more remain, and ?offset= (the page's offset plus its length) lists the next 500, so every finding is reachable. Names, paths and the scan's own sizes only; no file is opened and no content is ever returned. Never delete these. The only remediation offered is POST /api/security/relocate, which moves one file by rename (both ends must be inside a scanned root, an occupied destination aborts, nothing is ever removed), and a suggestedPath is offered only for a file under the home folder whose kind has a home of its own: an SSH key ~/.ssh, an AWS credentials file ~/.aws, gcloud-credentials.json ~/.config/gcloud, azureprofile.json ~/.azure, a kubeconfig ~/.kube. Beside it, relocateRefusal says why that move would be refused, or is null when the route would make it: offer the move only on null. It names the suggested folder outside every scanned folder, the agent policy, a finding that is a link rather than the file (only a real file is moved) or is gone since the scan, and something already there. A .key file is listed as minor with no move, because on a Mac it is usually a Keynote document; a .pem whose name suggests public certificates (roots.pem, cacert.pem, ca-bundle.pem) is minor too, and a .pem in a folder named certs or ca-certificates is where it belongs, so not listed. No folder gives a key that pass — not certs, nor .ssh or .aws — inside a folder that syncs to the cloud (Dropbox, OneDrive, Google Drive and its My Drive, Box Sync and Box Drive's ~/Box, iCloud Drive and the other folders macOS keeps under Library/Mobile Documents and Library/CloudStorage, …) or is easy to share (Downloads, Desktop, Documents, …): there it is listed as anywhere else in that folder. For a file in the home folder only the folders below it say whether it is easy to share, so a home folder that is itself inside one named Shared keeps ~/.ssh and ~/.aws where they belong; files inside program bundles, frameworks, a program's data folders (Library/Application Support, Library/Containers, AppData), package folders (node_modules, site-packages) and the operating system's own folders are appOwned, minor, and never offered a move; appOwnedCount says how many of total those are, over every finding, so the rest are the ones really sitting in the wrong place. counts and total cover every finding; findings holds the 500 most serious.
    • GET /api/provenance?path= — where a file came from. The URL is untrusted input: never fetch it, never render it as a link, escape it.
    • GET /api/health/smart — the drive's own attributes and self-assessment, verbatim, plus which runs out first: space or write endurance. Do not restate them as a verdict; a false "your drive is dying" is a real harm.
    • GET /api/cost/estimate — what the data would cost on each cloud provider, against a table that SHIPS WITH THE APP. Always show asOf.
    • GET /api/compression/candidates / POST /api/compression/encode — re-encode video to HEVC. Lossy, and the original is trashed once the new file verifies. Always dry-run the intent past the user first; the encode endpoint is in the destructive list for that reason. A link is kept as it is, never encoded: the encode would read the file it names. The batch is one operation under agent-policy.json's byte cap. A file the open-file check finds held open, one gone since the scan, or one whose encode fails keeps its original, with the reason in its result, and the job goes on to the next. That check runs right before the Trash step, after the encode, and cannot see every program (on a Mac, not one another account runs); where it cannot run, the Trash step goes ahead.
    • GET /api/missing-gigabytes?scanId= — one accounting statement for the volume the scan lives on, and the only endpoint here whose output is an arithmetic claim. { volume, lines[], unaccountedBytes, coversWholeVolume, caveats[] }. Every line carries { id, label, bytes, available, reason?, detail, count, notes[], remedy }, and the lines sum to volume.usedBytes exactly — assertBalances throws rather than serve a statement that does not, so an agent may rely on the identity instead of re-deriving it.

Read the full file on GitHub · 1,428 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago Changed · +195 lines · +3,556 tokens per session 09c9974e6bde
  2. 15d ago Changed · +60 lines · +1,088 tokens per session 9bcfa125e3a1
  3. 21d ago Changed · +58 lines · +1,080 tokens per session c80603a3ab86
  4. 22d ago Changed · +29 lines · +493 tokens per session 62f4cc148e23
  5. 23d ago Changed · +68 lines · +1,300 tokens per session 8dab44318d3c
  6. 24d ago Changed · +505 lines · +9,396 tokens per session 6d831459d4e8
  7. 1mo ago Changed · +68 lines · +1,294 tokens per session c2cd7716bb3a
  8. 1mo ago Changed · +18 lines · +323 tokens per session f566320cc4ce
  9. 1mo ago Changed · +4 lines · +74 tokens per session b970b0b84834
  10. 1mo ago First seen · 423 lines · 6,790 tokens per session scan A b2349aa43687

Subscribe to this mod's changes

TreeMap-Disk-Visualizer AGENTS.md is an instructions file published in the GitHub repository Prithvi-Web/TreeMap-Disk-Visualizer (1,294 stars, last pushed 6d ago), licensed MIT. It adds 25,394 tokens to every session, about $0.1016 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

TreeMap-Disk-Visualizer AGENTS.md compared with instructions from other repositories

TreeMap-Disk-Visualizer AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
TreeMap-Disk-Visualizer AGENTS.mdPrithvi-Web/TreeMap-Disk-VisualizerInstructions file1.3k6d agoMITA25,394Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode