Bundles code you pick
The whole project, chosen files and folders, or the local files they import (Python, JS/TS), as one block with the file tree.
Your project, a few files, what changed, or the command that failed. One block you can paste into any chat.
$ uv tool install codigestCodigest does not call any AI model; it only prepares what you send to one. Everything runs on your machine.
The examples below are real output from a small project: prices.py with a failing test in test_prices.py. The project grows between examples: prices.py gains a Cart class and a legacy/ folder with a MATLAB file appears.
$ cdg scan -s<project_snapshot project="project">
<project_structure>
├── .gitignore
├── prices.py
└── test_prices.py
</project_structure>
<source_code>
<file path=".gitignore">
.venv/
__pycache__/
.pytest_cache/
</file>
<file path="prices.py">
def apply_discount(price, percent):
return price * (1 - percent)
</file>
<file path="test_prices.py">
from prices import apply_discount
def test_ten_percent():
assert apply_discount(200, 10) == 180
</file>
</source_code>
</project_snapshot>In a terminal the result goes to the clipboard. -s also prints it.
digest lists every function, class and top-level variable with the line it starts on and the first line of its docstring, and leaves the bodies out.
$ cdg digest -s<code_digest project="project" contents="signatures and docstrings, no bodies">
<project_structure>
├── .gitignore
├── legacy
│ └── discount.m
├── prices.py
└── test_prices.py
</project_structure>
<file path="legacy/discount.m">
1: function p = discount(price, percent)
Price after taking off percent percent.
5: %% Apply
</file>
<file path="prices.py">
1: TAX_RATE = 0.1
4: def apply_discount(price: float, percent: float) -> float
Price after taking off `percent` percent.
9: class Cart
Items and the discount that applies to all of them.
12: def __init__(self, percent: float=0)
16: def total(self) -> float
Sum after discount and tax.
</file>
<file path="test_prices.py">
4: def test_ten_percent()
</file>
</code_digest>$ cdg cap -- pytest -q
F [100%]
================================== FAILURES ===================================
______________________________ test_ten_percent _______________________________
def test_ten_percent():
> assert apply_discount(200, 10) == 180
E assert -1800 == 180
E + where -1800 = apply_discount(200, 10)
test_prices.py:5: AssertionError
=========================== short test summary info ===========================
FAILED test_prices.py::test_ten_percent - assert -1800 == 180
1 failed in 0.04s
$ cdg pack
Packed ~689 / 30,000 tokens
failed pytest -q (exit 1, just now)
changes uncommitted changes (git)
+ test_prices.py line 5 in failing output
+ prices.py called from failing test test_prices.py
+ legacy/discount.m changedThe pack holds the failing command with its output, your uncommitted Git changes, test_prices.py because the error points at its line 5, prices.py because the test calls it, and legacy/discount.m because you edited it. Output Formats shows the whole block.