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
Ready to run
npx skills add https://github.com/JoeCP17/LLM-Dot-files --skill code-search-efficient
๐Ÿ’ฌ Prompt for ChatGPT / Claude Chatโ–ผ
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.