code-search-efficient

Minimizes token waste while accurately searching source code with AST-based tools and LSP-first strategies for Java and beyond.

8|1|Updated Mar 1, 2026
One-click install
npx skills add https://github.com/JoeCP17/LLM-Dot-files --skill code-search-efficient
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-search-efficient
Source: https://github.com/JoeCP17/LLM-Dot-files/tree/main/claude/skills/code-search-efficient
Command: npx skills add https://github.com/JoeCP17/LLM-Dot-files --skill code-search-efficient

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

코드 분석과 탐색 과정에서 불필요한 검색 범위로 토큰을 낭비하거나, 부정확한 매칭으로 오탐을 겪는 문제를 줄여 정확한 “어디서/어떻게/누가 쓰는지”를 더 빨리 찾아주고 정리하게 합니다.

Core Features & Use Cases

  • AST 기반 구문 검색 우선 (ast-grep/sg): 정규식보다 짧고 정확한 구조적 매칭으로 메서드/호출/패턴 사용처를 찾습니다.
  • 도구 선택 결정 트리: Java는 LSP 우선, 구조적 매칭은 sg, 단순 텍스트는 Grep(ripgrep), 파일명/확장자 필터는 fd 등 상황에 맞게 최적 조합을 안내합니다.
  • 토큰 절약 워크플로우: 먼저 카운트/파일 목록으로 규모를 파악하고, 큰 파일은 documentSymbol로 컨텍스트 폭발을 피하며, 필요 시 /tmp에 결과를 저장해 읽기 범위를 통제합니다.
  • 리팩토링까지 확장 (sg --rewrite): 대량 수정을 Edit 도구로 반복하기보다 AST 기반 일괄 변환으로 작업량을 줄입니다.
  • LSP 우선 매핑(특히 Java): goToDefinition/findReferences/goToImplementation/incomingCalls 등 의도에 맞는 LSP 기능을 연결해 잘못된 grep 기반 탐색을 방지합니다.

Quick Start

Efficient Code Search skill을 사용해서 저장소에서 특정 기능의 구현체를 “정확한 정의/구현/사용처”까지 포함해 토큰을 최소화하며 찾아줘.

Frequently Asked Questions about code-search-efficient

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

FAQPage Schema
How do I find exact code definitions and usages in large repositories without wasting tokens?

Efficient code search minimizes token waste by applying a tool selection decision tree, using LSP for Java definitions and usages, ast-grep for structural matching, and ripgrep fallbacks with counts-first narrowing to analyze large repositories accurately.

What is the best way to search for refactoring candidates across multiple languages?

AST-based structural matching with ast-grep identifies refactoring candidates accurately across languages by finding method and call patterns, and can apply batch transformations using the --rewrite flag to reduce manual edit workload.

Does Java code search require a Language Server Protocol setup?

Java code search prioritizes an LSP-first strategy to map goToDefinition, findReferences, and incomingCalls accurately, preventing incorrect grep-based exploration, while providing ripgrep and fd as fallback tools for simpler text queries.

How do I prevent context window explosion when reading large source files?

Prevent context explosion by using token-saving workflows such as checking counts and file lists first, utilizing documentSymbol for partial reads of large files, and saving intermediate search results to /tmp to strictly control read scope.

When should I use ripgrep over ast-grep for code pattern matching?

Use ripgrep for simple text matching and fd for file name or extension filtering, while reserving ast-grep for AST-accurate structural matching where regular expressions would be too short, inaccurate, or produce false positives.