Workarounds and best practices for using Desktop Commander MCP to write code directly to the PANaCEa repo. Use this skill whenever you need to write files, read files, edit code, or run commands via Desktop Commander tools on Aaron's local machine. Also use when you encounter empty read_file results, git lock errors, write_file timeouts, or tsc OOM crashes. This skill prevents the most common Desktop Commander pitfalls that derail implementation sessions.
Desktop Commander has several known quirks that cause silent failures or wasted tool calls. This skill documents every workaround discovered through real implementation sessions, so you don't lose time rediscovering them.
mcp__Desktop_Commander__read_file frequently returns only metadata (fileName,
filePath, fileType) with no actual file content. This is the single most common
failure mode.
Workaround: Use start_process with cat or head/tail/sed -n:
mcp__Desktop_Commander__start_process({ command: "cat /path/to/file.ts", timeout_ms: 5000 })
mcp__Desktop_Commander__start_process({ command: "sed -n '100,200p' /path/to/file.ts", timeout_ms: 5000 })
mcp__Desktop_Commander__start_process({ command: "head -50 /path/to/file.ts", timeout_ms: 5000 })
Always try first (it's faster when it works), but switch to + the moment you get empty content back.
read_filestart_processcatwrite_file with mode: 'append' can timeout after 60s on larger chunks,
especially on mounted/network volumes. This corrupts the file mid-write.
Workaround: Keep chunks to 25–30 lines maximum. For a 200-line file:
write_file(path, first30lines, { mode: 'rewrite' })write_file(path, next30lines, { mode: 'append' })After a timeout, always check the file state with tail -10 before continuing
to ensure the partial write didn't corrupt closing braces or syntax.
Stale lock files from prior processes cause git operations to fail with "Unable to create '.git/index.lock': File exists".
Workaround: Remove lock files before git operations:
rm -f .git/index.lock .git/HEAD.lock
The 6,000+ file codebase exceeds Node's default heap for full type checking.
tsc --noEmit will crash with OOM.
Workaround: Don't run full tsc. Instead:
npx vitest run tests/specificFile.test.tsnpx tsc --noEmit path/to/file.ts (single file)grep to verify imports resolve correctlyWhen adding features to existing services (like adding drift detection to retrievabilityCalibrationService), prefer appending rather than rewriting:
tail to know the current statewrite_file mode: 'append'tail -20 after writingThis avoids accidentally destroying the existing implementation.
Use edit_block for surgical replacements in existing files. Provide enough
context in old_string to uniquely identify the location.
git status --short before and after changesgit add -A (avoids committing secrets)feat: Sprint N — description of changesWhen you need to read multiple files, launch multiple start_process calls
in the same turn — they run concurrently:
// Good: parallel reads
start_process({ command: "cat file1.ts", timeout_ms: 5000 })
start_process({ command: "cat file2.ts", timeout_ms: 5000 })
start_process({ command: "grep -n 'pattern' file3.ts", timeout_ms: 5000 })