Skip to main content

Extracts structured, token-efficient context bundles from Python codebases for AI coding agents.

Project description

agent-code-context

agent-code-context is a Python library and CLI tool that extracts structured, token-efficient context bundles from Python codebases. By analyzing the Abstract Syntax Tree (AST), it generates symbol indexes, dependency graphs, and dead code reports. This allows AI coding agents to understand the architecture and relationships of a codebase without consuming unnecessary tokens on full file contents.

Problem Statement

AI coding agents (like those built with LangChain, AutoGen, or custom LLM wrappers) often struggle with large codebases because passing entire files or directories quickly exceeds context window limits. Developers currently lack a lightweight, standalone tool to extract just the "skeleton" of a codebase—what exists, where it lives, and how it connects. agent-code-context solves this by providing a token-efficient summary of the code structure, enabling agents to make informed decisions about which specific files to read next.

Features

  • Symbol Indexing: Extracts classes, functions, and their signatures (arguments and type hints) across the project.
  • Dependency Graphing: Maps internal import relationships to show which modules depend on which.
  • Dead Code Detection: Heuristically identifies public functions and classes that are never imported or called within the project.
  • Token-Efficient Output: Formats output as compact JSON or structured Markdown optimized for LLM context windows.
  • CLI Interface: Allows easy integration into shell-based agent workflows.

Installation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_code_context-0.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_code_context-0.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file agent_code_context-0.1.0.tar.gz.

File metadata

  • Download URL: agent_code_context-0.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.14 Darwin/24.6.0

File hashes

Hashes for agent_code_context-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f986cc987e695e23bf6485b4ec26e5cd61210c172275fd6eaf86be14d0152fbd
MD5 bdbd8885a86445d4d8f261790abdba6c
BLAKE2b-256 0f9668685ef3753bf3f5cb2fb9365eae22b426a1ffb3086edba244e90e58f96a

See more details on using hashes here.

File details

Details for the file agent_code_context-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agent_code_context-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.14 Darwin/24.6.0

File hashes

Hashes for agent_code_context-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1bcd147c137a63c72fc1d978f3df6890dd12b6384a6b229e1d459c92188a43e5
MD5 c9f8e4fce0ee87839fddffdcda38f736
BLAKE2b-256 8ae7dee4902a0c4e072a7ac7b3e1e2c5b2aecae2b7e3d4fc6c64bd43dc329e79

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page