New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

agentrinse

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agentrinse

Safe, local-first cleanup for agentic development.

latest
Source
npmnpm
Version
0.8.2
Version published
Maintainers
1
Created
Source

agentrinse 🫧

audit first. clean deliberately. recover when it matters.

what is agentrinse?

agentrinse is a local-first cleanup planner for machines where coding agents, worktrees, build artifacts, runtimes, and Docker state accumulate faster than humans can safely reason about them.

it does not treat "old", "large", or "missing from the current terminal" as proof that something is disposable. agentrinse inventories the machine, reconstructs ownership and reachability, explains why every resource is protected or eligible, creates a content-addressed plan, and revalidates the same facts immediately before mutation.

agentrinse is not audit-only. audit establishes the evidence; apply performs the approved filesystem, Git metadata, and offline database changes. 0.8.2 removes exact configured rebuildable artifacts, quarantines proven inactive linked worktrees, repairs and locks their Git registrations, restores quarantined worktrees, permanently purges explicitly selected quarantine entries, and compacts supported Codex SQLite state with a retained rollback copy. It also quarantines exact stale Claude debug logs and changelog cache files plus Zed's exact stale Zed.log.old rotated application log with a seven-day undo window. OpenCode, Cursor, version-gated Docker Buildx, and version-gated Grok owner maintenance remain report-only.

the point is confidence: make real cleanup changes without deleting the session, branch, worktree, database content, or cache that another agent still needs. unknown state fails closed and recoverable worktrees are quarantined before they can be purged.

agentrinse is deliberately not another generic disk cleaner. it understands agent and Git ownership; Mole remains an optional external handoff for broader macOS and project debris.

cleanup actions

ActionRiskWhat changesRecovery
🧹 artifact removalsafeatomically isolates and removes an exact configured rebuildable directoryrebuild from the project
🌿 worktree quarantinerecoverablemoves a linked worktree, creates a recovery ref, and repairs Git registrationagentrinse undo <run-id>
🧾 provider quarantinerecoverablemoves an exact provider-owned disposable file into private recovery storageagentrinse undo <run-id>
🗜️ Codex DB vacuumexperimentalbuilds and verifies a compacted SQLite copy, then retains the original fileagentrinse undo <run-id> before reuse
↩️ recovery undorecoverablerestores a quarantined worktree, provider file, or database originalrecovery remains journaled
🗑️ recovery purgedestructivepermanently removes an explicitly selected worktree, provider file, or DB copynone
⚙️ config initoperationalcreates the default config without overwriting an existing fileedit or remove the generated config
🔒 lock recoveryoperationalremoves only a stale AgentRinse lock after proving its process is gonererun the interrupted command

provider sessions, transcripts, credentials, configuration, and logical database records remain report-only. 0.8.2 supports explicit offline compaction for the exact current Codex state_5, logs_2, goals_1, and memories_1 SQLite contracts. Claude cleanup is limited to exact old debug text files and its rebuildable changelog cache. AgentRinse also reports Claude's native retention policy and Copilot's native session and process-log maintenance. It also reports OpenCode's owner-run snapshot compaction and its separate append-only server log, plus Cursor's owner-run state database maintenance. Docker inventories images, containers, and supported Buildx cache records but remains audit-only. Grok inventory is pinned to the inspected 0.2.112 version and build revision from the audited root's canonical executable, and reports its session-start memory GC without invoking it.

agent integrations

provider state is report-only unless the table below says otherwise. agentrinse never erases transcripts, sessions, credentials, configuration, or logical memory records.

LogoClientModeWhat it protects
OpenAI CodexOpenAI Codexaudit + offline vacuumsessions, workspace roots, reachability, and supported SQLite state
Claude CodeClaude Coderetention + quarantinesessions, caches, roots, native retention, and exact old files
CursorCursoraudit + native guidanceworkspace state, DB companions, and owner maintenance
GitHub Copilot CLIGitHub Copilot CLIaudit + native guidancelocal sessions, process logs, and provider-owned maintenance
ZedZedaudit + quarantinelocal agent state and the exact stale rotated application log
OpenCodeOpenCodeaudit + native guidancelocal state, snapshot GC, and server-log retention
Grok BuildGrok Buildaudit + native guidancesessions, memory, logs, worktrees, caches, and owner maintenance

cleanup surfaces

