Manage Durable Notes
Policy
Use durable notes for user-approved, cross-session facts: host setup, repo access plans, runbooks, open tasks, decisions, project context, preferences, and meaningful history. Keep notes as plain Markdown with predictable paths so they remain useful in grep, git, and Markdown vault tools.
Do not store secrets, private keys, tokens, passwords, recovery codes, or full credential values in notes or generated templates. For credentials, record only where they are stored, what they are for, who owns them, their scope, and how to revoke or rotate them.
Review Artifacts And Redaction
Generated review artifacts, candidate files, reconciliation ledger fields, and
diffs produced from local durable notes need a redaction review before they are
persisted, summarized, copied into Linear, or promoted into shared durable
sources. This includes local-only artifacts that stay on the host: do not let a
raw diff preserve sensitive values just because the destination is not shared.
Before recording one of these artifacts, redact or omit:
- private IP addresses, hostnames, device identifiers, serial numbers, and
other host-only facts;
- credential values, private keys, tokens, passwords, recovery codes, and
credential hints that would make a secret easier to find or use;
- private local paths when the exact path is not needed for the review decision;
- any other local-only fact that is not necessary for the human reconciliation
choice.
When a diff or candidate file can be safely redacted, keep only the minimum
context needed to explain the conflict and use explicit placeholders such as
[REDACTED_PRIVATE_HOST] or [REDACTED_SECRET]. When safe redaction is
ambiguous, write a summary-only artifact instead: name the local file category,
state the human decision needed, and do not copy raw diff content.
Do not require an agent signature on every stable wiki or durable-note page.
Use compact provenance only where it helps review or reconciliation, such as
generated review artifacts, append-only activity ledger entries, and
machine-readable reconciliation events. Useful fields include agentId,
runId, model, reasoningLabel, policyVersion, sourceIssue, and a
timestamp when those values are available and safe to record.
Memory Model
Treat durable notes as a practical wiki crossed with an activity ledger:
- Current state: fast orientation for active host, project, task, service, timer, and credential-metadata facts.
- Activity ledger: append-oriented historical memory for meaningful sessions, PRs, installs, incidents, validations, and decisions.
- Semantic wiki: curated project, runbook, decision, credential, state, and archive notes.
- Procedural memory: repeatable habits captured in runbooks and skills.
- Salience and preferences: durable user preferences, risk posture, and recurring cautions that should guide future work.
Use this promotion flow:
- Raw conversation or task context produces potentially durable facts.
- Meaningful historical context goes into a dated ledger entry or the relevant project note.
- Stable current facts update
tasks/TODO.md, state/CURRENT.md, state/HOST.md, or a project page.
- Repeated procedures become runbooks or skills.
- Architectural or operational choices become decision records.
- Superseded information is marked historical or moved to
archive/; useful history is not silently deleted.
Standard Layout
Prefer this hierarchy under the user's home directory:
~/codex-notes/
INDEX.md
tasks/TODO.md
state/HOST.md
state/CURRENT.md
ledger/README.md
projects/
runbooks/
decisions/
preferences/README.md
credentials/NOTES.md
archive/
Keep root-level entry points for discoverability:
~/AGENTS.md: tells future sessions where the durable notes live.
~/CODEX_TODO.md: compatibility pointer or lightweight mirror; the canonical durable task file is ~/codex-notes/tasks/TODO.md.
~/REMOTE_ACCESS.md: compatibility note for SSH/tmux access when present.
Start-Of-Session Read Path
- Read
~/AGENTS.md when present.
- Read
~/CODEX_TODO.md when present for compatibility pointers and active durable tasks.
- Read
~/codex-notes/INDEX.md if present; otherwise run the initializer.
- Follow the index to relevant
state/, projects/, runbooks/, decisions/, preferences/, credentials/, and ledger/ files.
- Use the ledger when narrative history matters or when current-state notes point to an earlier event.
Workflow
- Choose the narrowest target:
- Active/open work ->
tasks/TODO.md
- Fast orientation ->
state/CURRENT.md
- Host facts ->
state/HOST.md
- Historical sequence ->
ledger/YYYY-MM.md
- Stable project context ->
projects/<name>.md
- Repeatable procedures ->
runbooks/<topic>.md
- Decisions with rationale ->
decisions/YYYY-MM-DD-<slug>.md
- Preferences or risk posture ->
preferences/README.md or preferences/<topic>.md
- Credential metadata without secrets ->
credentials/NOTES.md
- Keep notes concise, dated, and actionable. Prefer bullets with concrete paths, commands, issue or PR IDs, service names, and next steps.
- When current state changes, update the current-state note rather than burying the new fact only in a ledger entry.
- When a note supersedes stale content, mark the old content as superseded or move it to
archive/; do not silently delete useful history.
- For root
~/CODEX_TODO.md, keep either a pointer to the canonical task file or a deliberately short mirror. Avoid maintaining two competing task lists.
End-Of-Task Memory Check
Before finishing substantial work, ask whether any of these changed:
- current state, active tasks, project state, services, timers, or external integrations;
- a decision, rationale, procedure, runbook, or skill-worthy habit;
- a user preference, risk posture, or recurring caution;
- credential metadata, storage location, scope, owner, revocation, or rotation guidance;
- useful historical context worth preserving separately from current state.
If yes, update the narrowest durable note and link related artifacts. Do not store secrets.
Searchability Rules
- Use plain Markdown, predictable paths, concrete nouns, and searchable headings.
- Include dates, issue IDs, PR numbers, repo names, host names, service names, timer names, and command names when relevant.
- Link related notes, commits, PRs, issues, logs, and runbooks rather than duplicating long content.
- Keep current-state pages short enough for quick orientation; move long history to the ledger.
- Prefer monthly ledger files named
ledger/YYYY-MM.md unless the host has an established dated convention.
Initializer
Run the script before first use on a host:
python3 ~/.codex/skills/manage-durable-notes/scripts/init_durable_notes.py
For a dry run:
python3 ~/.codex/skills/manage-durable-notes/scripts/init_durable_notes.py --dry-run
The initializer creates the hierarchy, preserves existing root notes, and adds pointers so future sessions can find the standard location.
1---2name: manage-durable-notes3description: Create, inspect, and update durable filesystem notes for Codex continuity across sessions. Use when the user asks Codex to remember, persist, record, save for later, create a durable note, update a local memory/todo store, summarize setup state, maintain a runbook, or standardize notes that future agents should read after context loss.4---56# Manage Durable Notes78## Policy910Use durable notes for user-approved, cross-session facts: host setup, repo access plans, runbooks, open tasks, decisions, project context, preferences, and meaningful history. Keep notes as plain Markdown with predictable paths so they remain useful in grep, git, and Markdown vault tools.1112Do not store secrets, private keys, tokens, passwords, recovery codes, or full credential values in notes or generated templates. For credentials, record only where they are stored, what they are for, who owns them, their scope, and how to revoke or rotate them.1314## Review Artifacts And Redaction1516Generated review artifacts, candidate files, reconciliation ledger fields, and17diffs produced from local durable notes need a redaction review before they are18persisted, summarized, copied into Linear, or promoted into shared durable19sources. This includes local-only artifacts that stay on the host: do not let a20raw diff preserve sensitive values just because the destination is not shared.2122Before recording one of these artifacts, redact or omit:2324- private IP addresses, hostnames, device identifiers, serial numbers, and25 other host-only facts;26- credential values, private keys, tokens, passwords, recovery codes, and27 credential hints that would make a secret easier to find or use;28- private local paths when the exact path is not needed for the review decision;29- any other local-only fact that is not necessary for the human reconciliation30 choice.3132When a diff or candidate file can be safely redacted, keep only the minimum33context needed to explain the conflict and use explicit placeholders such as34`[REDACTED_PRIVATE_HOST]` or `[REDACTED_SECRET]`. When safe redaction is35ambiguous, write a summary-only artifact instead: name the local file category,36state the human decision needed, and do not copy raw diff content.3738Do not require an agent signature on every stable wiki or durable-note page.39Use compact provenance only where it helps review or reconciliation, such as40generated review artifacts, append-only activity ledger entries, and41machine-readable reconciliation events. Useful fields include `agentId`,42`runId`, `model`, `reasoningLabel`, `policyVersion`, `sourceIssue`, and a43timestamp when those values are available and safe to record.4445## Memory Model4647Treat durable notes as a practical wiki crossed with an activity ledger:4849- Current state: fast orientation for active host, project, task, service, timer, and credential-metadata facts.50- Activity ledger: append-oriented historical memory for meaningful sessions, PRs, installs, incidents, validations, and decisions.51- Semantic wiki: curated project, runbook, decision, credential, state, and archive notes.52- Procedural memory: repeatable habits captured in runbooks and skills.53- Salience and preferences: durable user preferences, risk posture, and recurring cautions that should guide future work.5455Use this promotion flow:56571. Raw conversation or task context produces potentially durable facts.582. Meaningful historical context goes into a dated ledger entry or the relevant project note.593. Stable current facts update `tasks/TODO.md`, `state/CURRENT.md`, `state/HOST.md`, or a project page.604. Repeated procedures become runbooks or skills.615. Architectural or operational choices become decision records.626. Superseded information is marked historical or moved to `archive/`; useful history is not silently deleted.6364## Standard Layout6566Prefer this hierarchy under the user's home directory:6768```text69~/codex-notes/70 INDEX.md71 tasks/TODO.md72 state/HOST.md73 state/CURRENT.md74 ledger/README.md75 projects/76 runbooks/77 decisions/78 preferences/README.md79 credentials/NOTES.md80 archive/81```8283Keep root-level entry points for discoverability:8485- `~/AGENTS.md`: tells future sessions where the durable notes live.86- `~/CODEX_TODO.md`: compatibility pointer or lightweight mirror; the canonical durable task file is `~/codex-notes/tasks/TODO.md`.87- `~/REMOTE_ACCESS.md`: compatibility note for SSH/tmux access when present.8889## Start-Of-Session Read Path90911. Read `~/AGENTS.md` when present.922. Read `~/CODEX_TODO.md` when present for compatibility pointers and active durable tasks.933. Read `~/codex-notes/INDEX.md` if present; otherwise run the initializer.944. Follow the index to relevant `state/`, `projects/`, `runbooks/`, `decisions/`, `preferences/`, `credentials/`, and `ledger/` files.955. Use the ledger when narrative history matters or when current-state notes point to an earlier event.9697## Workflow98991. Choose the narrowest target:100 - Active/open work -> `tasks/TODO.md`101 - Fast orientation -> `state/CURRENT.md`102 - Host facts -> `state/HOST.md`103 - Historical sequence -> `ledger/YYYY-MM.md`104 - Stable project context -> `projects/<name>.md`105 - Repeatable procedures -> `runbooks/<topic>.md`106 - Decisions with rationale -> `decisions/YYYY-MM-DD-<slug>.md`107 - Preferences or risk posture -> `preferences/README.md` or `preferences/<topic>.md`108 - Credential metadata without secrets -> `credentials/NOTES.md`1092. Keep notes concise, dated, and actionable. Prefer bullets with concrete paths, commands, issue or PR IDs, service names, and next steps.1103. When current state changes, update the current-state note rather than burying the new fact only in a ledger entry.1114. When a note supersedes stale content, mark the old content as superseded or move it to `archive/`; do not silently delete useful history.1125. For root `~/CODEX_TODO.md`, keep either a pointer to the canonical task file or a deliberately short mirror. Avoid maintaining two competing task lists.113114## End-Of-Task Memory Check115116Before finishing substantial work, ask whether any of these changed:117118- current state, active tasks, project state, services, timers, or external integrations;119- a decision, rationale, procedure, runbook, or skill-worthy habit;120- a user preference, risk posture, or recurring caution;121- credential metadata, storage location, scope, owner, revocation, or rotation guidance;122- useful historical context worth preserving separately from current state.123124If yes, update the narrowest durable note and link related artifacts. Do not store secrets.125126## Searchability Rules127128- Use plain Markdown, predictable paths, concrete nouns, and searchable headings.129- Include dates, issue IDs, PR numbers, repo names, host names, service names, timer names, and command names when relevant.130- Link related notes, commits, PRs, issues, logs, and runbooks rather than duplicating long content.131- Keep current-state pages short enough for quick orientation; move long history to the ledger.132- Prefer monthly ledger files named `ledger/YYYY-MM.md` unless the host has an established dated convention.133134## Initializer135136Run the script before first use on a host:137138```bash139python3 ~/.codex/skills/manage-durable-notes/scripts/init_durable_notes.py140```141142For a dry run:143144```bash145python3 ~/.codex/skills/manage-durable-notes/scripts/init_durable_notes.py --dry-run146```147148The initializer creates the hierarchy, preserves existing root notes, and adds pointers so future sessions can find the standard location.