This repo provides a portable setup for Codex automatic session memory + recall on Windows.
- Creates one timestamped file per Codex session:
sessionmemory-YYYYMMDD-HHMMSS-sessionid.md
- Appends later turns of the same session to the same file.
- Runs recall before non-trivial answers via
developer_instructions. - Writes latest recall result to
last-recall.md.
scripts/agent-session-memory-notify.ps1scripts/agent-session-memory-recall.ps1scripts/install.ps1scripts/uninstall.ps1AGENTS.md(instructions for coding agents)
- Windows PowerShell 5+ (or PowerShell 7+)
- Codex CLI installed and usable (
codex --version) - You have run
codexat least once (so~/.codex/config.tomlexists)
git clone https://github.com/Justike001/CodeXWithObsidian.git
cd .\CodeXWithObsidianpowershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\install.ps1This installer will:
- copy scripts to
~/.codex/scripts - back up
~/.codex/config.toml - preserve existing
developer_instructionsand append a managed memory block - set user env var
CODEX_AGENT_MEMORY_ROOT(default~\AgentSessionMemory)
Close and reopen Codex CLI.
- If your config already has an unrelated
notify, installer aborts to avoid silent override. - To intentionally replace existing
notify:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\install.ps1 -ForceOverrideNotifypowershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\install.ps1 `
-CodexConfigPath "$env:USERPROFILE\.codex\config.toml" `
-CodexScriptsPath "$env:USERPROFILE\.codex\scripts" `
-MemoryRoot "$env:USERPROFILE\AgentSessionMemory"codex exec --skip-git-repo-check "reply OK"
Get-ChildItem "$env:USERPROFILE\AgentSessionMemory" -Filter "sessionmemory-*.md"
Get-Content "$env:USERPROFILE\AgentSessionMemory\last-recall.md"powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\uninstall.ps1Optional: also remove memory notes folder.
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\uninstall.ps1 -RemoveMemoryRootBehavior:
- Restores newest
config.toml.bak-*if present. - If no backup is found, removes only this project's managed
notifyand managed block indeveloper_instructions. - Removes
agent-session-memory-*.ps1from~/.codex/scripts.
Open this folder as a vault root:
%USERPROFILE%\AgentSessionMemory
- If
config.tomldoes not exist, runcodexonce, then rerun install. - If notify/recall seems inactive, restart terminal + Codex.
- Installer creates a backup:
config.toml.bak-YYYYMMDD-HHMMSS.