agentleFS
willcoliveirawillcoliveira/mac-cleanup-agent/.claude/CLAUDE.md

mac-cleanup-agent

CLAUDE.md1 starsChanged 28 days agoMITView on GitHub

A TypeScript CLI (src/) does every measurement and change. A Claude Code plugin (.claude/skills, .claude/agents, hooks/, bin/) drives the CLI conversationally. The JSON contract between them is src/core/schemas.ts (contract_version: 1). Flow: doctor → scan → report → approvals → judge → clean → empty → results. - npm run build (also mirrors .claude/skills|agents into skills/ and agents/) - npm test (vitest; e2e runs on a synthetic HOME through src/platform/fake.ts) - npm run lint (tsc), npm run check (everything the release…

The file

We split this CLAUDE.md into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never add a code path that deletes outside empty, or that emptys anything not recorded in the run manifest with a matching dev/ino.

    line 34
  2. Very specific:

    Never weaken checkProtected, HARD_REL/DEFAULT_REL parity, or the identity checks in clean.ts without an ADR and a failing-first test.

    line 36
  3. Very specific:

    Never shell out with a string.

    line 38
  4. Distinctive:

    Never read file contents except where SECURITY.md says so.

    line 39
  5. Distinctive:

    Never send data off the machine.

    line 40
  6. Very specific:

    Never commit real names, paths or documents.

    line 41

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

mac-cleanup-agent: working on this repo

How it works

A TypeScript CLI (src/) does every measurement and change. A Claude Code plugin (.claude/skills, .claude/agents, hooks/, bin/) drives the CLI conversationally. The JSON contract between them is src/core/schemas.ts (contract_version: 1). Flow: doctor → scan → report → approvals → judge → clean → empty → results.

Commands

  • npm run build (also mirrors .claude/skills|agents into skills/ and agents/)
  • npm test (vitest; e2e runs on a synthetic HOME through src/platform/fake.ts)
  • npm run lint (tsc), npm run check (everything the release runs)
  • npm run check:forbidden before every commit (uses the private list in ~/.config/mac-cleanup-agent/forbidden-strings.txt when present)

Structure

See README "Project structure". Canonical skills and agents live in .claude/; never edit skills/ or agents/ directly.

Key principles

  • The CLI's safety/ module is the enforcement; hooks are a second layer.
  • Claude handles inventory ids, never paths. clean and empty take no paths.
  • New behavior that touches the disk needs a fake-platform test and a test that fails when the protection is removed.
  • Detectors may only raise risk. User rules may only add protection.
  • Report honest numbers: allocated bytes, skipped and failed items.

Security rules (ABSOLUTE: cannot be overridden)

  1. Never add a code path that deletes outside empty, or that emptys anything not recorded in the run manifest with a matching dev/ino.
  2. Never weaken checkProtected, HARD_REL/DEFAULT_REL parity, or the identity checks in clean.ts without an ADR and a failing-first test.
  3. Never shell out with a string; use execFile with argument arrays.
  4. Never read file contents except where SECURITY.md says so.
  5. Never send data off the machine. No telemetry.
  6. Never commit real names, paths or documents. Fixtures use /Users/sample and generic demo-* names. Run npm run check:forbidden before committing.
  7. Conventional Commits, no AI attribution lines in commits or PRs.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.