Codex skill for turning long engineering chats and project logs into compact, durable working memory.
Preserve durable state, not chatter.
Use this skill to turn long conversations into a compact working memory that survives across sessions without dragging the full transcript back into context.
Prioritize:
Drop:
For project work, keep memory inside the active workspace:
.codex-memory/<project-slug>/
raw/
session_YYYYMMDD_HHMM.md
compressed/
session_YYYYMMDD_HHMM.json
state/
project_state.md
open_loops.md
milestones.md
If there is no meaningful project workspace, fall back to a user-level cache directory.
Treat repo-owned documents such as README, docs/, issue trackers, or project notes as canonical. Deep memory is a compact working index, not a conflicting source of truth.
Start small.
If your Codex environment supports recent-chat or conversation-history retrieval, use only the smallest relevant slice. If it does not, write a short raw handoff note yourself.
Good intake sources:
Do not keep raw summaries floating in working memory.
mkdir -p .codex-memory/<project-slug>/raw .codex-memory/<project-slug>/compressed .codex-memory/<project-slug>/state
cat << 'MEMEOF' > .codex-memory/<project-slug>/raw/session_YYYYMMDD_HHMM.md
[paste chat summaries, notes, or search results here]
MEMEOF
Use the bundled helper:
python3 scripts/compressor.py compress \
.codex-memory/<project-slug>/raw/session_YYYYMMDD_HHMM.md \
--session-id "YYYYMMDD_HHMM" \
--max-lines 25 \
--json > .codex-memory/<project-slug>/compressed/session_YYYYMMDD_HHMM.json
Then render the compact view:
python3 scripts/compressor.py format \
.codex-memory/<project-slug>/compressed/session_YYYYMMDD_HHMM.json
Consult these in order:
state/project_state.mdstate/open_loops.mdWhen the user references earlier work such as:
Use this order:
project_state.md for durable factsopen_loops.md for unfinished workcompressor.py extract on the latest JSON for the category you needExample:
python3 scripts/compressor.py extract \
.codex-memory/<project-slug>/compressed/session_YYYYMMDD_HHMM.json \
--category architecture
For meaningful project sessions, update three rolling artifacts:
state/project_state.md
Stable facts that should still matter next weekstate/open_loops.md
Active blockers, TODOs, validation gaps, and follow-upsstate/milestones.md
Dated bullets for completed fixes, shipped behavior changes, and confirmed regressionsBefore updating them, compare the newest compressed summary with the previous one:
python3 scripts/compressor.py diff old_session.json new_session.json
Only write deltas that are actually durable.
# YYYY-MM-DD
## Completed
- [behavioral change or shipped fix]
## Verified
- [command, test, or manual verification]
## Open
- [remaining blocker or follow-up]
## Metrics
- [value + context]
## Files
- [important files touched]
Always try to capture:
Bundled at scripts/compressor.py.
Useful commands:
# Compress raw text into structured memory
python3 scripts/compressor.py compress input.md --session-id "20260312_1930" --json
# Render a compact readable summary
python3 scripts/compressor.py format session.json
# Extract one category for targeted recall
python3 scripts/compressor.py extract session.json --category bugs
python3 scripts/compressor.py extract session.json --category commands
# Build a cross-session timeline
python3 scripts/compressor.py timeline session1.json session2.json session3.json
# Show what changed between two sessions
python3 scripts/compressor.py diff old_session.json new_session.json
Do not:
project_state.md every session instead of updating only changed durable factsFor ongoing engineering work:
1. Pull 2-3 relevant chat fragments or write a short raw handoff note.
2. Save that raw text under .codex-memory/<project-slug>/raw/.
3. Run compressor.py compress.
4. Read project_state.md + open_loops.md + the formatted summary.
5. Work normally.
6. At the end, append durable deltas to milestones/open_loops/project_state.
Typical context cost stays low while keeping the parts that still matter next session.