CodeContext

•
23
•

Transforms codebases into structured text for LLMs and AI coding assistants, providing essential context for prompt engineering.

CodeContext is a cross-platform CLI tool and Model Context Protocol (MCP) server designed to bridge the gap between your codebase and large language models (LLMs) like ChatGPT or Claude. It intelligently processes project directories, generating a structured representation of your code while filtering out irrelevant files and optimizing context for a given token budget. This enables developers to feed entire projects to AI coding assistants without manual copy-pasting, facilitating advanced prompt engineering and agentic coding workflows by providing task-specific, relevance-ranked code snippets.

主な機能

01Intelligently filters out binaries, dependencies, and generated code (Git-aware)
02Supports multiple output formats including plain text and JSON
03Generates hierarchical project structure (tree view)
0420 GitHub stars
05Optimizes context with token budgeting and relevance-based file selection
06Provides native integration with agentic coding tools via MCP Server Mode

ユースケース

01Feeding an entire project codebase to LLMs like ChatGPT or Claude for analysis and assistance
02Generating optimized, task-specific code context for agentic coding workflows within token constraints
03Facilitating prompt engineering by providing structured and relevant code snippets to AI assistants