search-files-content-trim

Search files with truncated content to reduce token usage.

2|7|Updated Jun 19, 2026
One-click install
npx skills add https://github.com/humanerd-drew/opencode-drewgent --skill search-files-content-trim
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: search-files-content-trim
Source: https://github.com/humanerd-drew/opencode-drewgent/tree/main/skills/software-development/search-files-content-trim
Command: npx skills add https://github.com/humanerd-drew/opencode-drewgent --skill search-files-content-trim

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill improves the efficiency of file search operations by trimming content to save tokens, reducing the load on the AI's context and improving overall performance.

Core Features & Use Cases

  • Token-Efficient Search: Automatically truncates file content during search to reduce token usage and save on AI context size.
  • Custom Trimming Options: Offers flexible trimming options with include_content and preview_chars parameters.
  • Use Case: When searching for specific lines or paths in large files, this Skill can trim content to the necessary length, optimizing the AI's processing.

Quick Start

Search for lines containing 'error' in the 'log.txt' file and preview the results.

Frequently Asked Questions about search-files-content-trim

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize token usage when searching for text in large files?

Token usage during file search is optimized by automatically trimming file content to reduce the AI context size. This mechanism prevents large files from overwhelming the AI's processing capacity during search operations.

How does file content trimming work for AI context management?

File content trimming works by truncating search results by default to minimize AI context size. Custom parameters like `include_content` and `preview_chars` allow fine-grained control over how much content is displayed.

Can I control the preview length when searching for lines in large log files?

Yes, you can control the preview length when searching large files by adjusting the `preview_chars` parameter. This allows you to specify the exact number of characters to display, optimizing token efficiency.

What is the best way to reduce AI context size during software development file searches?

The best way to reduce AI context size during file searches is to use a token-efficient search mechanism that truncates content by default. This approach ensures only the necessary content length is processed.

Do I need to adjust search parameters to see full file content instead of a trimmed preview?

Yes, you need to adjust search parameters to bypass default content trimming. Configuring the `include_content` parameter allows you to retrieve the full file content instead of a truncated preview.

Why does my file search return truncated content by default?

File search returns truncated content by default to optimize token usage and save on AI context size. This default behavior is designed to improve overall performance when searching large files.