long-context-processing
Skill0 starsChanged 9 months agoMITView on GitHub
Process very large documents or codebases using Gemini's 2M token context window. Use when dealing with content that exceeds typical context limits or requires seeing everything at once.
In this repository2 other files it gives its agents.
- batch-processingSkill
- visual-analysisSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 9 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Document or file content exceeds ~100K tokens
- Distinctive: line 31
Use Glob to find all relevant files
- Distinctive: line 32
Use Read to get file contents
- Very specific: line 35
Call Gemini: Use the process_long_context tool from gemini-api MCP server
- Distinctive: line 38
Use gemini-1.5-pro for best long-context performance
- Distinctive: line 62
When detailed code editing is needed - Claude is better for precise changes
- Distinctive: line 64
When summarization is not the primary goal
- Distinctive: line 68
Always use gemini-1.5-pro model for long context tasks
- Distinctive: line 71
Ask for structured output (headings, lists) for easier parsing
- Distinctive: line 76
When aggregating multiple files, use clear delimiters:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Long Context Processing with Gemini
When to Use This Skill
Automatically invoke this skill when:
- User needs to analyze an entire codebase at once
- Document or file content exceeds ~100K tokens
- User explicitly requests processing multiple large files together
- Task requires comprehensive "see everything" context
- User asks to find patterns across many files
- Analyzing very long documents (books, research papers, extensive logs)
Examples That Trigger This Skill
- "Analyze the entire codebase architecture"
- "Summarize this 500-page document"
- "Find patterns across all log files"
- "Review all Python files in this project"
- "What are the common themes in these research papers?"
- "Analyze all API endpoints across the codebase"
How to Use
- Gather content:
- Use Glob to find all relevant files
- Use Read to get file contents
- Concatenate into a single large text block
- Estimate size: Calculate approximate tokens (chars / 4)
- Call Gemini: Use the
process_long_contexttool from gemini-api MCP server- Pass the aggregated content
- Include user's analysis request as the prompt
- Use gemini-1.5-pro for best long-context performance
- Present results: Return Gemini's comprehensive analysis
Tool Parameters
{
"content": "[very large concatenated text content]",
"prompt": "Analyze the overall architecture and identify main patterns",
"model": "gemini-1.5-pro" // Pro recommended for long context
}Capabilities
- Context Window: Up to 2 million tokens (~1.5 million words, ~8 million characters)
- Whole Codebase Analysis: See entire project structure and relationships
- Pattern Detection: Find recurring themes across extensive content
- Comprehensive Summarization: Distill key points from massive documents
- Cross-file Analysis: Understand how different parts relate to each other
When NOT to Use
- Small documents (< 50K tokens) - use Claude directly instead
- When detailed code editing is needed - Claude is better for precise changes
- Real-time or interactive tasks - prefer Claude's faster response
- When summarization is not the primary goal
Best Practices
- Always use gemini-1.5-pro model for long context tasks
- Structure the prompt clearly: "Given the following [codebase/document/logs], [task]"
- Include file paths or section markers in content for better reference
- Ask for structured output (headings, lists) for easier parsing
- For very large content, consider if you truly need ALL of it or can filter first
Content Formatting
When aggregating multiple files, use clear delimiters:
=== FILE: path/to/file1.py ===
[file content]
=== FILE: path/to/file2.py ===
[file content]This helps Gemini maintain file context in its 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.

