User Story
As a user,
I want a tool for removing files,
so that the LLM can manage the filesystem directly from within Tomo without escaping into run_command rm.
Acceptance Criteria
Tool shape
Permissions
Confirmation
Validation and behaviour
Tests
Additional Context
run_command rm already covers this case but at the cost of shell quoting, cross-platform inconsistency, and a confirmation prompt on every call that doesn't match allowedCommands. A dedicated remove_file tool with its own permission gate gives cleaner ergonomics for the common refactor/rename workflow and lets the user grant cwd-scoped trust for file removal without having to allowlist rm patterns globally.
Pairs with #251 (remove_dir). Together they cover the destructive filesystem operations the LLM currently has to do via run_command.
Implementation references:
src/tools/write-file.ts for the permission + confirm flow shape
src/tools/permissions.ts for checkFilePermission and isPathWithinCwd
src/config/schema.ts:19 for the permissions schema where the new keys go
User Story
As a user,
I want a tool for removing files,
so that the LLM can manage the filesystem directly from within Tomo without escaping into
run_command rm.Acceptance Criteria
Tool shape
remove_filetool registered alongside existing tools atsrc/tools/remove-file.ts, follows existing tool patterns (zod schema,Toolinterface, colocated test file, registered insrc/app.tsx)path(required, absolute or relative to cwd)remove_dirfor directories, fails clearly on missing path or directory pathformatCallreturns the path for the collapsed tool headertoolsSchemainsrc/config/schema.tsso the tool can be enabled/disabled (defaultenabled: true)Permissions
permissionsSchemainsrc/config/schema.ts:cwdRemoveFile(defaultfalse) — allows removing files within the cwd without confirmationglobalRemoveFile(defaultfalse) — allows removing files outside the cwd without confirmationisPathWithinCwdhelper fromsrc/tools/permissions.tscheckFilePermissionwith a"remove"operation type or add a parallel helper — implementer's call, just keep the shape consistent with the existing read/write logicConfirmation
deniedresult; flow follows the same pattern aswrite-file.tsValidation and behaviour
remove_dir)okresult confirming the path was removedTests
deniedand leaves the file in place; same set of cases for globalAdditional Context
run_command rmalready covers this case but at the cost of shell quoting, cross-platform inconsistency, and a confirmation prompt on every call that doesn't matchallowedCommands. A dedicatedremove_filetool with its own permission gate gives cleaner ergonomics for the common refactor/rename workflow and lets the user grant cwd-scoped trust for file removal without having to allowlistrmpatterns globally.Pairs with #251 (
remove_dir). Together they cover the destructive filesystem operations the LLM currently has to do viarun_command.Implementation references:
src/tools/write-file.tsfor the permission + confirm flow shapesrc/tools/permissions.tsforcheckFilePermissionandisPathWithinCwdsrc/config/schema.ts:19for the permissions schema where the new keys go