text-scan

# text-scan

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "text-scan" with this command: npx skills add text-scan

text-scan

Description

Search for relevant information in text files without reading the entire file. Returns matching lines with context, scored by relevance. Useful for quickly finding specific information in large files.

When to Use

  • You need to find a specific piece of information in a file but don't know the exact location
  • You want to scan multiple files for relevant content before deciding which to read fully
  • Marek wants you to extract specific lines from large files
  • You're doing research and need to quickly scan through notes, logs, or documents
  • The file is very large and reading it entirely would waste tokens/time

How It Works

The script uses token-based matching with scoring:

  • Exact token matches score 2 points
  • Substring/partial matches score 1 point
  • Phrase matches (adjacent query terms found together in the line) score 3 points
  • Results are sorted by score and limited

Usage

# Basic search
python3 <skill_dir>/scripts/text-scan.py <file> --query "<search terms>"

# Brief format (line number + content)
python3 <skill_dir>/scripts/text-scan.py <file> --query "<search terms>" --brief

# JSON output (for programmatic use)
python3 <skill_dir>/scripts/text-scan.py <file> --query "<search terms>" --json

# Custom context window
python3 <skill_dir>/scripts/text-scan.py <file> --query "<search terms>" --before 3 --lines 5

# From stdin
cat <file> | python3 <skill_dir>/scripts/text-scan.py --query "<search terms>"

Examples

# Find the runway in STATE.md
python3 <skill_dir>/scripts/text-scan.py /home/marek/.openclaw/workspace/STATE.md --query "runway"

# Find today's work hours
python3 <skill_dir>/scripts/text-scan.py /home/marek/.openclaw/workspace/STATE.md --query "today work hours"

# Find all log entries about a topic
python3 <skill_dir>/scripts/text-scan.py /home/marek/.openclaw/workspace/LOG.md --query "weather"

Parameters

ParameterDescriptionDefault
--query, -qSearch query (keywords)required
--lines, -aLines after each match5
--before, -bLines before each match2
--max-results, -nMaximum results to return5
--jsonJSON output formatfalse
--briefBrief format onlyfalse
--fuzzyEnable fuzzy matchingfalse
--output, -oWrite results to filestdout

Integration with OpenClaw

This skill integrates with the standard read tool workflow:

  1. Use text-scan to quickly find relevant lines in a file
  2. If the result is significant, use read to load the full file context
  3. This reduces token usage by avoiding reading unnecessary content

Tips

  • Use shorter queries for broader matches, longer phrases for precision
  • The --brief flag is fastest for quick scans
  • --json output is useful for scripting/automation
  • Combine with find to scan multiple files: find . -name "*.md" | xargs ...
  • Score 3+ matches are usually high-confidence — worth reading in full

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Img2img

Generate images from text descriptions using DALL-E 3 while adhering to usage policies and avoiding realistic human faces.

Registry SourceRecently Updated
General

Habitat-GS-Navigator

Navigate and interact with photo-realistic 3DGS environments via the Habitat-GS Bridge. Use when: user asks to explore a 3D scene, perform embodied navigatio...

Registry SourceRecently Updated
General

Memory Palace

持久化记忆管理。Use when: 用户告诉你个人信息/偏好/习惯、需要记住项目状态/技术决策、完成任务后有可复用经验、用户说"记住""别忘了""下次注意"、需要回忆之前的对话内容。支持语义搜索和时间推理。

Registry SourceRecently Updated
General

Podcast Transcript Mining Authority Positioning

Extract guest appearances, speaking topics, and soundbites from podcast transcripts to build authority portfolios and generate podcast pitch templates. Use w...

Registry SourceRecently Updated