dont-be-greedy
Skill60 starsChanged 10 months agoMITView on GitHub
When a user uploads or references a data file (CSV, JSON, XLSX, TXT, LOG) or any file larger than 100KB, immediately estimate token cost using scripts/estimate_size.py. If >30k tokens, chunk the file and summarize each chunk. If smaller, run quick inspection. Return a safe preview and summary without asking the user what to do.
In this repository38 other files it gives its agents.
- agent-auditSkill
- battle-planSkill
- breadcrumbsSkill
- careful-deleteSkill
- debug-to-fixSkill
- dripSkill
- etaSkill
- fan-outSkill
- geordieSkill
- granola-syncSkill
- keep-it-simpleSkill
- learn-from-thisSkill
- loose-endsSkill
- map-reduceSkill
- obsidian-base-createSkill
- obsidian-canvas-createSkill
- obsidian-daily-driverSkill
- obsidian-note-createSkill
- obsidian-session-syncSkill
- obsidian-vault-initSkill
- obsidian-vault-searchSkill
- pair-modeSkill
- pipelineSkill
- pre-mortemSkill
- prove-itSkill
- retrospectiveSkill
- rubber-duckSkill
- safe-refactorSkill
- sanity-checkSkill
- skill-creatorSkill
- skill-forgeSkill
- skill-gateSkill
- split-decisionSkill
- stay-in-laneSkill
- trace-itSkill
- you-sureSkill
- youtube-transcriptSkill
- zero-inSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Before loading ANY data file:
- Very specific: line 76
Use cat on unknown or large files
- Distinctive: line 77
Ask "What would you like me to do with this file?"
- Distinctive: line 78
Wait for user direction before acting on file uploads
- Distinctive: line 83
Run size estimation before any file operation
- Very specific: line 96
Run scripts/estimate_size.py sales.csv → Output: bytes=52428800 (50.0MB) tokens=13107200
- Very specific: line 98
Run scripts/summarize.py on representative chunks
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Don't Be Greedy
<purpose>
Prevents context overflow by enforcing size-aware data loading. Large files can
exceed context windows and crash agent workflows. This skill measures files before
loading, chunks oversized data, and returns compact summaries with safe previews
so downstream processing can continue without context exhaustion.
</purpose>Instructions
Step 1: Estimate Token Cost
Before loading ANY data file:
python scripts/estimate_size.py "<file_path>"This returns byte count and estimated token count.
Step 2: Apply Strategy Based on Size
| Estimated Tokens | Action |
| < 10,000 | Run quick inspection, load directly |
| 10,000 - 30,000 | Run quick inspection, consider filtering |
| > 30,000 | Chunk and summarize before loading |
Step 3: Execute Appropriate Workflow
<strategy name="small-file">
For files under 10k tokens:python scripts/quick_inspect.py "<file_path>"Return stats and load file directly.
</strategy>
<strategy name="large-file">
For files over 30k tokens:python scripts/chunker.py "<file_path>"
python scripts/summarize.py "<chunk_file>"Return overall summary + per-chunk summaries + safe preview of first rows.
</strategy>
Step 4: Return Structured Output
Always provide:
- Overall summary (1-3 paragraphs)
- Safe preview (first N rows/lines)
- Recommendation for next steps
- Chunk information if file was split
NEVER
- Load files without running estimate_size.py first
- Use
caton unknown or large files - Ask "What would you like me to do with this file?"
- Wait for user direction before acting on file uploads
- Load raw data exceeding 30k tokens into context
ALWAYS
- Run size estimation before any file operation
- Chunk files over 30k tokens automatically
- Provide a safe preview even for large files
- Act immediately when a data file is detected
- Be thorough in first response with summary + preview + recommendation
Examples
Example 1: User uploads large CSV
Input: User says "Analyze this sales data" and uploads a 50MB CSV file
Workflow:
- Run
scripts/estimate_size.py sales.csv→ Output:bytes=52428800 (50.0MB) tokens=13107200 - Way over 30k tokens. Run
scripts/chunker.py sales.csv→ Creates 6500+ chunks - Run
scripts/summarize.pyon representative chunks - Return:
- Overall summary of data structure and content
- Safe preview showing first 10 rows
- Recommendation: "Data contains 1M rows of sales transactions. I've chunked it for processing. Want me to analyze specific columns or date ranges?"
Example 2: User references small JSON config
Input: User asks "Check my config.json for issues"
Workflow:
- Run
scripts/estimate_size.py config.json→ Output:bytes=2048 (2.0KB) tokens=512 - Under 10k tokens. Run
scripts/quick_inspect.py config.json - Load file directly and analyze
- Return: Full analysis with any issues found
Example 3: User uploads medium log file
Input: User uploads a 500KB application.log
Workflow:
- Run
scripts/estimate_size.py application.log→ Output:bytes=512000 (500.0KB) tokens=128000 - Over 30k tokens. Run
scripts/chunker.py application.log - Summarize chunks focusing on errors and warnings
- Return:
- Summary of log timespan and key events
- Count of errors, warnings, info messages
- Safe preview of recent entries
- Recommendation for focused analysis
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

