Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
mhattingpete avatar

File Operations

  • 392 installs
  • 656 repo stars
  • Updated July 25, 2026
  • mhattingpete/claude-skills-marketplace

file-operations is a Claude Code skill that analyzes repository files and returns size, line counts, and metadata via shell commands for developers who need file statistics without modifying sources.

About

file-operations is a Claude Code skill from mhattingpete/claude-skills-marketplace that retrieves file metadata and content statistics using native shell tools without writing changes. It answers analyze-file, line-count, compare-files, and directory-size requests through stat, ls -lh, and du commands on macOS-friendly stat formats. Developers and agents reach for file-operations during refactors, audits, or scaffolding reviews when they need byte sizes, modification times, and line totals before editing. The skill explicitly avoids mutating files, making it safe for read-only reconnaissance in active repositories.

  • Structured read and write flows
  • Safe path-aware edits
  • Batch file moves and copies
  • Scaffold directories and assets
  • Guardrails for destructive ops

File Operations by the numbers

  • 392 all-time installs (skills.sh)
  • +5 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #2,021 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/mhattingpete/claude-skills-marketplace --skill file-operations

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs392
repo stars656
Last updatedJuly 25, 2026
Repositorymhattingpete/claude-skills-marketplace

How do agents get file size and line counts?

Let coding agents reliably read, write, move, copy, and organize repository files while implementing features, running refactors, or generating project scaffolding.

Who is it for?

Developers and coding agents that need quick read-only file statistics, comparisons, and directory sizing during refactors or audits.

Skip if: Bulk file renames, content edits, or Git history analysis—file-operations inspects metadata only and does not modify files.

When should I use this skill?

A user asks to analyze a file, count lines, compare two files' stats, or report directory file statistics without changing content.

What you get

File metadata reports with byte sizes, modification timestamps, line counts, and directory usage summaries.

  • file metadata report
  • line count summary

Files

SKILL.mdMarkdownGitHub ↗

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

1. Get size/mod time: stat -f "%z bytes, modified %Sm" file.py 2. Count lines: wc -l file.py 3. Read file: Read(file_path="file.py") 4. Count functions: Grep(pattern="^def ", output_mode="count") 5. Count classes: Grep(pattern="^class ", output_mode="count")

Compare File Sizes

1. Find files: Glob(pattern="src/**/*.py") 2. Get sizes: ls -lh src/**/*.py 3. Total size: du -sh src/*.py

Code Quality Metrics

1. Total lines: find . -name "*.py" | xargs wc -l 2. Test files: find . -name "test_*.py" | wc -l 3. 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

Related skills

How it compares

Use file-operations for read-only metadata and line counts; choose broader refactor skills when agents must write, move, or reorganize files.

FAQ

Does file-operations modify repository files?

file-operations does not modify files. The skill uses stat, ls, and du to analyze sizes, line counts, and modification times, making it suitable for read-only file information requests.

Which shell commands does file-operations use?

file-operations relies on stat for per-file metadata, ls -lh for directory listings, and du -h for disk usage. Agents invoke it when users ask for file info, statistics, or comparisons.

AI & Agent Buildingagentsautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.