IconSurfaceModeWhat it understands
Git branchGit worktreesaudit + quarantinelinked worktrees, refs, dirtiness, locks, processes, and provider roots
Build artifact fileBuild artifactssafe-cleanexact configured rebuildable directories
OpenAI CodexCodex SQLite stateexperimentalschema versions, free pages, sidecars, owner processes, and rollback
Claude CodeClaude native retentionreport-onlydefault or user retention, settings validity, and provider ownership
Claude CodeClaude logs and changelog cacherecoverableexact old files, provider liveness, seven-day undo, and explicit purge
GitHub Copilot CLICopilot native maintenancereport-onlylocal session pruning and versioned process-log retention
ZedZed rotated application logrecoverableexact Zed.log.old, provider liveness, seven-day undo, and purge
OpenCodeOpenCode native maintenancereport-onlyhourly snapshot GC and the append-only server-log contract
CursorCursor database maintenancereport-onlyexact DB companions, orphan KV GC, and destructive chat cleanup
Grok BuildGrok native memory GCreport-onlysession-start orphan cleanup, source version, and explicit refusal
Terminal runtimeAgent runtimesaudit-only, opt-ininstalled agent executables and versions
DockerDockeraudit-only, opt-inimages, containers, and versioned Buildx cache
Cleanup searchMolesuggestions onlyexternal dry-run cleanup opportunities on macOS

install

Node.js 22 or newer is required.

npm install -g agentrinse
# or
pnpm add -g agentrinse
# or
yarn global add agentrinse
# or
brew install vincentkoc/tap/agentrinse

one-off use:

npx agentrinse@0.8.2 doctor

then:

agentrinse --version
agentrinse doctor
agentrinse adapters

quick rinse

from a Git worktree, inspect repository-scoped agent residue:

agentrinse clean --profile closeout

this audits the current repository, its linked worktrees, and relevant Codex and Claude reachability metadata. the current worktree is always protected. the command creates a plan but does not infer that your task is finished and does not mutate anything unless --apply is present.

apply only reviewed safe artifact actions:

agentrinse clean --profile closeout --apply

automation must authorize explicitly:

agentrinse clean --profile closeout --apply --yes --max-risk safe --json

whole-worktree cleanup is recoverable and must be selected separately:

agentrinse clean --profile closeout --max-risk recoverable
agentrinse clean --profile closeout --max-risk recoverable --apply --yes

for an explicit repository fleet, repeat --repo and choose the risk ceiling:

agentrinse clean --profile fleet \
  --repo /path/to/repo-a \
  --repo /path/to/repo-b \
  --max-risk recoverable

fleet mode requires absolute --repo paths and never crawls the current directory or home for repositories. linked-worktree aliases are deduplicated by their physical Git common directory. add --apply --yes only after reviewing the persisted plan.

that moves a proven inactive linked worktree into quarantine. it does not reclaim disk immediately. restore it or inspect a later permanent purge:

agentrinse undo <run-id>
agentrinse purge --run <run-id>
agentrinse purge --run <run-id> --apply --yes

offline Codex database compaction is a separate experimental workflow. quit every Codex CLI and desktop process first:

agentrinse audit --allow-offline-vacuum --output audit.json
agentrinse plan --audit audit.json --max-risk experimental --output plan.json
agentrinse apply --plan plan.json --max-risk experimental --yes

only databases with at least 512 MiB and 25 percent free pages are proposed. apply holds exclusive SQLite-compatible file locks across an atomic path exchange, so Codex cannot reopen either inode during installation. the original file is retained for seven days. undo uses the same locked exchange and refuses after Codex has reopened or changed the compacted database:

agentrinse undo <run-id>
agentrinse purge --expired
agentrinse purge --expired --apply --yes

apply reports zero reclaimed bytes while the original remains retained. run journals record retainedBackupBytes; purge reports bytes only when that rollback set is actually deleted.

commands

CommandPurposeMutation
agentrinse auditinventory a home and explain protection evidencenone
agentrinse audit --no-state --providersstream selected provider evidence without persisted statenone
agentrinse audit --allow-offline-vacuumpropose supported offline Codex DB actionsnone
agentrinse plancreate a bounded plan from a saved auditpersisted plan only
agentrinse clean --profile closeoutaudit and plan the current repositorynone
agentrinse clean --profile fleetaudit and plan explicit repository rootsnone
agentrinse apply --plan <file>revalidate and apply an authorized planselected actions
agentrinse undo <run-id>restore recoverable actions from a runrecovery restore
agentrinse purgepreview worktree and database recovery backupsnone
agentrinse purge --apply --yespermanently remove selected recovery backupsdestructive
agentrinse doctordiagnose platform, config, state, Git, and optional toolsnone
agentrinse adaptersshow adapter maturity and ownershipnone
agentrinse historylist persisted cleanup runsnone
agentrinse showinspect runs, plans, and resource findingsnone
agentrinse lock statusinspect the global apply locknone
agentrinse lock recover --yesremove a stale lock after process proofstale lock only
agentrinse configlocate, initialize, show, or validate configurationinit creates a file
agentrinse completion <shell>generate bash, zsh, or fish completionnone

run agentrinse <command> --help for the complete option set.

safety model

