file-operations
Provides metadata analysis for files, including size, line counts, and content search, without changing the file contents.
Install
mkdir -p .claude/skills/file-operations && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5797" && unzip -o skill.zip -d .claude/skills/file-operations && rm skill.zipInstalls to .claude/skills/file-operations
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
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.Key capabilities
- →Retrieve file metadata including size and modification time
- →Calculate line counts for individual files or directories
- →Search file content using pattern matching
- →Identify specific code tags like TODO or FIXME
- →List files matching glob patterns
How it works
It utilizes standard system utilities like stat, wc, find, and grep to extract information from the file system without altering any files.
Inputs & outputs
When to use file-operations
- →Compare file sizes between versions
- →Count total lines of code in a directory
- →Identify TODO and FIXME tags in the codebase
- →Generate file statistics for project auditing
About this skill
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
When not to use it
- →Modifying file contents
- →Performing destructive file operations
Limitations
- →Restricted to read-only operations
How it compares
It automates the execution of multiple command-line tools to provide structured insights rather than requiring manual command entry.
Compared to similar skills
file-operations side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| file-operations (this skill) | 1 | 9mo | Review | Beginner |
| retrospect-external-babysitter-run | 0 | 4mo | Review | Advanced |
| conversation-analyzer | 8 | 9mo | Review | Intermediate |
| session-logs | 8 | 2mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by mhattingpete
View all by mhattingpete →You might also like
retrospect-external-babysitter-run
a5c-ai
For a repository in the babysitter-users catalog, locate its babysitter processes and any committed runs (.a5c/runs/<runId>/) and perform a retrospective on a chosen run -- what went well, what failed, process suggestions, quality of effect design, breakpoint patterns -- mirroring the /babysitter:re
conversation-analyzer
mhattingpete
Analyzes your Claude Code conversation history to identify patterns, common mistakes, and opportunities for workflow improvement. Use when user wants to understand usage patterns, optimize workflow, identify automation opportunities, or check if they're following best practices.
session-logs
openclaw
Search and analyze your own session logs (older/parent conversations) using jq.
context-management-context-restore
sickn33
Use when working with context management context restore
conversation-memory
davila7
Persistent memory systems for LLM conversations including short-term, long-term, and entity-based memory Use when: conversation memory, remember, memory persistence, long-term memory, chat history.
zlibrary-to-notebooklm
zstmfhy
自动从 Z-Library 下载书籍并上传到 Google NotebookLM。支持 PDF/EPUB 格式,自动转换,一键创建知识库。