컨텍스트 컴파일러: Claude Code를 위한 그래프 기반 코드 검색

hackernews | | 🔧 개발도구
#claude #프레임워크
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

'Context-compiler'는 코드베이스를 의존성 그래프로 색인하여 특정 작업에 필요한 최소 컨텍스트를 찾아주는 MCP 서버입니다. 클라우드나 인터넷 연결 없이 순수 파이썬으로 가볍게 설치되며, 사용자의 소스 코드가 로컬을 벗어나지 않아 보안이 강력합니다. 여러 저장소를 개별적으로 색인하고 그래프를 쿼리하여 전체 저장소에서 최적의 매칭 심볼을 반환하는 기능을 제공합니다.

본문

An MCP server that indexes your codebase into a dependency graph and returns the smallest correct context for any coding task: exact line ranges per symbol, with a rationale for each one. Runs entirely on your machine. No cloud, no LLM API calls, no embeddings server, no internet connection required. Your source code and task descriptions never leave your laptop. The base install is lightweight: pure Python, no GPU, no heavy ML framework. pip install claude-context-compiler cd /your/project context-compiler init init indexes your codebase, registers the MCP server with Claude Code, and adds instructions to CLAUDE.md . Open Claude Code and it will call get_context automatically before reading files. Requires Python 3.11+. context-compiler init --dependencies ../repo1,../repo2 Each repo is indexed separately. get_context queries all graphs and returns the best-matching symbols across all repos. The dependency list is saved and picked up automatically on next start. context-compiler index # re-index after large changes context-compiler explain --task "" # preview what context a task returns pip install "claude-context-compiler[semantic]" Enables embedding-based fallback for cases where task terms don't appear in symbol names (e.g. "fix login flow" finds authenticate_user ). Downloads a 23MB ONNX model once, no PyTorch required. Every step runs locally with no external calls: - Classify the task: BUG_FIX ,NEW_FEATURE , orREFACTOR (keyword scoring, no LLM) - Find entry nodes via BM25 over symbol names, file paths, and docstrings - Traverse the dependency graph with a strategy tuned per task type - Score candidates, enforce a token budget, return slices with rationale The graph is stored in an embedded KuzuDB database in your project folder. No server process, no port, no auth. Same repo + same task = same output, every time. { "slices": [ { "file_path": "/abs/path/payments/processor.py", "line_start": 6, "line_end": 24, "rationale": "Included PaymentProcessor as primary task location (matched 'payment')" }, { "file_path": "/abs/path/payments/retry_handler.py", "line_start": 12, "line_end": 38, "rationale": "Included RetryHandler because it is called by PaymentProcessor (depth 1)" } ] } Each slice points to the specific function or class that's relevant. A 500-line file with one relevant function costs ~40 tokens, not 500. | Language | Parsing | |---|---| | Python | tree-sitter-python | | TypeScript / TSX | tree-sitter-typescript | | JavaScript / JSX | tree-sitter-javascript | Apache 2.0

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →