一键导入
file-read
Read files efficiently to minimize token usage — use targeted reads instead of dumping entire files
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Read files efficiently to minimize token usage — use targeted reads instead of dumping entire files
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use for math calculations.
Use for date/time.
Rules to minimize token usage
Native macOS built-in screen capture. Saves directly to ~/Desktop using exact system timestamp naming, so agent can automatically detect and read the latest screenshot without manual file paths. macOS only.
Maintain a living context document (plan.md) as a self-note to preserve the original agenda, track progress, and prevent context drift during complex tasks
A meta-skill to create new skills in the default skill directory with proper YAML front matter
| name | file-read |
| description | Read files efficiently to minimize token usage — use targeted reads instead of dumping entire files |
Read files efficiently — fetch only what you need. Never cat a large file when a subset suffices.
| Situation | Command |
|---|---|
| Know what you're looking for | grep -n "symbol" file |
| Need first N lines | head -n 50 file |
| Need last N lines | tail -n 30 file |
| Need lines M–N | sed -n 'M,Np' file |
| Unknown file, check size first | wc -l file && head -n 30 file |
| File < 100 lines | cat file |
wc -l file.txt # check size before reading
grep -n "pattern" file.txt # find lines + line numbers
grep -n -A 5 -B 2 "pattern" file.txt # with surrounding context
grep "^import\|^from" file.py # filter specific line types
grep -v "^#\|^$" file.txt # skip comments/blank lines
head -n 50 file.txt # first 50 lines
tail -n 30 file.txt # last 30 lines
sed -n '10,30p' file.txt # lines 10–30
sed -n '/^## Section/,/^## /p' file.txt # between markers
grep -n "^def my_func" file.py # find block start line
sed -n '42,60p' file.py # then extract the block
{ sed -n '1,10p' f.txt; echo "---"; sed -n '80,90p' f.txt; } # non-contiguous
wc -l file.txt && head -n 5 file.txt && echo "..." && tail -n 5 file.txt # summarize
wc -l before reading unknown filesgrep first when you know what you're looking forcat on files > 200 lines unless full content is required