agentrinse is built around refusal:

  • discover resources through owner APIs and structured state where possible.
  • protect anything active, reachable, dirty, pinned, provider-managed, or unknown.
  • plan exact actions against canonical paths and measured identities.
  • authorize with an expiring, content-addressed plan and explicit risk ceiling.
  • revalidate paths, processes, refs, metadata, age, size, and provider roots under the mutation lock.
  • isolate the exact target with an atomic same-filesystem rename before removal.
  • journal every transition so interrupted work can be inspected, recovered, or undone.

there is no generic --force escape hatch.

agentrinse 0.8.2 never removes:

  • provider sessions, transcripts, logical database rows, credentials, or configuration
  • unsupported provider databases or Codex databases with unknown migrations
  • plugins, skills, memories, or agent instruction files
  • Git branches, stashes, the main worktree, or the current worktree
  • Docker images, containers, networks, volumes, or build cache
  • sockets, pipes, devices, mounts, or symlink targets

build artifacts

direct removal is limited to exact names under explicitly configured project roots:

agentrinse config init
agentrinse config path

edit the generated JSON and add explicit artifact roots:

{
  "schemaVersion": 1,
  "artifacts": {
    "projects": [
      {
        "root": "/absolute/path/to/project",
        "names": ["node_modules", "dist", ".cache"]
      }
    ],
    "minAgeMinutes": 1440,
    "minBytes": 67108864,
    "processCheck": "required"
  },
  "worktrees": {
    "minAgeMinutes": 20160,
    "quarantineTtlMinutes": 10080
  },
  "plan": {
    "ttlMinutes": 30,
    "maxRisk": "safe"
  }
}

supported artifact names:

  • node_modules
  • dist
  • dist-runtime
  • build
  • .next
  • .turbo
  • .cache
  • coverage
  • target
  • .venv

before removal, agentrinse revalidates configured scope, canonical path, device and inode identity, recursive metadata fingerprint, measured bytes, newest descendant age, mount boundaries, current working directories, same-user processes, and plan expiration.

worktree quarantine

a worktree is eligible for recoverable quarantine only when agentrinse can prove that it is:

  • linked, unlocked, branch-attached, clean, and pushed
  • old enough under the configured policy
  • free of submodules and active same-user processes
  • outside the current and main worktrees
  • not pinned by a Git ref, provider root, or active/recent agent session
  • completely measured with no unknown ownership state

a recovery ref is created before the atomic move. Git registration is repaired and locked, then the quarantine manifest is written with owner-only permissions. permanent purge reloads configuration and provider metadata under the mutation lock and refuses removal if any protection fact has changed.

machine output

--json emits a versioned command envelope suitable for scripts and agent tools:

agentrinse audit --json
agentrinse clean --profile closeout --json
agentrinse history --json

long audits can stream versioned events:

agentrinse audit --ndjson

headless checks can select exact providers without creating AgentRinse state:

agentrinse audit --providers cursor,copilot,opencode --no-state --json

--no-state requires JSON or NDJSON and rejects --output and --state-dir. --providers accepts unique provider IDs only, honors configured provider roots when they are absolute, and is valid only with --no-state. Git, Docker, runtime, and artifact adapters are not instantiated for a provider-scoped audit. The transient report omits candidate actions, so redirecting it into a later plan cannot authorize cleanup.

create a non-executable report for issue filing:

agentrinse audit --json --redact > audit-redacted.json

redaction replaces paths, salts identifiers per report, removes host fields, and strips candidate actions. saved audit and plan evidence remains exact so it can be verified before apply.

platform support

Platform0.8.2 support
macOSaudit, artifact/worktree/Claude/Zed cleanup, DB vacuum, undo, purge
Linuxaudit, artifact/worktree/Claude/Zed cleanup, DB vacuum, undo, purge
WSLLinux contract inside the WSL filesystem
native Windowsaudit-only; mutation remains blocked before 1.0.0

Git and lsof are required for the complete diagnostic and process-ownership contract. Codex DB maintenance additionally requires sqlite3. Docker is optional. Mole detection is available on macOS.

docs

development

pnpm install
pnpm check
pnpm smoke
pnpm pack:check

tests and smoke runs use guarded temporary synthetic roots. never point an unreleased build at real developer state.

status

0.8.2 ships the complete audit → plan → revalidate → apply loop, safe configured artifact cleanup, recoverable Git worktree, Claude file, and exact Zed rotated-log quarantine, plus recoverable offline Codex database compaction. Explicit fleet cleanup applies the same safety model across repeated absolute repository roots, deduplicates linked aliases by physical Git common directory, and isolates failed repositories. It reports OpenCode's native maintenance contract, Cursor's owner database commands, Docker Buildx cache facts, and Grok's version-gated session-start memory GC. Exact-provider JSON and NDJSON audits can run without creating AgentRinse state and omit candidate actions. Grok Build, Docker, and all other Cursor, Zed, and OpenCode state remain non-mutating.

MIT licensed. built by Vincent Koc.

Keywords

agents

FAQs

Package last updated on 25 Aug 2026

Related posts