Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"name": "lore",
"source": "./",
"description": "Shared memory for Claude Code, Codex, and DOXA: capped curated facts, evidence-backed beliefs, FTS5 session search, staged review, learned skills, and signed sync.",
"version": "0.62.28"
"version": "0.62.29"
}
]
}
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lore",
"description": "Memory for Claude Code that reasons about you and improves itself: Honcho-pattern belief store with deriver, dreamer and dialectic (/lore:ask), automatic skillification with a closed judge/update/retire loop, on a Hermes-pattern core \u2014 hard-capped curated memory, FTS5 session search, staged review.",
"version": "0.62.28",
"version": "0.62.29",
"author": {
"name": "Fabian Wilde",
"email": "docwilde@proton.me"
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.62.29 — 2026-11-12

**Codex graph hooks**

- Bundle a native Codex `UserPromptSubmit` hook and include graph context in
Codex startup snapshots when `LORE_GRAPH_CONTEXT=1`. The prompt hook retrieves
graph context from the first prompt without scheduling review or indexing.
- Keep startup memory available when graph retrieval fails, honor injection
and belief disable switches, and retain graph budgets and citation labels.
- Use the declared hook engine for startup memory-refresh instructions.
- Run the startup hook on fork. Review the updated hooks in Codex with `/hooks`
and install the matching native carrier with `./task install` after updating
the plugin.

## 0.62.28 — 2026-11-12

**README reference**
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ This WSL 2 setup has not been verified in LORE CI; see the
### Codex

LORE supports Codex through the portable [`plugin.json`](plugin.json) and
its [SessionStart hook](codex/hooks/hooks.json). Enable the full plugin, then
review and trust its hook with `/hooks` in Codex. Once trusted, the hook injects
the shared user and current project snapshot at startup, resume, clear, and
compaction. Codex requires a new review when a hook changes; see its
its [startup and prompt hooks](codex/hooks/hooks.json). Enable the full plugin,
then review and trust its hooks with `/hooks` in Codex. Once trusted, the startup
hook injects the shared user and current project snapshot at startup, resume,
clear, compaction, and fork. Codex requires a new review when a hook changes; see its
[hook trust documentation](https://learn.chatgpt.com/docs/hooks#review-and-trust-hooks).
Claude Code, Codex, and DOXA read the same store; set `LORE_ROOT` when using a
store other than `~/.claude/lore`.
Expand All @@ -110,16 +110,17 @@ The [Codex skill](codex/skills/lore/SKILL.md) supports explicit recall and
memory writes. Index local Codex, Claude Code, and DOXA transcripts with
`lore index`, search them with `lore search "terms" --all`, and read a match
with `lore session <id>`. Indexing and search stay local and use SQLite FTS5.
The Codex startup hook does not index transcripts or run the Claude reviewer.
The Codex injection hooks read context without indexing transcripts or
scheduling review.

Interactive Codex sessions can apply CLI memory writes directly. Calls
classified as hooks or detached/model writers stage proposals; inspect them
with `lore pending` and resolve the exact reviewed
proposal in the native terminal or DOXA. The MCP tool `lore_remember` always
stages a proposal. A proposal or search result is not an approved fact.

The plugin declares its startup hook and skills. Register the native MCP server
separately to give Codex tools for curated memory, beliefs and evidence,
The plugin declares its startup and prompt hooks and skills. Register the native
MCP server separately to give Codex tools for curated memory, beliefs and evidence,
graph traversal, session search, and staged memory proposals. From this checkout:

```sh
Expand Down Expand Up @@ -161,8 +162,10 @@ An absent entry reports `match_not_found`; multiple matches report
Graph context is experimental and off by default. Enable it in the shared
settings with `lore config set LORE_GRAPH_CONTEXT 1`. Its defaults are a
1,200-character budget (`LORE_GRAPH_CONTEXT_CAP`) and one relation hop
(`LORE_GRAPH_CONTEXT_HOPS`). The Claude prompt hook injects the bounded block;
automatic graph context in Codex requires a separate `UserPromptSubmit` hook.
(`LORE_GRAPH_CONTEXT_HOPS`). The Claude prompt hook and bundled Codex startup
and `UserPromptSubmit` hooks inject the bounded block. Codex retrieves graph
context on the first prompt and subsequent prompts; retrieval failures leave
startup memory available and omit the graph block.
With graph context enabled, `lore graph context --prompt "topic terms"` reads
the block explicitly. `lore graph stats`, `lore graph neighbours <id>`, and the
MCP tool `lore_belief_neighbours` support on-demand inspection and traversal.
Expand Down
15 changes: 14 additions & 1 deletion codex/hooks/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"hooks": {
"SessionStart": [
{
"matcher": "startup|resume|clear|compact",
"matcher": "startup|resume|clear|compact|fork",
"hooks": [
{
"type": "command",
Expand All @@ -13,6 +13,19 @@
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "\"${PLUGIN_ROOT}/bin/lore\" hook --engine codex --event prompt",
"timeout": 10,
"statusMessage": "Loading LORE graph context",
"additionalContextLimit": 4000
}
]
}
]
}
}
8 changes: 8 additions & 0 deletions docs/native-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ CLI, MCP server, review, setup and administrative workflows use the same Rust
core. DOXA links the library and uses the native carrier for detached work.
Python modules remain development compatibility references.

The bundled Codex hooks inject curated memory at session startup and, with
`LORE_GRAPH_CONTEXT=1`, append bounded graph context at startup and on each
prompt. The Codex prompt adapter performs context retrieval without scheduling
review, indexing transcripts, or recording memory-refresh stamps. Graph errors
omit the graph block; startup still supplies its curated snapshot. Injection
honors `LORE_SKIP` and `LORE_DISABLE_INJECT`; `LORE_DISABLE_BELIEFS` also
suppresses graph context.

## Bounds and failure semantics

- JSONL frames and provider stdout are limited to 1 MiB; agent frames and
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
"name": "lore",
"version": "0.62.28",
"version": "0.62.29",
"description": "Unified user, repo, and session memory for Claude Code, Codex, and DOXA",
"author": {
"name": "Dr. Fabian Wilde",
Expand Down
2 changes: 1 addition & 1 deletion rust/lore-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lore-core"
version = "0.62.28"
version = "0.62.29"
edition = "2021"
license = "AGPL-3.0-only"
description = "Native LORE memory, beliefs, review and session index"
Expand Down
7 changes: 5 additions & 2 deletions rust/lore-core/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,16 +266,19 @@ pub fn build_context(
crate::scrub::scrub(&text)
}
pub fn snapshot(cfg: &Config, req: &Value) -> Result<Value> {
let engine = std::env::var("LORE_ENGINE").unwrap_or_default();
snapshot_for_engine(cfg, req, &engine)
}
pub(crate) fn snapshot_for_engine(cfg: &Config, req: &Value, engine: &str) -> Result<Value> {
let requested_scope = match req.get("scope") {
None => std::env::var("LORE_SCOPE").unwrap_or_else(|_| "all".into()),
Some(value) => value.as_str().ok_or(Error::InvalidRequest)?.to_owned(),
};
let engine = std::env::var("LORE_ENGINE").unwrap_or_default();
Ok(json!(build_context(
cfg,
gate::cwd(req)?,
&requested_scope,
&engine,
engine,
RefreshPolicy::from_config(cfg)
)?))
}
Expand Down
24 changes: 23 additions & 1 deletion rust/lore-core/src/standalone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1260,12 +1260,34 @@ pub fn hook(cfg: &Config, args: &[String]) -> Result<()> {
{
return Ok(());
}
let snapshot = crate::context::snapshot(cfg, &req)?;
let mut snapshot = crate::context::snapshot_for_engine(cfg, &req, engine)?;
if engine == "codex" {
if let Ok(Value::String(graph)) = crate::context::graph_context_op(cfg, &req) {
if !graph.is_empty() {
let text = snapshot.as_str().ok_or(Error::InvalidRequest)?;
snapshot = json!(format!("{text}\n\n{graph}"));
}
}
}
output(
json!({"hookSpecificOutput":{"hookEventName":"SessionStart","additionalContext":snapshot}}),
)
}
"prompt" => {
if engine == "codex" {
if cfg.disabled("LORE_DISABLE_INJECT") {
return Ok(());
}
return match crate::context::graph_context_op(cfg, &req) {
Ok(Value::String(graph)) if !graph.is_empty() => output(json!({
"hookSpecificOutput": {
"hookEventName": "UserPromptSubmit",
"additionalContext": graph
}
})),
_ => Ok(()),
};
}
let _ = crate::standalone_hooks::review_at_prompt(cfg, &input, cwd, session, engine);
if engine == "claude"
&& ["LORE_LIVE_INDEX", "LORE_STREAM_INDEX"]
Expand Down
Loading
Loading