This skill should be used when the user asks about "reading large files", "file too big", "context limit", "chunking files", "offset and limit", "file causing crash", or when encountering files over 10MB. Provides strategies for safely reading large files without exhausting context.
/plugin marketplace add ojallington/large-file-handler/plugin install ojallington-large-file-handler@ojallington/large-file-handlerThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Claude Code has these file reading constraints:
Read specific portions instead of entire files:
Read file with offset=0 limit=500 # First 500 lines
Read file with offset=1000 limit=500 # Lines 1000-1500
Find relevant sections first:
grep -n "pattern" large-file.log | head -20
Then read only around matching line numbers.
Never attempt to read directly:
| File Type | Alternative |
|---|---|
| SQLite DB | sqlite3 file.db "SELECT * FROM table LIMIT 10" |
| Large log | tail -1000 file.log or grep "ERROR" file.log |
| JSON (large) | jq '.specific.path' file.json |
| CSV (large) | head -100 file.csv or csvtool |
| PDF (large) | pdftotext file.pdf - | head -1000 |
| Minified JS | Usually not needed - read source instead |
Add these patterns to prevent accidental reads:
# Binary and database
*.db
*.sqlite
*.exe
*.dll
# Large generated files
*.min.js
*.bundle.js
# Dependencies
node_modules/
vendor/
.venv/
# Build output
dist/
build/
.next/
# Logs
*.log
logs/
/file-check <path> - Check if a file is safe to read/file-chunk <path> - Get chunking strategy for large file/scan-large-files [dir] - Find problematic files in directory/file-check