Access desktop files
Reads and edits local files with controlled filesystem and terminal tools.
Goal
Use this skill when the user wants to interact with the local filesystem of the configured desktop or project environment. It provides controlled local file access for reading text files, inspecting binary documents, searching folders, and performing simple filesystem mutations such as creating, copying, moving, or deleting files and directories.
The backend enforces allowed roots, permissions, approvals, and write access. The assistant should focus on choosing the right command and using explicit absolute paths.
Rule 1
Check if an AGENTS.md (alternatively CLAUDE.md) is available in the root of the Repository or Directory you are going to work on. If so, ALWAYS read it first and follow its instructions.
Tool Selection
fs_read_command
Use this first for read-only filesystem inspection. It supports a strict subset of shell-like read commands:
lscatheadtailsed -nwcstatreadlink -ffindrg, includingrg --filesgrep
Use it for directory discovery, text inspection, exact search, semantic preparation before edits, and safe evidence gathering.
fs_write_command
Use this for simple filesystem mutations after the user intent is clear. It supports:
mkdirtouchcpmvrm
By default, rm moves paths to the operating system trash. Use rm --permanent only when the user explicitly wants irreversible deletion.
edit_file
Use this to change parts of one existing UTF-8 text file without rewriting it whole. It is anchor-based: every edit gives a one-based start_line (a positional hint, matching may drift nearby), an expected_text anchor, and the full replacement for that span. Read the file with fs_read_command first to get current line numbers and content. All edits in one call apply atomically to the same file state and must not overlap. Do not send legacy fields such as revisions, end_line_exclusive, or old_text; they are not part of this API and cause a binding error.
write_file
Use this to create a new text file or fully regenerate an existing one. mode="overwrite" replaces the whole file, mode="append" adds content at the end without reconstructing prior content. Prefer edit_file when only part of an existing file changes; reserve write_file for new files or small files rewritten from scratch.
exec_terminal_command
Use this when normal command execution is needed and the strict filesystem tools are not enough, for example:
- running project scripts,
- executing tests,
- invoking formatters or build tools,
- inspecting tool help,
- using commands outside the supported
fs_read_commandorfs_write_commandsubset.
Prefer fs_read_command and fs_write_command for normal local file access because they are narrower and easier to audit.
Path Rules
- Use explicit absolute paths in filesystem commands.
- Do not rely on relative paths for
fs_read_commandorfs_write_command. - Quote paths when they contain spaces or shell-sensitive characters.
- Use
readlink -fwhen a user gives a path that may be a symlink and the resolved location matters. - Let the backend handle allowed roots, access checks, approvals, and denied paths.
Reading Workflow
- Start by orienting with
ls,find, orrg --fileson the relevant absolute directory. - Use
stat,wc,head,tail, orsed -nto inspect size, type, and relevant excerpts before reading large files fully. - Use
rg -nfor code and text search when possible. - Use
catonly when the file is small enough or when you intentionally need the file payload or document metadata. - Increase or lower
max_output_charsbased on the task, but do not dump huge files unnecessarily.
Binary and Document Reading
fs_read_command has a special MIME-aware cat behavior:
- Text files return normal shell-like stdout.
- Image files emit a short text note plus an inline image payload.
- Supported Office, PDF, image, and similar binary documents emit a short text note plus structured attachment metadata for downstream document tooling.
Use cat /absolute/path/to/file when the user wants to open or ingest a supported local binary document. This is the preferred way to hand local binary documents to later document-analysis, indexing, or extraction workflows.
Do not assume binary files will print meaningful text. If cat returns structured metadata instead of text, treat that as the successful read surface and continue with the appropriate downstream document tooling if available.
Writing Workflow
- Confirm the intended mutation from the user request and identify the exact absolute target paths.
- To create or change the content of a text file, use
edit_file(surgical anchor edits) orwrite_file(whole file); usefs_write_commandonly for the path-level operations below. - Use
mkdir -pbefore writing workflows that require missing parent directories. - Use
cpfor duplication andmvfor rename or relocation. - Use
rmfor trash deletion when the user asks to delete something. - Use
rm --permanentonly when irreversible deletion was explicitly requested. - After a mutation, verify the result with
fs_read_command, usuallyls -la,stat, orfind.
Terminal Workflow
- Use
exec_terminal_commandonly when the strict filesystem tools are insufficient. - Keep commands scoped to the relevant project or folder.
- Prefer read-only terminal commands before modifying anything.
- Avoid destructive shell operations unless the user clearly requested them and safer tools are not adequate.
- For code or project tasks, inspect files first, then run targeted validation commands.
Safety and Output Rules
- Do not invent local paths. Discover them or use paths provided by the user.
- For text content changes prefer
edit_file/write_file; do not rewrite file content with in-placesed -iin the terminal, which can corrupt files and mishandle quoting. - Do not modify files when the user only asked to inspect or explain them.
- Before broad deletion, moving, or overwriting, prefer showing the matched paths first unless the request is already precise.
- Report what was read or changed using concise path-based summaries.
- If access is denied, a command is unsupported, or a path is outside the allowed root, state the limitation and choose the nearest safe alternative.
- When a binary document was read through MIME-aware
cat, say that the document payload or metadata was obtained, not that the raw binary text was read.
