agentledger
Reports your Claude Code, Cursor CLI, Gemini CLI, OpenCode and Cortex Code sessions to the AgentLedger Snowflake Native App, so your team sees agent cost, prompts and tool use per developer, repo, branch and pull request.
uv tool install agentledger-cli # or: pipx install agentledger-cli
agentledger install
install checks that your Snowflake connection can report to the app, then sets up every agent
it finds:
| Agent | What it adds |
|---|---|
| Claude Code | Stop and SessionEnd hooks in ~/.claude/settings.json |
| Cursor CLI | stop and sessionEnd hooks in ~/.cursor/hooks.json |
| Gemini CLI | AfterAgent and SessionEnd hooks in ~/.gemini/settings.json ($GEMINI_CLI_HOME moves it); Gemini CLI runs hooks in trusted folders |
| Cortex Code | the app's git plugin (cortex plugin install <APP>.PLUGINS.AGENTLEDGER); Snowflake records its sessions already |
After each turn the hook queues the session and returns at once. A background process loads it
into the app over your own connection, at most every two minutes per agent, so a session is
always stored as yours. Logs are in ~/.cache/agentledger/.
OpenCode has no hook yet, so its sessions are uploaded by hand: agentledger upload opencode
reports the latest one, or name sessions by id (opencode session list shows them). They're read
from OpenCode 2's database, ~/.local/share/opencode/opencode.db ($XDG_DATA_HOME moves it).
Requirements
- A Snowflake connection in
~/.snowflake/connections.tomlthat works without a prompt (key pair or cached SSO), whose role an admin has granted the reporter role:GRANT APPLICATION ROLE AGENTLEDGER.APP_REPORTER TO ROLE <role>; - Python 3.10 or later.
Options
agentledger install --connection work --role DEVELOPER # pick the connection and role
agentledger install --only ~/work # report only sessions in these folders
agentledger install --app AGENTLEDGER_PROD # the app's name, if it isn't AGENTLEDGER
agentledger status # what's set up, and each agent's latest report
agentledger upload claude ~/.claude/projects/*/*.jsonl # report earlier sessions
agentledger upload gemini ~/.gemini/tmp/*/chats/*.jsonl
agentledger upload opencode ses_1a2b3c ses_4d5e6f # OpenCode sessions, by id
agentledger uninstall # remove the hooks and the plugin
Settings live in ~/.snowflake/agentledger.json, which the Cortex Code plugin reads too.
Metadata
Release files for agentledger-cli 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agentledger_cli-0.2.0.tar.gz | 26.7 kB | With provenance | Details for agentledger_cli-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentledger_cli-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for agentledger_cli-0.2.0-py3-none-any.whl |
Total release size: 64.0 kB
Release files / agentledger_cli-0.2.0.tar.gz
| Download URL | agentledger_cli-0.2.0.tar.gz |
|---|---|
| Size | 26.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c47709512daebbe0a5ce0a8ddf1889d032ad1762eee87b29f0fbe26b13414768
|
|
BLAKE2b-256 checksum How to use checksums |
ee447a07a8065e3373078683af7fd3834bf90e2b81cd50f0dbc2a2160e5f7242
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logRelease files / agentledger_cli-0.2.0-py3-none-any.whl
| Download URL | agentledger_cli-0.2.0-py3-none-any.whl |
|---|---|
| Size | 37.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8bf983337bb12c8f6a29c853c83e9ddb1e117d1ef70c941993172c0929eda3fd
|
|
BLAKE2b-256 checksum How to use checksums |
4f41cce1d9a72de367ac7d06b67284c8ec71424be6c9919ede38fd433a09b8b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logSecurity for agentledger-cli 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for agentledger_cli-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.