Introduction
Lore Protocol is a convention for embedding decision context into git commit messages using standard git trailers. It captures why code decisions were made — constraints, rejected alternatives, confidence levels, forward-looking directives — so that AI agents and future developers never lose context.
The Problem
Section titled “The Problem”Every codebase accumulates decisions:
- Why was this library chosen over alternatives?
- Why was this approach rejected?
- What constraints shaped the current design?
- What should future modifiers be careful about?
These decisions live in Slack threads, closed PRs, meeting notes, and engineers’ heads. When people move on, the context leaves with them. Code review catches the what, but the why decays silently.
AI agents amplify this problem. They operate across sessions with no memory of prior reasoning. Without access to decision context, they:
- Re-explore approaches that were already rejected
- Violate constraints they were never told about
- Overwrite intentional design choices with “improvements”
- Produce working code that breaks architectural invariants
The Solution
Section titled “The Solution”Lore Protocol stores decision context in the one artifact that is already immutable, versioned, and universally available: the git commit message.
Prevent silent session drops during long-running operations
The auth service returns inconsistent status codes on tokenexpiry, so the interceptor catches all 4xx responses andtriggers an inline refresh.
Lore-id: a7f3b2c1Constraint: Auth service does not support token introspectionConstraint: Must not add latency to non-expired-token pathsRejected: Extend token TTL to 24h | security policy violationConfidence: highScope-risk: narrowReversibility: cleanDirective: [until:auth-v3] Error handling is intentionally broad (all 4xx)Tested: Single expired token refresh (unit)Not-tested: Auth service cold-start > 500ms behaviorThe Lore CLI then provides commands to query this context:
# What constraints apply to this file?lore constraints src/auth/interceptor.ts
# What approaches were already rejected?lore rejected src/auth/interceptor.ts
# Why does this specific line exist?lore why src/auth/interceptor.ts:47
# What knowledge might be outdated?lore stale src/auth/Design Principles
Section titled “Design Principles”- Git-native — Uses standard git trailers. No external database, no server, no SaaS.
- Agent-first — JSON stdin/stdout for programmatic use. Human-readable text as the default.
- Append-only lifecycle — Decisions are never mutated. Outdated decisions are retired through
Supersedes:chains. - Survives git operations — Stable
Lore-idreferences survive rebase, cherry-pick, and amend. - Zero adoption cost — Works with any language, any framework, any CI/CD. Just commit messages.
Research
Section titled “Research”Lore Protocol is described in the paper “Lore Protocol: Embedding Decision Context in Git History for AI Agent Consumption” (arXiv:2603.15566, March 2026).
This documentation reflects the Revised Specification v1.0, which resolves 14 design challenges identified after the paper’s publication.
Current Status
Section titled “Current Status”The protocol specification is complete. The CLI tool is under active development. Follow progress on GitHub.