eagle-mem 4.7.0 → 4.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/provider.sh CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
  # ═══════════════════════════════════════════════════════════
3
3
  # Eagle Mem — LLM Provider Abstraction
4
- # Config parsing + unified eagle_llm_call for Ollama/Anthropic/OpenAI
4
+ # Config parsing + unified eagle_llm_call for Ollama/agent CLI/API providers
5
5
  # ═══════════════════════════════════════════════════════════
6
6
 
7
7
  EAGLE_CONFIG_FILE="${EAGLE_MEM_DIR}/config.toml"
@@ -121,12 +121,17 @@ eagle_config_init() {
121
121
  local ollama_url="$EAGLE_DEFAULT_OLLAMA_URL"
122
122
  local provider="none"
123
123
  local model=""
124
+ local ollama_model="mistral"
124
125
 
125
126
  local ollama_response
126
127
  ollama_response=$(eagle_detect_ollama "$ollama_url")
127
128
  if [ -n "$ollama_response" ]; then
128
129
  provider="ollama"
129
130
  model=$(eagle_ollama_best_model "$ollama_url")
131
+ ollama_model="$model"
132
+ elif command -v codex &>/dev/null || command -v claude &>/dev/null; then
133
+ provider="agent_cli"
134
+ model="native"
130
135
  elif [ -n "${ANTHROPIC_API_KEY:-}" ]; then
131
136
  provider="anthropic"
132
137
  model="claude-haiku-4-5-20251001"
@@ -144,12 +149,20 @@ eagle_config_init() {
144
149
 
145
150
  [provider]
146
151
  # Which LLM provider to use for the curator and analysis features
147
- # Options: "ollama" (free, local), "anthropic", "openai"
152
+ # Options: "ollama" (free, local), "agent_cli" (Codex/Claude CLI auth), "anthropic", "openai"
148
153
  type = "$provider"
149
154
 
150
155
  [ollama]
151
156
  url = "$ollama_url"
152
- model = "${model:-mistral}"
157
+ model = "$ollama_model"
158
+
159
+ [agent_cli]
160
+ # Uses the already-installed Codex/Claude CLI instead of direct API keys.
161
+ # preferred = "current" uses EAGLE_AGENT_SOURCE when hooks invoke Eagle Mem.
162
+ # If run manually with no agent source, it prefers Codex when available.
163
+ preferred = "current"
164
+ codex_model = ""
165
+ claude_model = ""
153
166
 
154
167
  [anthropic]
155
168
  # Uses ANTHROPIC_API_KEY env var for authentication
@@ -184,6 +197,7 @@ eagle_llm_call() {
184
197
 
185
198
  case "$provider" in
186
199
  ollama) _eagle_call_ollama "$prompt" "$system_prompt" "$max_tokens" ;;
200
+ agent_cli) _eagle_call_agent_cli "$prompt" "$system_prompt" "$max_tokens" ;;
187
201
  anthropic) _eagle_call_anthropic "$prompt" "$system_prompt" "$max_tokens" ;;
188
202
  openai) _eagle_call_openai "$prompt" "$system_prompt" "$max_tokens" ;;
189
203
  none)
@@ -235,6 +249,170 @@ _eagle_call_ollama() {
235
249
  echo "$response" | jq -r '.message.content // empty'
236
250
  }
237
251
 
