Skip to content

Files page: look through and clean up every agent's files, notes and memory - #216

Open
danielehrhardt wants to merge 9 commits into
mainfrom
feat/workspace-editor
Open

danielehrhardt wants to merge 9 commits into
mainfrom
feat/workspace-editor

Conversation

@danielehrhardt

Copy link
Copy Markdown
Contributor

Godmode gets messy over time: agents keep reports, screenshots, scratch builds and notes, and the only way to tidy up by hand was Finder. This adds a Files page (sidebar, ⌘K, and links from an agent's Memory tab and from Settings → Cleanup) where you look through every agent's files and clean them up yourself.

Overview

Overview — every agent with what its workspace, notes and memory take (largest first), how much of it is scratch in tmp/, its note count, MEMORY.md length against the budget, and what waits in its bin.

Browse — a Finder-like list per folder with folder sizes (counted in the background), last change, sort by name/size/date, filter, and a search through every file name and note. Click a file to open it next to the list: Markdown gets Edit / Split / Preview, pictures a preview. Rename, move (with a folder picker), new note, new folder, multi-select and delete. Godmode's own files (CLAUDE.md, MEMORY.md, runs, transcripts, state, tmp/ and uploads/ themselves) are locked.

Browse

Review — what clutters the repository, grouped, with a sentence why: installed packages and build output, junk (logs, .DS_Store, temp files), empty files and folders, copies (same content, the other copy stays), large files, large scratch in tmp/, entries untouched for 30 days, loose files at the top, memory notes nothing links to, and broken links in MEMORY.md. The safe groups start ticked unless the agent still names the item; everything the agent names carries a "named in MEMORY.md" tag.

Review

Notes — every Markdown note (MEMORY.md, memory/, workspace) with title, size and age; memory notes without a link from MEMORY.md are marked and can be filtered.

Bin — nothing is deleted right away. Deletes go to the agent's bin (<agents>/.deleted-files/<agent>/), the toast has Undo, the Bin tab puts things back (next to a new file of the same name if one took the place) or deletes them for good. A new cleanup item "Deleted files" (recommended, part of the daily automatic cleanup) removes what waited longer than 30 days.

Delete Bin
Delete Bin

Safety

  • All paths are confined to the agent's repository (no .git, no way out, symlinks never followed; a symlink is moved or deleted as itself).
  • A move rewrites mentions of the old path in MEMORY.md and memory/ notes (repository paths and the agent's own absolute ones, never another agent's; links next to a moved memory note and its [[name]] follow too). What Godmode can't rewrite — the agent's instructions, automations and follow-ups — is shown as a warning before the move or rename.
  • Nothing is moved or created in workspace/tmp (cleared without the bin) or workspace/uploads. Locks hold in any spelling (memory.md on macOS is MEMORY.md).
  • "New note" never overwrites: the name is checked as the final file name and the write is create-only on the server (409).
  • The review never guesses: a folder it couldn't look all through (very deep, very large, unreadable) is never called empty, junk counts as content, downloads still being written are left out, and a copy whose twin is also listed isn't offered.
  • Search, notes and sizes don't follow a linked MEMORY.md, memory/ or workspace/ out of the repository. A delete across disks keeps the bin's full copy if the source can't be removed completely.
  • Nothing moves or goes while the agent dreams (409), since a dream's rollback and undo track the workspace. While the agent works, the page says so.
  • Every change is committed to the agent's repository.
  • Cloud: the new routes are allowed for owners/operators; viewers can read and inspect, not change. Phones don't reach them.

Also: the memory editor is now one shared component (components/files/file-editor.tsx) with a side-by-side Markdown view and word count, used by the Memory tab and the Files page.

Tests: packages/core/test/agent-files.test.ts, 18 tests (sizes without following links, bin + restore + purge, locked paths in any spelling, moves and memory rewrites incl. relative and wiki links, no moves into tmp/uploads, inspect and pins, folders, review kinds incl. deep/junk-only folders, create-only notes, notes, search without symlinked reads, links in the bin, tampered and broken bin entries, dream lock, 30-day cleanup, overview). Typecheck clean in all packages; full core suite 2032 pass, 3 fail that also fail on untouched main on this Mac (mods x2, Cua Driver hang) and pass in CI.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant