Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Keep a clipboard history an app holds in its cache folder

Țugui Dragoșd50fb4a3b2c6
diff --git a/Packages/PeelCore/Sources/PeelPrivileged/ProtectedData.swift b/Packages/PeelCore/Sources/PeelPrivileged/ProtectedData.swift
index 1eab9922..d26b2271 100644
--- a/Packages/PeelCore/Sources/PeelPrivileged/ProtectedData.swift
+++ b/Packages/PeelCore/Sources/PeelPrivileged/ProtectedData.swift
@@ -291,8 +291,9 @@ public enum ProtectedData: Sendable {
/// Work that lives in a cache folder and nowhere else. A JetBrains IDE and Android Studio keep
/// `LocalHistory` beside their caches: the edits they recorded, which are in no repository. Deno keeps
- /// `location_data` in its cache folder: `localStorage`, and the database behind `Deno.openKv()`.
- static let workKeptInCaches: Set<String> = ["localhistory", "location_data"]
+ /// `location_data` in its cache folder: `localStorage`, and the database behind `Deno.openKv()`. Raycast keeps
+ /// the images of its clipboard history, which it keeps on the Mac alone, in `Clipboard` inside its cache folder.
+ static let workKeptInCaches: Set<String> = ["localhistory", "location_data", "clipboard"]
/// True for a path under a `Caches` folder that is at or inside one of those folders, or holds one a level
/// or two down, and for a Library's `Caches` folder holding one three levels down, which is how deep they sit
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/AttackRemovalGuardTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/AttackRemovalGuardTests.swift
index 1f62dd4a..d105ab89 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/AttackRemovalGuardTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/AttackRemovalGuardTests.swift
@@ -775,6 +775,8 @@ struct AttackRemovalGuardTests {
try directory.file("home/Library/Caches/JetBrains/IntelliJIdea2026.2/caches/names.dat")
try directory.file("home/Library/Caches/deno/location_data/abc/kv.sqlite3")
try directory.file("home/Library/Caches/deno/deps/https/x.ts")
+ try directory.file("home/Library/Caches/com.raycast.macos/Clipboard/8A2F.png")
+ try directory.file("home/Library/Caches/com.raycast.macos/Images/icon.png")
let guardian = RemovalGuard(
environment: SearchEnvironment(homeDirectory: home, rootDirectory: directory.url.appending(path: "root"))
)
@@ -783,11 +785,16 @@ struct AttackRemovalGuardTests {
"Library/Caches/JetBrains", "Library/Caches/JetBrains/IntelliJIdea2026.2",
"Library/Caches/JetBrains/IntelliJIdea2026.2/LocalHistory", "Library/Caches/JetBrains/IntelliJIdea2026.2/LocalHistory/changes.storageData",
"Library/Caches/deno", "Library/Caches/deno/location_data", "Library/Caches/deno/location_data/abc/kv.sqlite3",
+ "Library/Caches/com.raycast.macos", "Library/Caches/com.raycast.macos/Clipboard",
]
for path in kept {
#expect(!guardian.allowsRemoval(of: home.appending(path: path)), "\(path) may be removed")
}
- for path in ["Library/Caches/JetBrains/IntelliJIdea2026.2/caches", "Library/Caches/deno/deps"] {
+ let caches = [
+ "Library/Caches/JetBrains/IntelliJIdea2026.2/caches", "Library/Caches/deno/deps",
+ "Library/Caches/com.raycast.macos/Images",
+ ]
+ for path in caches {
#expect(guardian.allowsRemoval(of: home.appending(path: path)), "\(path) is refused")
}
}
diff --git a/SAFETY.md b/SAFETY.md
index 562c8bfc..7e65d051 100644
--- a/SAFETY.md
+++ b/SAFETY.md
@@ -83,9 +83,10 @@ Sync, Synology Drive Client, or MEGA keeps in step, known by the entry each writ
says so, and File Search doesn't list it.
Also refused: work that an app keeps inside a *cache* folder and nowhere else. A JetBrains IDE and Android Studio keep a
-history of your changes in `LocalHistory`, beside their caches, which no repository may hold, and Deno keeps
-`localStorage` and its key-value databases in `location_data`. Those folders, and any cache folder that holds one, stay:
-emptying "App Caches" in Space leaves them where they are.
+history of your changes in `LocalHistory`, beside their caches, which no repository may hold, Deno keeps `localStorage`
+and its key-value databases in `location_data`, and Raycast keeps the images of your clipboard history in `Clipboard`
+inside its cache folder. Those folders, and any cache folder that holds one, stay: emptying "App Caches" in Space
+leaves them where they are.
Also refused: a sandboxed app's own `Data/Documents`, which is where that app keeps *your* work, not its
settings. The rule holds for the folder around it too: while `Data/Documents` holds anything, or cannot be