Human-Centered Codebase Context Manager for LLMs
Project description
Codigest
Codigest is a 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.
- Python 3.14 Native: Built using modern Python features including PEP 750 Tag Strings for safe XML generation.
Installation
Requires Python 3.14+.
# Install via uv
git clone https://github.com/SJB7777/codigest.git
cd codigest
uv tool install .
Workflow & Commands
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 --m " Python 3.14 project. Do NOT use typing. List/Dict."
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codigest-0.3.0.tar.gz.
File metadata
- Download URL: codigest-0.3.0.tar.gz
- Upload date:
- Size: 24.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a185ef07f6aa804a25bd40787ed50d334dd9c362f75c0bc239060be46e8756ac
|
|
| MD5 |
8b6c2367c4c11590698cd28764de1c99
|
|
| BLAKE2b-256 |
183d8aeb63690405224c533f61017667dc0eeb22c6bca003178ff1a7ce6306ac
|
Provenance
The following attestation bundles were made for codigest-0.3.0.tar.gz:
Publisher:
publish.yml on SJB7777/codigest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codigest-0.3.0.tar.gz -
Subject digest:
a185ef07f6aa804a25bd40787ed50d334dd9c362f75c0bc239060be46e8756ac - Sigstore transparency entry: 755332834
- Sigstore integration time:
-
Permalink:
SJB7777/codigest@70e1afe53fbe6f884ce4d54e16cd90b67351a0a0 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/SJB7777
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@70e1afe53fbe6f884ce4d54e16cd90b67351a0a0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file codigest-0.3.0-py3-none-any.whl.
File metadata
- Download URL: codigest-0.3.0-py3-none-any.whl
- Upload date:
- Size: 25.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5fedd24ef413b5e19fb0f21d815ef581842b5b5eae849b7a0d149332958e495
|
|
| MD5 |
7de0363f0e8019f3b64da9eb09ce06c4
|
|
| BLAKE2b-256 |
33da99ec1bae2efc8e57b4252ae0d9120f9e0d57dde75bafb7d55b4378a89728
|
Provenance
The following attestation bundles were made for codigest-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on SJB7777/codigest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codigest-0.3.0-py3-none-any.whl -
Subject digest:
b5fedd24ef413b5e19fb0f21d815ef581842b5b5eae849b7a0d149332958e495 - Sigstore transparency entry: 755332887
- Sigstore integration time:
-
Permalink:
SJB7777/codigest@70e1afe53fbe6f884ce4d54e16cd90b67351a0a0 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/SJB7777
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@70e1afe53fbe6f884ce4d54e16cd90b67351a0a0 -
Trigger Event:
push
-
Statement type: