Skip to main content

Human-Centered Codebase Context Manager for LLMs

Project description

Codigest

Codigest is a standalone CLI tool designed to extract, structure, and track the context of your codebase for Large Language Models (LLMs).

Unlike simple copy-paste tools, Codigest employs a Context Anchor system (Shadow Git) to track changes locally without polluting your main version control history. It also features Semantic Analysis to detect structural changes in your code.

Core Philosophy

  • Read-Only & Safe: Codigest never modifies your source code. It only reads, analyzes, and formats context.
  • Context-Aware: Instead of dumping raw text, it structures code into XML snapshots designed for LLM comprehension.
  • Session-Based Tracking: It maintains an internal anchor to track "work-in-progress" changes independently of your Git commits.
  • Environment Isolated: Runs in its own isolated Python 3.14 environment via uv, ensuring it never conflicts with your project's dependencies.

Installation

Codigest runs as a global tool. You don't need to add it to your project's requirements.txt. We strongly recommend using uv for the best experience.

Step 1: Install uv

If you don't have uv installed, use Winget (Windows) or curl (macOS/Linux).

# Windows (via Winget)
winget install --id astral-sh.uv

# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

Step 2: Install codigest

Install Codigest globally. uv will automatically manage the required Python 3.14 environment for you.

uv tool install codigest

Step 3: Update Path (Important!)

To run codigest from any terminal, ensure your tools directory is in your PATH.

uv tool update-shell

> Note: Restart your terminal (or VS Code) after this step to apply changes.


Workflow & Commands

Once installed, you can use codigest command anywhere.

1. Initialization

Sets up the .codigest directory and captures the initial baseline anchor.

codigest init

2. Full Context Snapshot (scan)

Scans the entire codebase and generates a structured XML snapshot.

  • Output: .codigest/snapshot.xml
  • Use Case: Providing the LLM with the full project context at the start of a session.
  • Side Effect: Updates the internal Context Anchor to the current state.
codigest scan --message "Initial project context"

3. Incremental Changes (diff)

Tracks text-based changes between the last scan and the current working tree.

  • Output: .codigest/changes.diff
  • Use Case: "I modified 3 files. Here is exactly what changed since the last snapshot."
  • Note: This is based on the internal Shadow Git, not your project's Git history.
codigest diff

4. Semantic Analysis (semdiff)

Analyzes structural changes (AST-based) rather than line-by-line text differences.

  • Output: .codigest/semdiff.xml
  • Use Case: "I refactored the API. Show me which functions were added, removed, or had their signatures changed."
  • Benefit: Significantly reduces token usage compared to raw diffs by ignoring formatting/comment changes.
codigest semdiff

5. Architecture Digest (digest)

Generates a high-level outline of the project structure (Classes, Functions, Methods only).

  • Output: .codigest/digest.xml
  • Use Case: "Don't read the implementation details. Just understand the class hierarchy and available methods."
codigest digest

Configuration

You can customize behavior in .codigest/config.toml.

[filter]
# Target extensions
extensions = [".py", ".ts", ".rs", ".md", ".json"]

# Exclude patterns (Gitignore syntax)
exclude_patterns = [
    "*.lock",
    "tests/data/",
    "legacy_code/"
]

[output]
format = "xml"

Architecture Details

Context Anchor (Shadow Git) Codigest maintains a hidden, lightweight Git repository inside .codigest/anchor.

  • When you run scan, the current state is committed to this anchor.
  • When you run diff, the tool compares your working directory against this anchor.
  • When you run semdiff, the tool parses the AST of the anchor version and the current version to detect logical drifts.

Safety Mechanisms

  • structure-aware dedent: Ensures XML tags are perfectly aligned regardless of code indentation.
  • Automatic Exclusion: Self-referential files (.codigest/) are automatically ignored to prevent recursion loops.

License

MIT License

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

codigest-0.3.1.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

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

codigest-0.3.1-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file codigest-0.3.1.tar.gz.

File metadata

  • Download URL: codigest-0.3.1.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for codigest-0.3.1.tar.gz
Algorithm Hash digest
SHA256 44f0e18a7e1a64dc40842420fdb4603e164045b1b8eb96bea4ef736aff3c457a
MD5 bbfe8d2ddb1e7b2350baa798b14cdca1
BLAKE2b-256 a78c0cf42ba6e4339b6c32c292e82baab56df99cd05c31391c07520956b73929

See more details on using hashes here.

Provenance

The following attestation bundles were made for codigest-0.3.1.tar.gz:

Publisher: publish.yml on SJB7777/codigest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codigest-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: codigest-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 26.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for codigest-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6237f0c4e19152089d5b36532ac24faa9851362f70ae4e0db01b556f5d5edb20
MD5 bdbbb06ba2baeb28720a0d60156372dd
BLAKE2b-256 9be3e8fa593bc38f9f91efbdfa76ed80a3263555f1ed007d43ca790d1c947faf

See more details on using hashes here.

Provenance

The following attestation bundles were made for codigest-0.3.1-py3-none-any.whl:

Publisher: publish.yml on SJB7777/codigest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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