[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-115322":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":26,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},115322,"plonge","mattt\u002Fplonge","mattt","Clean up after mise en place: find and safely delete developer caches","",null,"Go",329,8,3,1,0,21,180,176,92.86,"MIT License",false,"main",[25],"mise","2026-11-22 13:55:10","2026-11-23 15:18:19","# Plonge\n\nDeveloper tools and coding agents fill a disk with caches.\nEach project gets its own `node_modules`, `.build`, `DerivedData`, `target`, or `.venv`, \nand each agent worktree gets another copy.\nOr else, package managers squirrel away shared caches in various places.\n\nWhen the disk is full, you need space **now**.\nAnd that's a bad time to delete folders by hand.\nThat folder that looks disposable? \nWhoops! That actually had work that hadn't been pushed anywhere yet.\n\nPlonge finds disposable caches around your system\nfor you or your agent to _plonge_ away.\nIn projects, it deletes only directories that match its rules and pass its Git checks.\nFor shared caches, it runs each tool's cleanup command or a specific built-in rule.\nSee [What Plonge covers](docs\u002Fcoverage.md) for supported tools and known gaps.\n\n## Install\n\nWith Homebrew:\n\n```console\nbrew install mattt\u002Ftap\u002Fplonge\n```\n\nWith mise, through its `github` or `go` backend:\n\n```console\nmise use -g github:mattt\u002Fplonge\nmise use -g go:github.com\u002Fmattt\u002Fplonge\u002Fcmd\u002Fplonge@latest\n```\n\nWith Go 1.26 or later:\n\n```console\ngo install github.com\u002Fmattt\u002Fplonge\u002Fcmd\u002Fplonge@latest\n```\n\nThe [releases page](https:\u002F\u002Fgithub.com\u002Fmattt\u002Fplonge\u002Freleases)\nalso has archives for macOS and Linux, on amd64 and arm64.\n\nProject scans need Git on `PATH`.\nGlobal cleanup needs the tool named by each rule.\nThe `disk` command supports macOS and Linux.\n\n## Find caches\n\n```console\nplonge scan\n```\n\n`scan` lists each cache with its size, project, last activity, and rule.\nA cache is a directory that matches a rule, such as `node_modules` or `.venv`.\nSome rules also require a project file:\n`target`, for example, must be beside `Cargo.toml` or `pom.xml`.\nA match enters the totals only if it passes the Git checks described below.\n\nBy default, Plonge finds projects from mise's record of the config files it has loaded,\nso a project appears only after mise has loaded a config file in it.\nTo scan a project that mise has not seen, name it with `--root`.\nAdd `--no-mise` to leave out mise's record and scan only the roots you name:\n\n```console\nplonge scan --root ~\u002Fcode\u002Fapp\nplonge scan --no-mise --root .\n```\n\n`--root` can be repeated, and `clean` takes both options too.\nA root must be inside a Git work tree.\nPlonge skips a root outside one,\nlists it in the `scan` and `clean` reports with the reason,\nand does not search a parent folder for repositories.\nThe report calls each root a project.\n\n## Delete project caches\n\n```console\nplonge clean\nplonge clean --apply\n```\n\n`clean` lists the caches that it would delete, and `--apply` deletes them.\nUse the same options for both runs.\n`scan` and `clean` both print JSON with `--json`.\n\nBy default, only caches in quiet projects qualify.\nA quiet project has a known last activity time at least 24 hours old;\n`quiet_hours` in your rules file changes that period.\nActivity is the newest time in the root's Git HEAD log\nand its Claude Code transcripts.\nUncommitted edits and builds do not update it,\nso a quiet status does not prove that a project is unused.\nA project with more recent or unknown activity is active.\n`--include-active` also selects active projects,\nand `--min-size 100MiB` skips caches smaller than 100 MiB.\nProjects that the agent status check reports as busy stay excluded,\neven with `--include-active`, and a failed status check blocks project cleanup.\nA busy project has a Paseo agent with the status `running` or `initializing`.\nThe check fails when `paseo` is on PATH but `paseo ls` fails,\nwhen it lists an entry that is not an object with a known status\n(`initializing`, `running`, `idle`, `error`, or `closed`),\nor when a running or initializing agent has no working directory.\n\nPlonge also refuses a cache that a running process uses,\nsuch as a `.venv` that a service runs from,\nbecause the HEAD log and transcripts do not show a long-running service.\nA process uses a cache when it has a file open or a library mapped under it,\nworks in it, runs an executable from it, or names a path in it on its command line.\n`--include-active` does not override this check.\nThe report names the process:\n\n```console\nRefused ~\u002Fcode\u002Fapp\u002F.venv: in use by python3.12 (PID 4312), whose command line names bin\u002Fpython\n```\n\nOn macOS, Plonge runs `lsof` and `ps` once for each scan;\non Linux, it reads `\u002Fproc`.\nIf it cannot list the processes, every project counts as busy.\nThe check does not see a service that is stopped when Plonge runs,\na timer or cron job, or a process that starts after the last check.\nThe [rule reference](docs\u002Frules.md#caches-that-a-running-process-uses)\ndescribes what the check can miss.\n\nBefore each deletion, Plonge checks again that no process uses the cache,\nand that the path is still a directory,\nis not a symlink, is inside its root, is ignored by Git,\nand contains no tracked files.\nIt also refuses a directory that holds an entry that its rule protects;\nthe Mix `_build` rule, for example, protects releases and dependency sources.\nPlonge skips a path that does not pass, or reports an error.\nCleanup deletes directories and does not run project code.\nIt continues after a deletion error and exits with a nonzero status.\n\nAfter `--apply`, the report gives an estimate of the space freed, from cache sizes,\nand the measured change in free space on your home directory's volume.\nOther processes can also change that second number.\n\nAn ignored cache can contain a dependency cloned from Git,\nwith commits or edits that the enclosing repository cannot see.\nPlonge therefore refuses a cache that holds a Git repository at any depth,\nor a directory that it cannot read.\nThe report lists each refused cache and its reason, outside the totals:\n\n```console\nRefused ~\u002Fcode\u002Fapp\u002Fnode_modules: contains a Git repository at some-dep\n```\n\nThe one exception is Swift Package Manager.\nIn a `.build` or `DerivedData` directory beside `Package.swift`,\nor a `DerivedData` directory beside one Xcode workspace or project,\nPlonge allows dependency clones that are unchanged\nand that SwiftPM can make again from `Package.resolved`.\nIt refuses the directory when a clone has edits, extra commits, or any other repository.\nThe rule reference describes the\n[Git check](docs\u002Frules.md#caches-that-hold-a-git-repository), the\n[SwiftPM conditions](docs\u002Frules.md#swift-package-manager-checkouts), and\n[project discovery and activity](docs\u002Frules.md#project-discovery-and-activity).\n\n## Global caches\n\nPackage managers keep shared caches outside projects:\n\n```console\nplonge scan --global\nplonge clean --global\nplonge clean --global --apply\n```\n\n`scan --global` adds global caches to the project report.\n`clean --global` lists the cleanup action for each one and leaves projects alone,\nso it cannot be combined with `--root`, `--no-mise`, `--include-active`, or `--min-size`.\nAll three run each tool's lookup and check commands.\n\nA `prune` rule uses the tool's policy to select unused or stale data,\nas `mise cache prune` and `uv cache prune` do.\nA `clear` rule can remove cached data that is still in use,\nso later commands may have to download dependencies or rebuild files.\nMost prune rules report a size marked `(whole cache)`,\nof which the tool removes only part.\nClear rules run only with `--include-clear`:\n\n```console\nplonge clean --global --include-clear\nplonge clean --global --include-clear --apply\n```\n\nGlobal cleanup does not use project activity,\nand it can interrupt a build that is using a selected cache.\nPlonge runs each tool from your home directory, without a shell,\nso project-specific tool settings may not apply.\nIt uses `mise exec --` when mise provides the tool, and `PATH` otherwise,\nand it skips and reports a tool that is missing.\nThe `mise-tools` rule skips cleanup when mise cannot load a tracked config\nthat may still exist, because mise could remove a version that the config pins.\n\nWhere a tool has no safe cleanup command,\na built-in clear rule deletes the contents of one directory.\nThese rules refuse unsafe paths, such as the home directory, a symlink,\nor a path in or containing a Git repository,\nand they protect data that a download cannot restore.\nFor example, \nthe Cargo rule leaves Git checkouts alone,\nthe RubyGems rule leaves Bundler's clones of Git sources alone,\nthe Deno rules leave localStorage and REPL history alone,\nand the Maven rule refuses a repository with locally installed artifacts.\nOn macOS, a prune rule for Xcode selects only build directories\nwhose workspace no longer exists,\nand refuses one that holds a Git repository with edits or local commits.\n\nSee the [rule reference](docs\u002Frules.md#global-caches) for every global action,\nits path, and its checks.\nThe [coverage table](docs\u002Fcoverage.md) explains tool-specific limits.\n\n## Add a rule\n\nWrite custom rules to `$XDG_CONFIG_HOME\u002Fplonge\u002Frules.toml`,\nor `~\u002F.config\u002Fplonge\u002Frules.toml` by default.\nFor example, to add a cache directory used by your build tool:\n\n```toml\nnames = [\".build-cache\"]\nquiet_hours = 72\n\n[beside]\n\".build-cache\" = [\"build.toml\"]\n```\n\nThis matches `.build-cache` only beside `build.toml`\nand makes the quiet period 72 hours.\nThe directory must still pass every project safety check.\nChoose only directories that your tools can restore:\nGit cannot protect edits inside an ignored folder\nthat has no repository of its own.\nUse `refuse_inside` to protect files within a cache that a rebuild cannot restore.\n\n`names` and `skip` add to the defaults.\nA `beside` or `refuse_inside` entry replaces the default for that name,\nand a global rule replaces the whole default rule with the same `id`, including its checks.\nSee the [rule reference](docs\u002Frules.md) for the full format\nand the [default rules](internal\u002Frules\u002Fdefault.toml) before you replace an entry.\n\n## Disk space\n\nReported cache sizes estimate the space that cleanup could free.\nOn macOS, Plonge counts only the blocks that a cache does not share\nwith files outside it, so a size can be smaller than what `du` reports.\nFiles linked elsewhere, snapshots, and concurrent changes\ncan change the space freed, and global size totals can overlap.\nThe rule reference explains [how sizes are measured](docs\u002Frules.md#sizes-and-freed-space).\n\n`plonge disk` prints the free space on your home directory's volume:\n\n```console\nplonge disk\nplonge disk --warn-below 20GiB\n```\n\nWith `--warn-below`, Plonge prints a warning only when free space is below that size.\nSize and disk errors then go to standard error with exit status 0,\nso a hook that runs the command does not fail.\nSizes accept `KiB`, `MiB`, `GiB`, and `TiB` (or `K`, `M`, `G`, and `T`) as powers of 1024,\nand `KB`, `MB`, `GB`, and `TB` as powers of 1000.\n\n## MCP server\n\n`plonge mcp` serves `scan`, `clean`, and `disk` to coding agents\nover standard input and output (stdio).\n`scan` takes `global`.\n`clean` is a dry run unless `apply: true`,\nand takes `include_active`, `min_size`, `global`, and `include_clear`\nwith the same rules as the command line.\nThe tools find projects through mise and do not accept roots.\nTheir descriptions tell agents to show the dry run\nand get your approval before `apply`.\nThe server does not enforce that approval.\n\nTo add the server to Claude Code:\n\n```console\nclaude mcp add plonge -- plonge mcp\n```\n\n## Agent skill\n\n`skills\u002Fplonge\u002FSKILL.md` tells coding agents when to use Plonge,\nto scan first, to show sizes, and to ask you before `clean --apply`.\nTo install it for Claude Code, copy `skills\u002Fplonge` to `~\u002F.claude\u002Fskills\u002Fplonge`.\n\n## Hooks\n\nThis Claude Code `SessionStart` hook shows the agent a warning when free space is low.\nAdd it to `~\u002F.claude\u002Fsettings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"SessionStart\": [\n      {\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"plonge disk --warn-below 20GiB\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n## Development\n\nThe repository pins its tools and defines its tasks in `mise.toml`.\n\n```console\nmise install\nmise run check\n```\n\n`mise run build` writes `bin\u002Fplonge`.\n`mise run lint` runs `gofmt -l` and `go vet`.\n`mise run test` runs the tests with gotestsum.\n`mise run check` runs `lint` and `test`.\n\n## License\n\nThis project is available under the MIT license.\nSee the LICENSE file for more info.\n","Plonge 是一款面向开发者的磁盘缓存清理工具，用于安全识别并删除项目级与全局级的临时构建缓存目录。它基于 Git 状态和预设规则（如匹配 node_modules、.venv、target 等）判断缓存是否可安全清理，支持项目内按 Git 提交时间过滤（默认 24 小时静默期）、全局调用各工具原生命令（如 cargo clean）或内置规则执行清理，并提供 dry-run 模式与 JSON 输出。适用于开发环境磁盘空间紧张时快速释放空间，尤其适合多项目、多语言、使用 mise 管理工具链的开发者工作流。",2,"2026-11-24 04:50:38","CREATED_QUERY"]