Python SDK for grounded context compression and LLM routing in coding workflows.
Project description
Chronicle
Local-first ContextOps for AI coding agents.
Chronicle prepares grounded repo context before agents code, reviews changes after they code, and creates replayable handoffs for humans or the next agent.
Alpha release: Chronicle is currently strongest on Python
.pyrepositories.
Quickstart
pip install chronicle-sdk
chronicle setup codex
chronicle run "Fix auth token refresh bug"
# paste the saved agent_prompt.md into Codex, Claude, or Cursor
chronicle finish
Chronicle saves artifacts under chronicle_logs/runs/<run_id>/:
prepare.md
context_packet.md
agent_prompt.md
diff.patch
review.md
pr-review.md
report.md
prepare.json
run.json
Use agent_prompt.md as the ready-to-paste prompt for Codex, Claude, Cursor, or another coding agent.
Agent Setup
chronicle setup codex
chronicle setup claude
chronicle setup cursor
chronicle setup all
chronicle setup codex --no-mcp
chronicle setup codex --mcp-only
Setup adds Chronicle workflow instructions and attempts MCP registration:
- Codex: appends
AGENTS.mdand runscodex mcp add chronicle -- chronicle-mcp --repo <repo>whencodexis installed. - Claude: appends
CLAUDE.mdand runsclaude mcp add chronicle -- chronicle-mcp --repo <repo>whenclaudeis installed. - Cursor: writes
.cursor/rules/chronicle.mdcand project.cursor/mcp.json.
If Codex or Claude is not installed, setup still updates the workflow file and prints the manual MCP command. Use --no-mcp for instruction files only, or --mcp-only to skip instruction files and only configure MCP.
Two-Step Run Loop
chronicle run "Fix auth token refresh bug"
# agent edits code
chronicle finish --base main
runprepares the smallest useful context, writescontext_packet.md, and createsagent_prompt.md.finishcapturesdiff.patch, runs review and PR review logic, and writesreport.md.finishprints the report path; usechronicle report --latestlater to print or regenerate it.replayshows the run timeline and saved artifacts.
If you run Chronicle from inside Codex, the same CLI flow works. chronicle setup codex also tries to register Chronicle MCP so Codex can call Chronicle tools directly, but the two-step CLI flow stays the simplest path.
The lower-level commands still exist when you want each step separately:
chronicle prepare "Fix auth token refresh bug"
chronicle review
chronicle handoff --tests "pytest passed"
Local PR Review
chronicle pr-review --base main
chronicle pr-review --base main --format markdown
chronicle pr-review --base main --output pr-review.md
pr-review stays local. It uses git diff against the base ref, summarizes changed files and impacted symbols, suggests related tests, and writes a markdown review artifact.
Common Commands
chronicle status
chronicle replay --latest
chronicle explain --latest
chronicle inspect --file src/auth/service.py
chronicle inspect --symbol AuthService.refresh_token
chronicle index
Use --repo /path/to/repo from outside the target repository. Use --view full when you need machine-readable JSON.
SDK
from chronicle import Chronicle
chronicle = Chronicle(repo_path="./repo")
prepared = chronicle.prepare("Fix auth token refresh bug")
review = chronicle.review()
handoff = chronicle.handoff(tests="pytest passed")
print(prepared["saved"]["prepare_md"])
print(review["saved"]["review_md"])
print(handoff["saved"]["handoff_md"])
MCP
Start a Chronicle MCP server for one repo:
chronicle-mcp --repo /path/to/repo
Codex CLI setup:
codex mcp add chronicle -- chronicle-mcp --repo /path/to/repo
Claude Desktop config example:
{
"mcpServers": {
"chronicle": {
"command": "chronicle-mcp",
"args": ["--repo", "/path/to/repo"]
}
}
}
Capabilities
- Python AST indexing for functions, classes, and methods.
- Symbol graph and import dependency graph construction.
- Deterministic query planning, context ranking, and provenance.
- Token-budget-aware context compression.
- Patch-aware review context for edited symbols, related files, and tests.
- Local markdown artifacts for context, review, handoff, and PR review.
- SQLite-backed snapshot persistence and session memory.
- MCP tools for agent workflows.
Notes
- Chronicle is local-first and does not send repository code anywhere by default.
- Index artifacts are stored in
chronicle_logs/index.sqlite3unless--index-diris provided. - Remote repos cloned via
--repo-urlare stored inchronicle_logs/repos/by default. - Non-Python language support is still partial.
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 chronicle_sdk-0.1.4.tar.gz.
File metadata
- Download URL: chronicle_sdk-0.1.4.tar.gz
- Upload date:
- Size: 105.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
235626da0257e72c2d760ff4566ee4aa82ff9fc267a4606fc97ebb23185eb01f
|
|
| MD5 |
90d59203612975c53a7ebc30605f8a43
|
|
| BLAKE2b-256 |
5fe7333560210090e3d4c8f5e1373a954f430440022878533ac0379a4fca3225
|
Provenance
The following attestation bundles were made for chronicle_sdk-0.1.4.tar.gz:
Publisher:
publish.yml on animeshdutta888/chronicle
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chronicle_sdk-0.1.4.tar.gz -
Subject digest:
235626da0257e72c2d760ff4566ee4aa82ff9fc267a4606fc97ebb23185eb01f - Sigstore transparency entry: 1654902272
- Sigstore integration time:
-
Permalink:
animeshdutta888/chronicle@5ef68ff8d0d2611d34bcc052d096faf2cd1b7e86 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/animeshdutta888
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5ef68ff8d0d2611d34bcc052d096faf2cd1b7e86 -
Trigger Event:
release
-
Statement type:
File details
Details for the file chronicle_sdk-0.1.4-py3-none-any.whl.
File metadata
- Download URL: chronicle_sdk-0.1.4-py3-none-any.whl
- Upload date:
- Size: 110.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edd2cb42009e935317d3f593327ff9250efc699906a3dc7beda28a4d11215183
|
|
| MD5 |
e005cf3d8930891ef2cc90baea0c95f5
|
|
| BLAKE2b-256 |
7fb16483aa986bc8c974db0315ede6c7279f8b19072a2fc2dae263e73560dce8
|
Provenance
The following attestation bundles were made for chronicle_sdk-0.1.4-py3-none-any.whl:
Publisher:
publish.yml on animeshdutta888/chronicle
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chronicle_sdk-0.1.4-py3-none-any.whl -
Subject digest:
edd2cb42009e935317d3f593327ff9250efc699906a3dc7beda28a4d11215183 - Sigstore transparency entry: 1654902505
- Sigstore integration time:
-
Permalink:
animeshdutta888/chronicle@5ef68ff8d0d2611d34bcc052d096faf2cd1b7e86 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/animeshdutta888
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5ef68ff8d0d2611d34bcc052d096faf2cd1b7e86 -
Trigger Event:
release
-
Statement type: