About desktop-commander
Desktop Commander is a skill that guides agents through MCP tools for reading and editing files, searching content, and managing processes. It is intended for local environment tasks, with incremental verification and explicit approval for high-risk operations.
Key features
- 01Read text, PDFs, images, and spreadsheets with pagination
- 02Search file names and file contents
- 03Make targeted edits or write files in chunks
- 04Start and interact with processes
- 05Inspect configuration, tool-call history, and usage
Use cases
- 01Find files or text in a codebase
- 02Inspect logs, PDFs, or spreadsheet content
- 03Edit large files in chunks or update spreadsheet ranges
- 04Run interactive shells, REPLs, or development servers
MCP support
The skill uses Desktop Commander MCP tools for file operations, search, and process management, and provides workflows and safety guidance for those tools.
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ ry-run/ run-skills --skill desktop-commanderAfter installing, type/desktop-commanderin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
SKILL_zh.mdagents/openai.yamlreferences/desktop-commander_zh.mddesktop-commander.mdDetails
From the project READMEDesktop Commander
Quick start
Goal: use Desktop Commander MCP to turn “files / processes / search / edits” into verifiable tool calls (small, safe steps) instead of treating the machine as a black box.
Most common entry points:
- Read content:
mcp__desktop-commander__read_file(paging, negative offset tail, PDF/image/Excel/URL). - Small edits:
mcp__desktop-commander__edit_block(targeted text replace / Excel range update). - Large edits:
mcp__desktop-commander__write_filein chunks (respectfileWriteLineLimit). - Interactive work:
mcp__desktop-commander__start_process+mcp__desktop-commander__interact_with_process+mcp__desktop-commander__read_process_output.
Official notes + tool list: skills/desktop-commander/references/desktop-commander.md.
Workflow decision tree
- Do I need to find something?
- File names/paths:
mcp__desktop-commander__start_search(searchType="files") →mcp__desktop-commander__get_more_search_results - File contents:
mcp__desktop-commander__start_search(searchType="content") → paginate →mcp__desktop-commander__stop_searchwhen done
- Do I need to read or change content?
- Read:
mcp__desktop-commander__read_file(useoffset/length; useoffset=-Nfor tail) - Small change:
mcp__desktop-commander__edit_block(default replaces 1 occurrence; useexpected_replacementsfor multiple) - Large change:
mcp__desktop-commander__write_file(mode="rewrite"thenmode="append"chunked)
- Do I need to run commands / keep sessions?
- One-off commands:
mcp__desktop-commander__start_process(shell command) + read output - REPL / SSH / DB / dev server:
start_process→interact_with_process→read_process_output
- Is this a high-risk operation (config changes, killing processes, bulk edits/moves, any data loss)?
- Explain impact + rollback first; require explicit user confirmation before executing.
- Prefer making config changes in a separate chat (official guidance).
Recipes
Reading files
- Text/code:
read_filewith pagination; logs:offset=-200(tail-like). - Multiple files:
read_multiple_filesto reduce round trips. - URLs:
read_filewithisUrl: truefor web content/images.
Editing files
- Targeted replace:
edit_blockwith minimal unique context; for many occurrences setexpected_replacements. - Rewrites:
write_filein 25–30 line chunks (rewritethenappend). - Excel: read via
read_file; edit viaedit_blockwithrange+ 2D array. - PDFs: only via
write_pdf(do not usewrite_filefor PDFs).
Search
- Prefer
start_search+get_more_search_resultsfor repo exploration; stop searches you no longer need. - Use
literalSearch: truefor patterns with special characters (parentheses, brackets, dots, etc.).
Processes & interaction
- Data analysis: run
python3 -i, then useinteract_with_processfor pandas/numpy workflows. - Observing long jobs: call
read_process_outputperiodically; to stop usekill_process/force_terminate(high-risk). - Status:
list_sessions/list_processes.
Config & audit
get_config/set_config_value: use carefully; directory restrictions are not a security boundary for terminal commands.get_recent_tool_calls: recover context and debug “what happened”.get_usage_stats: usage/performance insight.
Guardrails (must follow)
- Prefer absolute paths; don’t assume OS-specific separators.
- For big changes: read first; keep edits small; chunk writes; keep rollback in mind.
- High-risk actions require explicit confirmation: config changes, killing sessions/processes, bulk file edits/moves, any destructive command.
- Security:
allowedDirectorieslimits filesystem tools, not terminal commands—don’t treat it as sandboxing.
References
- Official notes + tool list:
skills/desktop-commander/references/desktop-commander.md