filesystem
Original:🇺🇸 English
Translated
File and directory operations using Claude Code built-in tools — replaces the Filesystem MCP server. Maps all 11 MCP tools to native equivalents: Read, Write, Edit, Glob, Grep, and Bash. Covers file reading with line ranges, parallel reads, pattern-based file search, regex content search, directory listing, tree traversal, move/copy/rename, and metadata inspection. Trigger phrases: "read this file", "write to file", "create a file", "edit file", "find files matching", "search for text in files", "list directory", "show directory tree", "move file", "rename file", "copy file", "file info", "find all Python files", "search codebase for". Use this skill when performing file operations, navigating codebases, or managing directories.
15installs
Added on
NPX Install
npx skill4agent add mathews-tom/praxis-skills filesystemTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Filesystem
All file and directory operations use Claude Code's built-in tools. No MCP server
needed — native tools are faster, more capable, and cost zero context tokens when idle.
Quick Reference
| Filesystem MCP Tool | Replacement | Notes |
|---|---|---|
| | Supports line offset and limit |
| Multiple parallel | Faster than sequential MCP calls |
| | Overwrites entire file |
| | Exact string replacement; surgical edits |
| | Glob for patterns, ls for simple listing |
| | fd is fastest; Glob for pattern filtering |
| | Full regex, file type filters, context lines |
| | |
| | Also handles renames |
| | Size, permissions, timestamps |
| N/A | Claude Code operates in the working directory; no sandbox restrictions |
Reading Files
Read a Single File
Use the tool with an absolute path:
ReadRead: /path/to/file.pyFor large files, use offset and limit to read specific sections:
Read: /path/to/file.py (offset: 100, limit: 50)This reads 50 lines starting from line 100. Use this for files with thousands of lines
to avoid flooding context.
Read Multiple Files in Parallel
Issue multiple calls in a single response. Claude Code executes them concurrently:
ReadRead: /path/to/file1.py
Read: /path/to/file2.py
Read: /path/to/file3.pyParallel reads are faster than the MCP's which serialized internally.
read_multiple_filesRead Images and PDFs
The tool handles binary formats:
Read- Images (PNG, JPG, SVG): displayed visually
- PDFs: extracted text; use for large documents (max 20 pages per call)
pages: "1-5"
Writing and Editing Files
Write a New File
Use the tool to create a file or overwrite an existing one:
WriteWrite: /path/to/new-file.py
Content: <full file content>The tool requires reading the file first if it already exists. For new files,
write directly.
WriteEdit an Existing File
Use the tool for surgical modifications — replace exact string matches:
EditEdit: /path/to/file.py
old_string: "def old_function():"
new_string: "def new_function():"The tool fails if is not unique in the file. Provide enough
surrounding context to make the match unique, or use for
find-and-replace across the entire file.
Editold_stringreplace_all: truePrefer Edit over Write for existing files. Edit preserves everything outside the
changed region and shows a clear diff. Write replaces the entire file.
Finding Files
By Name Pattern (Glob)
Glob: **/*.py → all Python files recursively
Glob: src/**/*.ts → TypeScript files under src/
Glob: *.md → Markdown files in current directory
Glob: **/test_*.py → test files anywhere in the treeResults are sorted by modification time (most recent first).
By Content (Grep)
Grep: pattern="def process_data" type="py"
Grep: pattern="TODO|FIXME" glob="*.py"
Grep: pattern="class.*Controller" output_mode="content" -C=2| Grep Parameter | Purpose |
|---|---|
| Regex pattern to match |
| File type filter (py, js, ts, rust, go, etc.) |
| Glob pattern filter ( |
| |
| Context lines: around, after, before matches |
| Case-insensitive search |
Directory Listing
Simple listing:
bash
ls -la /path/to/directoryRecursive tree with :
fdbash
fd . /path/to/directory --type fTree with depth limit:
bash
fd . /path/to/directory --type f --max-depth 2Filter by extension:
bash
fd -e py /path/to/directoryFile Operations
Create Directory
bash
mkdir -p /path/to/new/directoryThe flag creates all intermediate directories. Always verify the parent path
exists first with .
-plsMove / Rename
bash
mv /path/to/source.py /path/to/destination.pyRename a file (same directory):
bash
mv /path/to/old-name.py /path/to/new-name.pyMove a directory:
bash
mv /path/to/source-dir /path/to/destination-dirCopy
bash
cp /path/to/source.py /path/to/destination.py
cp -r /path/to/source-dir /path/to/destination-dirDelete
bash
rm /path/to/file.py
rm -r /path/to/directoryAlways confirm with the user before deleting files or directories.
File Metadata
bash
stat /path/to/file.py
ls -la /path/to/file.py
wc -l /path/to/file.py| Command | Returns |
|---|---|
| Size, permissions, timestamps, inode |
| Permissions, owner, size, modification date |
| Line count |
| MIME type detection |
Common Workflows
Find and Replace Across Files
bash
# Find all files containing the old string
Grep: pattern="old_function_name" type="py" output_mode="files_with_matches"
# Then Edit each file
Edit: /path/to/file1.py (old_string → new_string, replace_all: true)
Edit: /path/to/file2.py (old_string → new_string, replace_all: true)Explore an Unfamiliar Codebase
- Check project structure:
fd . --type f --max-depth 2 - Read configuration: or
Read: package.jsonRead: pyproject.toml - Find entry points:
Grep: pattern="def main|if __name__" type="py" - Read key files identified above
Find Large Files
bash
fd --type f --exec stat -f '%z %N' {} \; | sort -rn | head -20Error Handling
| Error | Cause | Resolution |
|---|---|---|
| Read: file not found | Path incorrect or file deleted | Verify with |
| Edit: old_string not unique | Multiple matches in the file | Add more surrounding context to make it unique |
| Edit: old_string not found | Content changed since last read | Re-read the file, then retry with current content |
| Write: file not read first | Attempting to overwrite without reading | Read the file first, then Write |
| Permission denied | Insufficient OS permissions | Check with |
| Glob: no files found | Pattern too restrictive | Broaden the pattern; check path spelling |
Limitations
- Read returns up to 2000 lines by default. Use offset/limit for larger files.
- Read truncates lines longer than 2000 characters.
- Edit requires exact string matching — whitespace and indentation must match precisely.
- Write overwrites the entire file. No append mode. To append, read first, then write the combined content.
- Glob only matches files, not directories. Use or
Bash lsto list directories.fd - PDF reading is limited to 20 pages per call. Specify page ranges for large documents.
Calibration Rules
- Read before Edit. Always read a file before editing it. The Edit tool enforces this.
- Edit over Write for existing files. Edit is surgical and shows diffs. Write is a full replacement — use it only for new files or complete rewrites.
- Glob over Bash for file search. Glob is optimized for pattern matching. Only fall
back to or
fdfor queries Glob cannot express (size filters, date filters).find - Grep over Bash for content search. Grep is optimized for ripgrep-based search with
proper permissions. Never use or
grepvia Bash.rg - Parallel reads for multiple files. Issue all Read calls in a single response for concurrent execution.
- Always use absolute paths. Claude Code tools require absolute paths. Never pass relative paths to Read, Write, or Edit.