name: wm description: Working memory. "$wm dive" to prep sessions, "$wm compile" for context, "$wm distill" to extract learnings.
wm - Working Memory for AI Sessions
Captures tacit knowledge from sessions and provides relevant context for current work.
All commands invoke the wm CLI. If wm is not installed, show:
wm not installed. Install with:
brew tap open-horizon-labs/homebrew-tap && brew install wm
# or: cargo install working-memory
$wm compile
Get relevant context for current work. Synthesizes knowledge from past sessions.
wm compile
$wm distill
Extract learnings from completed work sessions.
wm distill
$wm init
Initialize working memory for this project.
wm init
$wm show state
Display the accumulated knowledge state.
wm show state
$wm show sessions
List recent work sessions.
wm show sessions
$wm dive save
Save current dive context as a named prep.
wm dive save <name>
$wm dive list
List all saved dive preps.
wm dive list
$wm dive switch
Switch to a named dive prep.
wm dive switch <name>
$wm dive show
Show current dive prep content.
wm dive show
Codex-Native Features
These features leverage Codex-specific capabilities.
$wm dive [intent]
Start every session with a dive. This is an agent flow, not a single CLI command.
Intent options:
fix- Bug fix sessionplan- Design/architecture workexplore- Understanding codeship- Getting changes mergedreview- Reflect on recent work
Dive Prep Flow
Step 1: If intent not provided, ask user:
What's your intent for this session?
[ ] fix - Fix a bug or issue
[ ] plan - Design an approach
[ ] explore - Understand something
[ ] ship - Get something deployed
Step 2: Gather context from available sources:
git status
git log --oneline -5
cat AGENTS.md 2>/dev/null || cat CLAUDE.md 2>/dev/null
wm compile
Step 3: Build and write the dive manifest:
Create .wm/dive_context.md with:
# Dive Session
**Intent:** [intent]
**Started:** [timestamp]
## Context
[Project instructions, git state, relevant knowledge]
## Focus
[What we're working on]
## Workflow
[Steps for this intent type]
Step 4: Confirm to user:
Dive session prepared
Intent: [intent]
Context: .wm/dive_context.md
Ready to work.
No dive is too small. Even a quick bug fix benefits from 30 seconds of explicit intent.
$wm compile --search
Augment working memory with fresh web results (uses Codex web search).
Steps:
- Run
wm compileto get accumulated knowledge - Use Codex web search for fresh documentation on
<query> - Combine both into comprehensive context
$wm codex-sessions
Analyze recent Codex sessions for knowledge extraction.
Steps:
- Find recent sessions in
~/.codex/sessions/ - Extract key decisions and learnings
- Feed to
wm distill
$wm resume-context
Get context for resuming a previous Codex session. Integrates with codex resume.
Dive Terminology
- dive-prep = the action of preparing context before work
- dive pack = a reusable bundle of context for a type of work
- dive context = the session-specific manifest created by dive-prep
Workflow Integration
- Before work:
$wm dive <intent>- prep context - During work:
$wm compile- get relevant knowledge as needed - At decision points:
$sg review- metacognitive review - After work:
$wm distill- capture learnings
Protocol: Treat wm as your external memory. Don't guess at past decisions - check wm first.