Logbook
Commit-anchored shared memory for AI-assisted repos. It records why code and warehouse models changed
(what was wrong, how wrong, the fix) next to the git history, so a teammate or an AI agent can pick up where the
last person left off. Works for any repo; dbt-style repos get layer awareness (stg_, int_, fct_, dim_).
- Python 3.10+, standard library only, git 2.31+. Windows, macOS, Linux. No server to host, no model calls (
backend none). - Two logs: a private one under
.git/logbook/(never tracked), and a shared one on git refs (refs/logbook/log/<user>/<device>, one writer per ref, so no merge conflicts). Sharing is opt-in per entry. - A live local viewer (
logbook serve) shows the shared tree with your private entries overlaid.
Status: alpha (0.0.1). The engine, git-ref storage, sharing and the viewer work and are tested on Linux, macOS and Windows.
Not built yet: nothing prompts an agent to write a note, so real reasons exist only when someone runs logbook note;
notes written on a branch before its first commit are not followed through a merge; there are no summaries above commits;
setup is three separate commands; Claude Code is the only host. Entries marked inferred are copied from the commit message
or a truncated transcript. They carry no reason and are never injected into an agent's prompt.
Try it (no credentials, about 30 seconds)
pip install getlogbook # from a clone: pip install . (or: PYTHONPATH=src python -m getlogbook ...)
# the command is `logbook`; the package name is getlogbook because `logbook` on PyPI is taken
logbook demo # Alice, Bob and a hostile Mallory on a scratch repo; every claim is checked
logbook demo --serve # same, then open the viewer on Bob's clone
Daily use
logbook init # once per clone (git config user.email must be set)
logbook install-hook # git floor: copies each of your commits into an `inferred` entry (no reason)
logbook install --agent claude-code --write # merges hooks into .claude/settings.local.json (dry run without --write)
logbook note --kind finding --topic "late payments" --summary "revenue dip" --why "export stalled" --wrong "1 day under"
logbook note --kind change --before-commit --summary "..." --why "..." --wrong "..." --fix "..." # then commit as usual
logbook publish <id> # preview + redaction, you confirm; evidence is opt-in
logbook sync # fetch teammates' entries, push yours
logbook query "refunds" | explain fct_revenue | path <rev> <rev> # exit 0 found, 3 ambiguous, 4 no match
logbook serve --open
logbook doctor # setup + what is NOT captured
New teammate: clone, then logbook join. A plain git clone/git fetch does not download logbook refs.
CI: git fetch --depth=1 origin '+refs/logbook/log/*:refs/logbook-remote/origin/log/*' (opt in; off by default).
How an agent consults it first
Hooks (Claude Code is the only adapter shipped): SessionStart and UserPromptSubmit inject a digest of at most ~1,500
characters, only when the prompt names a known model or path, only from people who have commits on this history (or whom you
ran logbook trust on), only entries that say why or
how wrong, finding first, each labelled with author, provenance, age, commits behind HEAD and "verify first". Each note
is shown once per session. Agents without hooks: logbook snippet prints text for CLAUDE.md / AGENTS.md. Injection
guarantees the notes are in context, not that the model uses them.
Safety defaults
- Entries from other writers are untrusted data: author comes from the ref path, never from the file; text is
sanitised (links, code fences, instruction-like lines, angle brackets removed) before it reaches an agent, in
injectand in CLI output; the viewer renders only withtextContentunder a strict CSP. - Every entry is recorded, searchable and visible in the viewer. Trust only decides what is automatically injected into an
agent's prompt: your own entries, entries from anyone with a commit on this history (no setup), and writers you ran
logbook trust <user-id>on. A writer with push access who never committed is searchable but not injected. Strict mode:"inject_from": "self"in.logbook/policy.json, ortrust_committers: falsein your config. Limit: the id in a ref path is self-asserted, so anyone who can push refs could write under a committer's id; only host-side ref protection prevents that. - Publishing: allowlisted fields only, secrets/emails/connection strings masked, pasted table rows refused, exact-bytes preview with hash check, a local audit log. Redaction is a lint, not a guarantee. Published text can persist in forks and mirrors.
logbook purge <id> --pushrewrites your own ref without the entry and leaves an id-only tombstone. Rotate any leaked secret.- Optional
.logbook/policy.json(tracked):publish,inject_from(self|trusted),attribution(none|pseudonym|namedceiling),max_entry_bytes. The client only ever gets stricter from it. Default attribution is a pseudonymous id.
See docs/DESIGN.md for decisions, the failure-mode table, and what is not built.
Metadata
Release files for getlogbook 0.0.1
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 |
|---|---|---|---|---|
| getlogbook-0.0.1.tar.gz | 57.7 kB | With provenance | Details for getlogbook-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| getlogbook-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for getlogbook-0.0.1-py3-none-any.whl |
Total release size: 113.4 kB
Release files / getlogbook-0.0.1.tar.gz
| Download URL | getlogbook-0.0.1.tar.gz |
|---|---|
| Size | 57.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
06c6e66d0c3caf4c645b2588f95241f640f90843b9bdbb2c08954e64d1d00e95
|
|
BLAKE2b-256 checksum How to use checksums |
0da97f64f3e5e2b534593d07a19f51b2d2c6a0bc67c2d33dc5cdee3ae02e8a3a
|
| 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 Nov 2, 2026.
Transparency logRelease files / getlogbook-0.0.1-py3-none-any.whl
| Download URL | getlogbook-0.0.1-py3-none-any.whl |
|---|---|
| Size | 55.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5d3f4e4cd54b821f0d72db1249b86eaa82cfb6eaeaa2c4326e6ebad534612f1b
|
|
BLAKE2b-256 checksum How to use checksums |
3c547fcc6093b43a850f7f7ed3bf255332779ce92a5f61fd3c835bfa0461ad18
|
| 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 Nov 2, 2026.
Transparency logSecurity for getlogbook 0.0.1
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 getlogbook-0.0.1.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 Nov 2, 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.