CortexLog is a local CLI that gives humans and AI agents a shared memory timeline.
It stores work events in an append-only JSONL file so sessions can be resumed safely after context loss, handoffs, or restarts.
CortexLog helps you answer 3 questions quickly:
- What are we trying to do right now?
- What changed, and why?
- Is our current claim consistent with evidence?
It combines:
checkpoint: goal + decision + next actionstrace(TruthGraph): claim + outcome + evidence + dependenciesverify: contradiction and dependency checkshandoff: machine-readable transfer packet for next human/agent
- Better project memory across days
- Easier review of decision history
- Faster onboarding for a new teammate
- Safer releases with explicit verification gates
flowchart LR
A["Do work"] --> B["checkpoint\n(goal, decision, next)"]
B --> C["trace\n(claim, evidence, depends_on)"]
C --> D["verify\n(pass/fail report)"]
D --> E["handoff\n(prompt/json)"]
E --> A
# 1) Capture current state
python3 cortexlog.py checkpoint \
--goal "Ship migration safely" \
--decision "Use additive schema change first" \
--next "Write migration test" \
--next "Run canary deploy" \
--files "db/migrations/001.sql,tests/test_migration.py" \
--tags "backend,release"
# 2) Record a verifiable claim
python3 cortexlog.py trace \
--claim "Migration tests pass in CI" \
--outcome confirmed \
--evidence "python3 -m unittest discover -s tests -q,gh run view 123"
# 3) Run integrity check (exit code 0 on pass, 1 on fail)
python3 cortexlog.py verify
# 4) Generate handoff for next person/agent
python3 cortexlog.py handoff --verified --format jsonpython3 cortexlog.py checkpoint --goal "Add CSV export" --decision "Use streaming writer" --next "Implement endpoint" --next "Add tests"
python3 cortexlog.py add "Implemented endpoint skeleton" --tags backend
python3 cortexlog.py trace --claim "CSV endpoint returns valid header" --outcome confirmed --evidence "pytest tests/test_csv.py"
python3 cortexlog.py resolve "Implement endpoint"
python3 cortexlog.py handoff --verified --format promptpython3 cortexlog.py trace --claim "All tests pass" --outcome confirmed --evidence "pytest -q"
python3 cortexlog.py trace --claim "All tests pass" --outcome failed --evidence "CI run #142"
python3 cortexlog.py verify
# returns FAIL and exit code 1python3 cortexlog.py list --kind checkpoint
python3 cortexlog.py search "rate limiter"
python3 cortexlog.py handoff --verified --format json > handoff.jsonverify runs TruthGraph checks on trace events:
- Contradictions: same normalized claim marked both
confirmedandfailed - Dangling dependencies:
depends_onreferences unknown trace IDs - Unresolved failed claims: latest state of a claim is still
failed - Warning only:
confirmedclaims without evidence
add "note" [--tags comma,separated]checkpoint --goal "..." --decision "..." --next "..." [--next "..."] [--files a,b] [--tags a,b] [--note "..."]trace --claim "..." --outcome pending|confirmed|failed|retracted [--evidence a,b] [--depends-on t1,t2] [--id t9] [--tags a,b] [--note "..."]verify [--format prompt|json]resolve "task text" [--note "..."] [--tags a,b]list [--day YYYY-MM-DD] [--kind note|checkpoint|trace|resolve]search "query" [--kind note|checkpoint|trace|resolve]statshandoff [--limit N] [--format prompt|json] [--verified]
Each row in .cortexlog.jsonl is immutable:
note: free-form observationcheckpoint: objective + decision + next actions + touched filestrace: causal claim + outcome + evidence + dependenciesresolve: closure of an earlier next-action
Open tasks are computed as: checkpoint actions minus resolved tasks.
- Default DB:
.cortexlog.jsonlin current directory - Override DB:
--db /path/to/file.jsonl
python3 -m unittest discover -s tests -qIf this project helps you, consider supporting development:
cortexlog, truthgraph, ai agent memory, context window recovery, agent handoff, causal trace graph, append-only event log, jsonl memory, resumable autonomous workflow, checkpointed decisions, task resolution ledger, workspace cognition