Skip to main content

Graph-based project memory for Claude Code — semantic density over transcript volume

Project description

preambulate

Claude forgets everything between sessions. Every morning you re-explain the architecture. Every new team member asks questions the codebase already answered. Every agent you spawn starts blind.

You're not losing code. You're losing reasoning.

Preambulate fixes that.

It's a graph-based memory system for Claude Code. It runs locally, travels with your project, and remembers what you decided and why — not just what the code does, but the reasoning behind it.

Every session starts with a briefing. Not a wall of text — a structured summary of what was touched, what was decided, and what shaped the code you're about to work on. Claude reads it before the first message. You pick up exactly where you left off.

Every decision gets recorded. Not by you — by the hooks. When Claude edits a file, the graph captures it. When you end a session, Claude proposes what mattered and you confirm. The rationale lives in the graph, connected to the code it shaped.

Every agent you spawn inherits the context. Sub-agents don't start blind. They query the graph, find the relevant decisions, understand the constraints. You stop being the explainer and start being the architect.

What you get:

  • Sessions that resume instead of restart
  • Agents that know why the code is the way it is
  • A project memory that compounds over time
  • Sync across machines and teammates via preambulate.dev

What it costs: Nothing to start. Install it, use it locally, see the difference.

pipx install preambulate
preambulate install

Two commands. Your next session starts informed.

On first use, Claude Code will prompt you to approve the hook commands. Approve them — this is a one-time step.

preambulate.dev — sign in with GitHub, get your API key, sync everywhere.

Your agents forget. Preambulate doesn't.


How it works

Hooks

Three hooks fire automatically once preambulate install has run:

Hook Trigger What it does
SessionStart Session opens Creates a session Decision node; prints briefing
PostToolUse (Write/Edit) File saved Records the file as an Artifact; infers import edges
Stop Each response Pushes to remote (no-op if sync not configured)

Graph

The graph is a local Kuzu database stored in memory.db/ at the project root. Node types:

Type Represents
Seed The founding anchor — one per graph
Concept An idea, term, or principle
Artifact A file, symbol, or document
Cluster A community of related artifacts
Decision A recorded choice with rationale
Context A situational frame or active constraint
Observation Something noticed — hardens into Concept over time

Edge types: GOVERNS, DERIVES_FROM, CONSTRAINS, DEFINES, INSTANTIATES, RESONATES_WITH, OPPOSES, SUPERSEDES, ANCHORS.

Every edge carries a rationale — the reason it was drawn.


Commands

Command What it does
preambulate init Initialise a new graph database (memory.db)
preambulate install Write hooks to ~/.claude/settings.json
preambulate capture Record a session-start Decision node (run by hook)
preambulate artifact Record a file edit as Artifact + Decision (run by hook)
preambulate infer Infer DERIVES_FROM edges from Python imports and calls
preambulate cluster Discover artifact clusters via community detection
preambulate decision Record a session-end Decision and write semantic edges
preambulate briefing Print the memory briefing
preambulate sync Push or pull the graph to/from preambulate.dev
preambulate export Dump or restore the full graph to/from JSON
preambulate mcp Start the MCP server (stdio transport)

Session end

Before your final message each session:

preambulate decision \
    --label "What was done" \
    --rationale "Why the key choices were made" \
    --touched "path/to/file.py,other/file.py"

Then propose 1–2 semantic edges if anything earned its place in the graph:

preambulate decision \
    --concept "concept-label|Definition of the concept" \
    --edge "file.py|INSTANTIATES|concept-label" \
    --edge-rationale "file.py is the concrete implementation"

Briefing

preambulate briefing                          # recent activity
preambulate briefing --focal path/to/file.py  # proximity mode

Proximity mode shows the decision history and graph neighborhood around a specific file or concept.


Inference

preambulate infer parses Python source and writes graph edges:

  • Phase 1 — file-level DERIVES_FROM edges from import statements
  • Phase 2 — symbol extraction: functions, classes, methods become Artifact nodes; files GOVERN their symbols
  • Phase 3 — within-file call edges between symbol artifacts
  • Phase 4 — cross-file call edges (requires symbol index built from prior inference)

Clustering

preambulate cluster            # Phase A: file-level communities
preambulate cluster --phase B  # Phase B: symbol-level communities
preambulate cluster --reset    # Recompute, supersede old clusters

Sync

preambulate sync save-key <your-key>  # save API key from preambulate.dev
preambulate sync push                 # push graph to remote
preambulate sync pull                 # pull and merge remote graph

Sign in at preambulate.dev to get your API key. Sync is a no-op without one — the local graph works fully without it.


Security

memory.db/ contains your full project reasoning history. It is excluded from git by default (.gitignore written on preambulate init). Do not commit it or store it in an untrusted location.


Migration

When the schema changes:

preambulate export dump
preambulate export restore --dump graph_export.json --reset

Requirements

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

preambulate-0.1.0.tar.gz (53.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

preambulate-0.1.0-py3-none-any.whl (60.7 kB view details)

Uploaded Python 3

File details

Details for the file preambulate-0.1.0.tar.gz.

File metadata

  • Download URL: preambulate-0.1.0.tar.gz
  • Upload date:
  • Size: 53.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for preambulate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b38a9707702ac5df3e21a72f751f37de9fe517824c58b08bcf1f48c1818561f5
MD5 eade802cbe2177bf86108ed43339d7b3
BLAKE2b-256 bef63dc79840e314f1f7f985140fb48f2380e14448050ec93783c58f9a39e545

See more details on using hashes here.

File details

Details for the file preambulate-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: preambulate-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 60.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for preambulate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d15767c9872c5147c4bda0f27715bfeebf91a60ce19f5672cb0d8cfe0070651
MD5 0c221c92ced62e07552577ab5da3e037
BLAKE2b-256 197fd37d18a8f959164e4754869a39139f4a1a164da13228539ae4cc7fc6db46

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page