
file-operations
Analyze files and get detailed metadata including size, line counts, modification times, and content statistics. Use when users request file information, statistics, or analysis without modifying files.
- Installs
- 415
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/mhattingpete/claude-skills-marketplace --skill file-operations- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads file-operations automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
File Operations
Analyze files and retrieve metadata using Claude's native tools without modifying files.
When to Use
- "analyze [file]"
- "get file info for [file]"
- "how many lines in [file]"
- "compare [file1] and [file2]"
- "file statistics"
Core Operations
File Size & Metadata
stat -f "%z bytes, modified %Sm" [file_path] # Single file
ls -lh [directory] # Multiple files
du -h [file_path] # Human-readable size
Line Counts
wc -l [file_path] # Single file
wc -l [file1] [file2] # Multiple files
find [dir] -name "*.py" | xargs wc -l # Directory total
Content Analysis
Use Read to analyze structure, then count functions/classes/imports.
Pattern Search
Grep(pattern="^def ", output_mode="count", path="src/") # Count functions
Grep(pattern="TODO|FIXME", output_mode="content", -n=true) # Find TODOs
Grep(pattern="^import ", output_mode="count") # Count imports
Find Files
Glob(pattern="**/*.py")
Workflow Examples
Comprehensive File Analysis
- Get size/mod time:
stat -f "%z bytes, modified %Sm" file.py - Count lines:
wc -l file.py - Read file:
Read(file_path="file.py") - Count functions:
Grep(pattern="^def ", output_mode="count") - Count classes:
Grep(pattern="^class ", output_mode="count")
Compare File Sizes
- Find files:
Glob(pattern="src/**/*.py") - Get sizes:
ls -lh src/**/*.py - Total size:
du -sh src/*.py
Code Quality Metrics
- Total lines:
find . -name "*.py" | xargs wc -l - Test files:
find . -name "test_*.py" | wc -l - TODOs:
Grep(pattern="TODO|FIXME|HACK", output_mode="count")
Find Largest Files
find . -type f -not -path "./node_modules/*" -exec du -h {} + | sort -rh | head -20
Best Practices
- Non-destructive: Use Read/stat/wc, never modify
- Efficient: Read small files fully, use Grep for large files
- Context-aware: Compare to project averages, suggest optimizations
Integration
Works with:
- code-auditor: Comprehensive analysis
- code-transfer: After identifying large files
- codebase-documenter: Understanding file purposes
FAQ
What does the file-operations skill do?
Analyze files and get detailed metadata including size, line counts, modification times, and content statistics. Use when users request file information, statistics, or analysis without modifying files.
How do I install file-operations?
Run npx skills add https://github.com/mhattingpete/claude-skills-marketplace --skill file-operations in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/file-operations/ (personal) or .claude/skills/file-operations/ (project).
Which AI agents can use file-operations?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is file-operations safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains file-operations?
It is published by mhattingpete in mhattingpete/claude-skills-marketplace. It has 415 recorded installs.
More from mhattingpete/claude-skills-marketplace
flowchart-creator
mhattingpete/claude-skills-marketplace
Create HTML flowcharts and process diagrams with decision trees, color-coded stages, arrows, and swimlanes. Use when users request flowcharts, process diagrams, workflow visualizations, or decision trees.
codebase-documenter
mhattingpete/claude-skills-marketplace
Generates comprehensive documentation explaining how a codebase works, including architecture, key components, data flow, and development guidelines. Use when user wants to understand unfamiliar code, create onboarding docs, document architecture, or explain how the system works.
architecture-diagram-creator
mhattingpete/claude-skills-marketplace
Open the skill to read its SKILL.md instructions.
git-pushing
mhattingpete/claude-skills-marketplace
Stage, commit, and push git changes with conventional commit messages. Use when user wants to commit and push changes, mentions pushing to remote, or asks to save and push their work. Also activates when user says "push changes", "commit and push", "push this", "push to github", or similar git workflow requests.
test-fixing
mhattingpete/claude-skills-marketplace
Run tests and systematically fix all failing tests using smart error grouping. Use when user asks to fix failing tests, mentions test failures, runs test suite and failures occur, or requests to make tests pass.
code-auditor
mhattingpete/claude-skills-marketplace
Performs comprehensive codebase analysis covering architecture, code quality, security, performance, testing, and maintainability. Use when user wants to audit code quality, identify technical debt, find security issues, assess test coverage, or get a codebase health check.
Popular other skills
hyperframes-cli
heygen-com/hyperframes
The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.
triage
mattpocock/skills
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.
ask-matt
mattpocock/skills
Ask which skill or flow fits your situation. A router over the skills in this repo.
to-questionnaire
mattpocock/skills
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
loop-me
mattpocock/skills
Grill me about specs for the workflows I want to build, within this workspace.