252
+ _eagle_agent_cli_target() {
253
+ local preferred
254
+ preferred=$(eagle_config_get "agent_cli" "preferred" "current")
255
+
256
+ case "$preferred" in
257
+ codex|openai-codex) echo "codex"; return 0 ;;
258
+ claude|claude-code|cloud-code) echo "claude-code"; return 0 ;;
259
+ auto)
260
+ if [ -n "${EAGLE_AGENT_SOURCE:-${EAGLE_AGENT:-}}" ]; then
261
+ eagle_agent_source
262
+ elif command -v codex &>/dev/null; then
263
+ echo "codex"
264
+ elif command -v claude &>/dev/null; then
265
+ echo "claude-code"
266
+ else
267
+ echo "none"
268
+ fi
269
+ ;;
270
+ current|*)
271
+ if [ -n "${EAGLE_AGENT_SOURCE:-${EAGLE_AGENT:-}}" ]; then
272
+ eagle_agent_source
273
+ elif command -v codex &>/dev/null; then
274
+ echo "codex"
275
+ elif command -v claude &>/dev/null; then
276
+ echo "claude-code"
277
+ else
278
+ echo "none"
279
+ fi
280
+ ;;
281
+ esac
282
+ }
283
+
284
+ _eagle_agent_cli_prompt_file() {
285
+ local prompt="$1" system="$2" max_tokens="$3" file="$4"
286
+ {
287
+ printf 'System instruction:\n%s\n\n' "$system"
288
+ printf 'Task:\n%s\n\n' "$prompt"
289
+ printf 'Output contract:\n'
290
+ printf -- '- Return only the requested curator text.\n'
291
+ printf -- '- Do not use markdown fences unless the task explicitly asks for them.\n'
292
+ printf -- '- Do not edit files, run project commands, or inspect the repository; all needed data is in this prompt.\n'
293
+ printf -- '- Keep the response within roughly %s tokens.\n' "$max_tokens"
294
+ } > "$file"
295
+ }
296
+
297
+ _eagle_call_agent_cli() {
298
+ local prompt="$1" system="$2" max_tokens="$3"
299
+ local target
300
+ target=$(_eagle_agent_cli_target)
301
+
302
+ case "$target" in
303
+ codex) _eagle_call_codex_cli "$prompt" "$system" "$max_tokens" ;;
304
+ claude-code) _eagle_call_claude_cli "$prompt" "$system" "$max_tokens" ;;
305
+ *)
306
+ eagle_log "ERROR" "agent_cli provider unavailable: no Codex or Claude CLI found"
307
+ return 1
308
+ ;;
309
+ esac
310
+ }
311
+
312
+ _eagle_call_codex_cli() {
313
+ local prompt="$1" system="$2" max_tokens="$3"
314
+ command -v codex &>/dev/null || {
315
+ eagle_log "ERROR" "agent_cli provider selected Codex, but codex command was not found"
316
+ return 1
317
+ }
318
+
319
+ mkdir -p "$EAGLE_MEM_DIR/tmp"
320
+ local prompt_file out_file
321
+ prompt_file=$(mktemp "$EAGLE_MEM_DIR/tmp/codex-provider-prompt.XXXXXX")
322
+ out_file=$(mktemp "$EAGLE_MEM_DIR/tmp/codex-provider-output.XXXXXX")
323
+ _eagle_agent_cli_prompt_file "$prompt" "$system" "$max_tokens" "$prompt_file"
324
+
325
+ local model
326
+ model=$(eagle_config_get "agent_cli" "codex_model" "")
327
+
328
+ local rc _had_errexit=0
329
+ case "$-" in *e*) _had_errexit=1; set +e ;; esac
330
+ if [ -n "$model" ]; then
331
+ EAGLE_MEM_DISABLE_HOOKS=1 codex exec \
332
+ --ephemeral \
333
+ --skip-git-repo-check \
334
+ --ignore-rules \
335
+ -c features.codex_hooks=false \
336
+ --sandbox read-only \
337
+ --cd "${EAGLE_AGENT_CWD:-$(pwd)}" \
338
+ --model "$model" \
339
+ --output-last-message "$out_file" \
340
+ - < "$prompt_file" >> "$EAGLE_MEM_LOG" 2>&1
341
+ rc=$?
342
+ else
343
+ EAGLE_MEM_DISABLE_HOOKS=1 codex exec \
344
+ --ephemeral \
345
+ --skip-git-repo-check \
346
+ --ignore-rules \
347
+ -c features.codex_hooks=false \
348
+ --sandbox read-only \
349
+ --cd "${EAGLE_AGENT_CWD:-$(pwd)}" \
350
+ --output-last-message "$out_file" \
351
+ - < "$prompt_file" >> "$EAGLE_MEM_LOG" 2>&1
352
+ rc=$?
353
+ fi
354
+ [ "$_had_errexit" -eq 1 ] && set -e
355
+
356
+ rm -f "$prompt_file"
357
+ if [ "$rc" -ne 0 ] || [ ! -s "$out_file" ]; then
358
+ rm -f "$out_file"
359
+ eagle_log "ERROR" "Codex agent_cli provider call failed"
360
+ return 1
361
+ fi
362
+
363
+ cat "$out_file"
364
+ rm -f "$out_file"
365
+ }
366
+
367
+ _eagle_call_claude_cli() {
368
+ local prompt="$1" system="$2" max_tokens="$3"
369
+ command -v claude &>/dev/null || {
370
+ eagle_log "ERROR" "agent_cli provider selected Claude Code, but claude command was not found"
371
+ return 1
372
+ }
373
+
374
+ mkdir -p "$EAGLE_MEM_DIR/tmp"
375
+ local prompt_file out_file model rc
376
+ prompt_file=$(mktemp "$EAGLE_MEM_DIR/tmp/claude-provider-prompt.XXXXXX")
377
+ out_file=$(mktemp "$EAGLE_MEM_DIR/tmp/claude-provider-output.XXXXXX")
378
+ _eagle_agent_cli_prompt_file "$prompt" "$system" "$max_tokens" "$prompt_file"
379
+ model=$(eagle_config_get "agent_cli" "claude_model" "")
380
+
381
+ local _had_errexit=0
382
+ case "$-" in *e*) _had_errexit=1; set +e ;; esac
383
+ if [ -n "$model" ]; then
384
+ EAGLE_MEM_DISABLE_HOOKS=1 CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1 claude -p \
385
+ --no-session-persistence \
386
+ --disable-slash-commands \
387
+ --permission-mode dontAsk \
388
+ --tools "" \
389
+ --output-format text \
390
+ --model "$model" \
391
+ "$(cat "$prompt_file")" > "$out_file" 2>> "$EAGLE_MEM_LOG"
392
+ rc=$?
393
+ else
394
+ EAGLE_MEM_DISABLE_HOOKS=1 CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1 claude -p \
395
+ --no-session-persistence \
396
+ --disable-slash-commands \
397
+ --permission-mode dontAsk \
398
+ --tools "" \
399
+ --output-format text \
400
+ "$(cat "$prompt_file")" > "$out_file" 2>> "$EAGLE_MEM_LOG"
401
+ rc=$?
402
+ fi
403
+ [ "$_had_errexit" -eq 1 ] && set -e
404
+
405
+ rm -f "$prompt_file"
406
+ if [ "$rc" -ne 0 ] || [ ! -s "$out_file" ]; then
407
+ rm -f "$out_file"
408
+ eagle_log "ERROR" "Claude agent_cli provider call failed"
409
+ return 1
410
+ fi
411
+
412
+ cat "$out_file"
413
+ rm -f "$out_file"
414
+ }
415
+
238
416
  _eagle_call_anthropic() {
239
417
  local prompt="$1" system="$2" max_tokens="$3"
240
418
  local model api_key
@@ -332,7 +510,11 @@ eagle_show_config() {
332
510
 
333
511
  local provider model
334
512
  provider=$(eagle_config_get "provider" "type" "none")
335
- model=$(eagle_config_get "$provider" "model" "unknown")
513
+ if [ "$provider" = "agent_cli" ]; then
514
+ model=$(_eagle_agent_cli_target)
515
+ else
516
+ model=$(eagle_config_get "$provider" "model" "unknown")
517
+ fi
336
518
 
337
519
  echo "Provider: $provider"
338
520
  echo "Model: $model"
@@ -349,6 +531,10 @@ eagle_show_config() {
349
531
  else
350
532
  echo "Status: not running"
351
533
  fi
534
+ elif [ "$provider" = "agent_cli" ]; then
535
+ echo "Preferred: $(eagle_config_get "agent_cli" "preferred" "current")"
536
+ echo "Codex: $(command -v codex 2>/dev/null || echo "not found")"
537
+ echo "Claude: $(command -v claude 2>/dev/null || echo "not found")"
352
538
  fi
353
539
 
354
540
  echo ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eagle-mem",
3
- "version": "4.7.0",
3
+ "version": "4.7.1",
4
4
  "description": "Context that survives /compact for Claude Code and Codex — SQLite + FTS5, no daemon, no bloat",
5
5
  "bin": {
6
6
  "eagle-mem": "bin/eagle-mem"
package/scripts/config.sh CHANGED
@@ -36,6 +36,8 @@ case "$subcommand" in
36
36
  eagle_err "Usage: eagle-mem config set <section.key> <value>"
37
37
  eagle_info "Examples:"
38
38
  eagle_info " eagle-mem config set provider.type ollama"
39
+ eagle_info " eagle-mem config set provider.type agent_cli"
40
+ eagle_info " eagle-mem config set agent_cli.preferred current"
39
41
  eagle_info " eagle-mem config set ollama.model mistral"
40
42
  eagle_info " eagle-mem config set anthropic.model claude-haiku-4-5-20251001"
41
43
  exit 1
package/scripts/health.sh CHANGED
@@ -133,7 +133,11 @@ max_score=$((max_score + 15))
133
133
 
134
134
  provider=$(eagle_config_get "provider" "type" "none")
135
135
  if [ "$provider" != "none" ]; then
136
- model=$(eagle_config_get "$provider" "model" "default")
136
+ if [ "$provider" = "agent_cli" ]; then
137
+ model=$(_eagle_agent_cli_target)
138
+ else
139
+ model=$(eagle_config_get "$provider" "model" "default")
140
+ fi
137
141
  eagle_ok "Provider: ${provider} (${model})"
138
142
  score=$((score + 15))
139
143
  else
package/scripts/help.sh CHANGED
@@ -24,7 +24,7 @@ echo -e " ${CYAN}health${RESET} Diagnose pipeline health and background
24
24
  echo -e " ${CYAN}config${RESET} View or change LLM provider settings"
25
25
  echo -e " ${CYAN}guard${RESET} Manage regression guardrails for files"
26
26
  echo -e " ${CYAN}overview${RESET} Build or view project overview"
27
- echo -e " ${CYAN}memories${RESET} View/sync Claude Code memories"
27
+ echo -e " ${CYAN}memories${RESET} View/sync agent memories"
28
28
  echo -e " ${CYAN}tasks${RESET} View mirrored tasks"
29
29
  echo -e " ${CYAN}curate${RESET} Run curator (co-edits, hot files, guardrails)"
30
30
  echo -e " ${CYAN}feature${RESET} Track, verify, and unblock features"
@@ -44,11 +44,11 @@ echo -e " ${DIM}\$${RESET} eagle-mem feature pending ${DIM}# pending re
44
44
  echo -e " ${DIM}\$${RESET} eagle-mem feature verify NAME ${DIM}# verify current diff after testing${RESET}"
45
45
  echo -e " ${DIM}\$${RESET} eagle-mem feature waive ID ${DIM}# intentional exception${RESET}"
46
46
  echo ""
47
- echo -e " ${BOLD}Skills${RESET} ${DIM}(inside Claude Code sessions):${RESET}"
48
- echo -e " ${CYAN}/eagle-mem-search${RESET} Search memory and past sessions"
49
- echo -e " ${CYAN}/eagle-mem-overview${RESET} Build or update project overview"
50
- echo -e " ${CYAN}/eagle-mem-memories${RESET} View/sync Claude Code memories"
51
- echo -e " ${CYAN}/eagle-mem-tasks${RESET} TaskAware Compact Loop for multi-step work"
47
+ echo -e " ${BOLD}Skills${RESET} ${DIM}(inside Claude Code and Codex sessions):${RESET}"
48
+ echo -e " ${CYAN}eagle-mem-search${RESET} Search memory and past sessions"
49
+ echo -e " ${CYAN}eagle-mem-overview${RESET} Build or update project overview"
50
+ echo -e " ${CYAN}eagle-mem-memories${RESET} View/sync agent memories"
51
+ echo -e " ${CYAN}eagle-mem-tasks${RESET} TaskAware Compact Loop for multi-step work"
52
52
  echo ""
53
53
  echo -e " ${DIM}Everything else is automatic — scan, index, prune, and${RESET}"
54
54
  echo -e " ${DIM}curator all run in the background via hooks.${RESET}"
@@ -251,6 +251,18 @@ if [ "$claude_found" = true ] && [ -d "$PACKAGE_DIR/skills" ]; then
251
251
  done
252
252
  fi
253
253
 
254
+ if [ "$codex_found" = true ] && [ -d "$PACKAGE_DIR/skills" ]; then
255
+ mkdir -p "$EAGLE_CODEX_SKILLS_DIR"
256
+ for skill_dir in "$PACKAGE_DIR"/skills/*/; do
257
+ [ ! -d "$skill_dir" ] && continue
258
+ skill_name=$(basename "$skill_dir")
259
+ dst="$EAGLE_CODEX_SKILLS_DIR/$skill_name"
260
+ [ -L "$dst" ] && rm "$dst"
261
+ ln -sf "$skill_dir" "$dst"
262
+ eagle_ok "Codex skill: $skill_name"
263
+ done
264
+ fi
265
+
254
266
  # ─── Statusline integration ───────────────────────────────
255
267
 
256
268
  if [ "$claude_found" = true ]; then
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
  # ═══════════════════════════════════════════════════════════
3
- # Eagle Mem — Claude Code Memory Mirror CLI
4
- # List, show, search, and sync Claude Code auto-memories
3
+ # Eagle Mem — Agent Memory Mirror CLI
4
+ # List, show, search, and sync mirrored memories/plans/tasks
5
5
  # ═══════════════════════════════════════════════════════════
6
6
  set -euo pipefail
7
7
 
@@ -28,7 +28,7 @@ limit=20
28
28
  query=""
29
29
 
30
30
  show_help() {
31
- echo -e " ${BOLD}eagle-mem memories${RESET} — Claude Code memory, plan & task mirror"
31
+ echo -e " ${BOLD}eagle-mem memories${RESET} — Agent memory, plan & task mirror"
32
32
  echo ""
33
33
  echo -e " ${BOLD}Usage:${RESET}"
34
34
  echo -e " eagle-mem memories ${DIM}# list all mirrored memories${RESET}"
@@ -48,7 +48,7 @@ show_help() {
48
48
  echo -e " ${CYAN}-l, --limit${RESET} <N> Max results (default: 20)"
49
49
  echo ""
50
50
  echo -e " ${BOLD}How it works:${RESET}"
51
- echo -e " ${DOT} Eagle Mem intercepts Claude Code's auto-memory, plan, and task writes"
51
+ echo -e " ${DOT} Eagle Mem mirrors agent memory, plan, and task writes"
52
52
  echo -e " ${DOT} All are mirrored into Eagle Mem's SQLite + FTS5"
53
53
  echo -e " ${DOT} Use ${CYAN}sync${RESET} to backfill items written before mirroring was enabled"
54
54
  echo ""
@@ -92,12 +92,12 @@ memories_list() {
92
92
  eagle_header "Memories"
93
93
 
94
94
  local result
95
- result=$(eagle_list_claude_memories "$project" "$limit")
95
+ result=$(eagle_list_agent_memories "$project" "$limit")
96
96
 
97
97
  if [ -z "$result" ]; then
98
98
  eagle_dim "No mirrored memories found."
99
99
  echo ""
100
- eagle_dim "Memories are captured automatically when Claude Code writes to its auto-memory."
100
+ eagle_dim "Memories are captured automatically when supported agents write memory files."
101
101
  eagle_dim "Run 'eagle-mem memories sync' to backfill existing memories."
102
102
  echo ""
103
103
  return
@@ -137,7 +137,7 @@ memories_search() {
137
137
  echo ""
138
138
 
139
139
  local result
140
- result=$(eagle_search_claude_memories "$query" "$project" "$limit")
140
+ result=$(eagle_search_agent_memories "$query" "$project" "$limit")
141
141
 
142
142
  if [ -z "$result" ]; then
143
143
  eagle_dim "No memories matching '$query'"
@@ -179,7 +179,7 @@ memories_show() {
179
179
 
180
180
  local meta
181
181
  meta=$(eagle_db "SELECT memory_name, memory_type, description, file_path, updated_at, origin_session_id, origin_agent
182
- FROM claude_memories WHERE file_path = '$(eagle_sql_escape "$query")';")
182
+ FROM agent_memories WHERE file_path = '$(eagle_sql_escape "$query")';")
183
183
 
184
184
  if [ -z "$meta" ]; then
185
185
  eagle_err "Memory not found: $query"
@@ -216,12 +216,12 @@ plans_list() {
216
216
  eagle_header "Plans"
217
217
 
218
218
  local result
219
- result=$(eagle_list_claude_plans "$project" "$limit")
219
+ result=$(eagle_list_agent_plans "$project" "$limit")
220
220
 
221
221
  if [ -z "$result" ]; then
222
222
  eagle_dim "No captured plans found."
223
223
  echo ""
224
- eagle_dim "Plans are captured when Claude Code writes to ~/.claude/plans/"
224
+ eagle_dim "Plans are captured when supported agents write plan files."
225
225
  eagle_dim "Run 'eagle-mem memories sync' to backfill existing plans."
226
226
  echo ""
227
227
  return
@@ -255,7 +255,7 @@ plans_search() {
255
255
  echo ""
256
256
 
257
257
  local result
258
- result=$(eagle_search_claude_plans "$query" "$project" "$limit")
258
+ result=$(eagle_search_agent_plans "$query" "$project" "$limit")
259
259
 
260
260
  if [ -z "$result" ]; then
261
261
  eagle_dim "No plans matching '$query'"
@@ -289,7 +289,7 @@ plans_show() {
289
289
 
290
290
  local meta
291
291
  meta=$(eagle_db "SELECT title, project, file_path, updated_at, origin_session_id, origin_agent
292
- FROM claude_plans WHERE file_path = '$(eagle_sql_escape "$query")';")
292
+ FROM agent_plans WHERE file_path = '$(eagle_sql_escape "$query")';")
293
293
 
294
294
  if [ -z "$meta" ]; then
295
295
  eagle_err "Plan not found: $query"
@@ -320,15 +320,15 @@ plans_show() {
320
320
  }
321
321
 
322
322
  tasks_list() {
323
- eagle_header "Claude Code Tasks"
323
+ eagle_header "Agent Tasks"
324
324
 
325
325
  local result
326
- result=$(eagle_list_claude_tasks "$project" "$limit")
326
+ result=$(eagle_list_agent_tasks "$project" "$limit")
327
327
 
328
328
  if [ -z "$result" ]; then
329
329
  eagle_dim "No captured tasks found."
330
330
  echo ""
331
- eagle_dim "Tasks are captured when Claude Code uses TaskCreate/TaskUpdate."
331
+ eagle_dim "Tasks are captured when supported agents use task lifecycle tools."
332
332
  eagle_dim "Run 'eagle-mem memories sync' to backfill existing tasks."
333
333
  echo ""
334
334
  return
@@ -366,7 +366,7 @@ tasks_search() {
366
366
  echo ""
367
367
 
368
368
  local result
369
- result=$(eagle_search_claude_tasks "$query" "$project" "$limit")
369
+ result=$(eagle_search_agent_tasks "$query" "$project" "$limit")
370
370
 
371
371
  if [ -z "$result" ]; then
372
372
  eagle_dim "No tasks matching '$query'"
@@ -404,7 +404,7 @@ tasks_show() {
404
404
 
405
405
  local meta
406
406
  meta=$(eagle_db "SELECT subject, status, description, active_form, source_session_id, source_task_id, file_path, updated_at, origin_agent
407
- FROM claude_tasks WHERE file_path = '$(eagle_sql_escape "$query")';")
407
+ FROM agent_tasks WHERE file_path = '$(eagle_sql_escape "$query")';")
408
408
 
409
409
  if [ -z "$meta" ]; then
410
410
  eagle_err "Task not found: $query"
@@ -442,7 +442,7 @@ memories_sync() {
442
442
  eagle_header "Memory, Plan & Task Sync"
443
443
 
444
444
  # ─── Sync memories ───────────────────────────────────
445
- eagle_info "Scanning for Claude Code auto-memory files..."
445
+ eagle_info "Scanning for agent memory files..."
446
446
  echo ""
447
447
 
448
448
  local claude_mem_root="$EAGLE_CLAUDE_PROJECTS_DIR"
@@ -456,7 +456,7 @@ memories_sync() {
456
456
  [ "$base" = "MEMORY.md" ] && continue
457
457
 
458
458
  local existing_hash
459
- existing_hash=$(eagle_db "SELECT content_hash FROM claude_memories WHERE file_path = '$(eagle_sql_escape "$memfile")';")
459
+ existing_hash=$(eagle_db "SELECT content_hash FROM agent_memories WHERE file_path = '$(eagle_sql_escape "$memfile")';")
460
460
  local new_hash
461
461
  new_hash=$(shasum -a 256 "$memfile" | awk '{print $1}')
462
462
 
@@ -465,17 +465,40 @@ memories_sync() {
465
465
  continue
466
466
  fi
467
467
 
468
- eagle_capture_claude_memory "$memfile" "" ""
468
+ eagle_capture_agent_memory "$memfile" "" ""
469
469
  mem_synced=$((mem_synced + 1))
470
470
  eagle_ok "Memory: $base"
471
471
  done < <(find "$claude_mem_root" -path "*/memory/*.md" -print0 2>/dev/null)
472
472
  fi
473
473
 
474
+ local codex_mem_root="$EAGLE_CODEX_MEMORIES_DIR"
475
+ if [ -d "$codex_mem_root" ]; then
476
+ local codex_project="$project"
477
+ [ -z "$codex_project" ] && codex_project=$(eagle_project_from_cwd "$(pwd)")
478
+ for memfile in "$codex_mem_root/MEMORY.md" "$codex_mem_root/memory_summary.md"; do
479
+ [ ! -f "$memfile" ] && continue
480
+
481
+ local existing_hash
482
+ existing_hash=$(eagle_db "SELECT content_hash FROM agent_memories WHERE file_path = '$(eagle_sql_escape "$memfile")';")
483
+ local new_hash
484
+ new_hash=$(shasum -a 256 "$memfile" | awk '{print $1}')
485
+
486
+ if [ "$existing_hash" = "$new_hash" ]; then
487
+ mem_skipped=$((mem_skipped + 1))
488
+ continue
489
+ fi
490
+
491
+ eagle_capture_agent_memory "$memfile" "" "$codex_project" "codex"
492
+ mem_synced=$((mem_synced + 1))
493
+ eagle_ok "Codex memory: $(basename "$memfile")"
494
+ done
495
+ fi
496
+
474
497
  eagle_kv "Memories:" "$mem_synced synced, $mem_skipped unchanged"
475
498
  echo ""
476
499
 
477
500
  # ─── Sync plans ──────────────────────────────────────
478
- eagle_info "Scanning for Claude Code plan files..."
501
+ eagle_info "Scanning for agent plan files..."
479
502
  echo ""
480
503
 
481
504
  local plans_dir="$EAGLE_CLAUDE_PLANS_DIR"
@@ -487,7 +510,7 @@ memories_sync() {
487
510
  [ ! -f "$planfile" ] && continue
488
511
 
489
512
  local existing_hash
490
- existing_hash=$(eagle_db "SELECT content_hash FROM claude_plans WHERE file_path = '$(eagle_sql_escape "$planfile")';")
513
+ existing_hash=$(eagle_db "SELECT content_hash FROM agent_plans WHERE file_path = '$(eagle_sql_escape "$planfile")';")
491
514
  local new_hash
492
515
  new_hash=$(shasum -a 256 "$planfile" | awk '{print $1}')
493
516
 
@@ -496,7 +519,7 @@ memories_sync() {
496
519
  continue
497
520
  fi
498
521
 
499
- eagle_capture_claude_plan "$planfile" "" ""
522
+ eagle_capture_agent_plan "$planfile" "" ""
500
523
  plan_synced=$((plan_synced + 1))
501
524
  local ptitle
502
525
  ptitle=$(awk '/^# /{print; exit}' "$planfile" | sed 's/^# //')
@@ -508,7 +531,7 @@ memories_sync() {
508
531
  echo ""
509
532
 
510
533
  # ─── Sync tasks ──────────────────────────────────────
511
- eagle_info "Scanning for Claude Code task files..."
534
+ eagle_info "Scanning for agent task files..."
512
535
  echo ""
513
536
 
514
537
  local tasks_dir="$EAGLE_CLAUDE_TASKS_DIR"
@@ -528,7 +551,7 @@ memories_sync() {
528
551
  [ ! -f "$taskfile" ] && continue
529
552
 
530
553
  local existing_hash
531
- existing_hash=$(eagle_db "SELECT content_hash FROM claude_tasks WHERE file_path = '$(eagle_sql_escape "$taskfile")';")
554
+ existing_hash=$(eagle_db "SELECT content_hash FROM agent_tasks WHERE file_path = '$(eagle_sql_escape "$taskfile")';")
532
555
  local new_hash
533
556
  new_hash=$(shasum -a 256 "$taskfile" | awk '{print $1}')
534
557
 
@@ -537,7 +560,7 @@ memories_sync() {
537
560
  continue
538
561
  fi
539
562
 
540
- eagle_capture_claude_task "$taskfile" "$sid" "$task_project"
563
+ eagle_capture_agent_task "$taskfile" "$sid" "$task_project"
541
564
  task_synced=$((task_synced + 1))
542
565
  done
543
566
  done
@@ -547,7 +570,7 @@ memories_sync() {
547
570
  echo ""
548
571
 
549
572
  # ─── Backfill project names ──────────────────────────
550
- eagle_info "Resolving project names from Claude Code transcripts..."
573
+ eagle_info "Resolving project names from agent transcripts..."
551
574
 
552
575
  local backfilled
553
576
  backfilled=$(eagle_backfill_projects)
@@ -54,7 +54,7 @@ run_step "Index" bash "$SCRIPTS_DIR/index.sh" "$TARGET_DIR"
54
54
  echo ""
55
55
 
56
56
  # ─── 3. Memory sync ─────────────────────────────────────
57
- eagle_info "Step 3/4: Syncing Claude Code memories, plans, and tasks..."
57
+ eagle_info "Step 3/4: Syncing agent memories, plans, and tasks..."
58
58
  run_step "Memory sync" bash "$SCRIPTS_DIR/memories.sh" sync
59
59
  echo ""
60
60
 
@@ -65,8 +65,8 @@ project_sql=$(eagle_sql_escape "$PROJECT")
65
65
  sessions=$(eagle_db "SELECT COUNT(*) FROM sessions WHERE project = '$project_sql';")
66
66
  summaries=$(eagle_db "SELECT COUNT(*) FROM summaries WHERE project = '$project_sql';")
67
67
  chunks=$(eagle_db "SELECT COUNT(*) FROM code_chunks WHERE project = '$project_sql';")
68
- memories=$(eagle_db "SELECT COUNT(*) FROM claude_memories WHERE project = '$project_sql';")
69
- tasks=$(eagle_db "SELECT COUNT(*) FROM claude_tasks WHERE project = '$project_sql';")
68
+ memories=$(eagle_db "SELECT COUNT(*) FROM agent_memories WHERE project = '$project_sql';")
69
+ tasks=$(eagle_db "SELECT COUNT(*) FROM agent_tasks WHERE project = '$project_sql';")
70
70
 
71
71
  echo ""
72
72
  eagle_kv "Sessions:" "${sessions:-0}"