mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
5973f9b787
Signed-off-by: phernandez <paul@basicmachines.co>
16 lines
449 B
Bash
Executable File
16 lines
449 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# PreCompact hook - checkpoint Codex work into Basic Memory before compaction.
|
|
#
|
|
# Contract: best effort. The hook only writes when .codex/basic-memory.json pins a
|
|
# primary project, and every failure exits 0 so compaction can continue.
|
|
|
|
set -u
|
|
|
|
if ! command -v uv >/dev/null 2>&1; then
|
|
exit 0
|
|
fi
|
|
|
|
script_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
|
|
uv run --script "$script_dir/pre-compact.py" 2>/dev/null || exit 0
|