Working memory - surfaces relevant context based on user intent

version
0.3.1
GitHub stars
5

Install

/plugin install wm@wm

Run it inside Claude Code after adding the marketplace with /plugin marketplace add open-horizon-labs/wm.

Contents

Discovered from source

Skills 1

Dive Prep

Prepare working memory context for a focused session by gathering context from multiple sources.

Invocation

/wm:dive-prep [intent or context]

Execution

DO NOT run any bash command. This skill requires an AI agent.

Use the Task tool to spawn the wm:dive-prep agent:

Task(subagent_type: "wm:dive-prep", prompt: "<user's intent or context>")

If the user provides a GitHub issue URL, include it in the prompt:

Task(subagent_type: "wm:dive-prep", prompt: "Prepare dive for https://github.com/org/repo/issues/123")

What the Agent Does

  1. Detect OH connection and suggest linking endeavors
  2. Gather local context (CLAUDE.md, git state, etc.)
  3. Fetch OH context if available
  4. Write .wm/dive_context.md with curated grounding

Output

Pass through the agent's output to the user. The dive context will be saved to .wm/dive_context.md.

Example

User: /wm:dive-prep fix the auth bug in the login flow

Action: Task(subagent_type: "wm:dive-prep", prompt: "fix the auth bug in the login flow")

Commands 6

/wm:compress

Compress and synthesize working memory state.

Usage

/wm:compress

Execution

Run the wm compress command:

wm compress

Pass through the output. This abstracts accumulated knowledge to higher-level patterns, reducing size while preserving critical insights.

/wm:distill

Extract tacit knowledge from recent work into working memory.

Usage

/wm:distill

Execution

Run the wm distill command:

wm distill

Pass through the output. This extracts learnings from recent sessions and adds them to .wm/state.md.

/wm:dive-prep

Prepare working memory context for a focused session.

Usage

/wm:dive-prep [intent or context]

Execution

This command uses the wm:dive-prep Task agent to gather context from multiple sources and write .wm/dive_context.md.

Do NOT run a CLI command. Instead, invoke the Task tool:

Task(subagent_type: "wm:dive-prep", prompt: "<user's intent or context>")

If the user provides a GitHub issue URL, include it in the prompt:

Task(subagent_type: "wm:dive-prep", prompt: "Prepare dive for https://github.com/org/repo/issues/123")

The agent will:

  1. Detect OH connection and suggest linking endeavors
  2. Gather local context (CLAUDE.md, git state, etc.)
  3. Fetch OH context if available
  4. Write .wm/dive_context.md with curated grounding

Pass through the agent's output to the user.

/wm:init

Initialize working memory in the current project.

Usage

/wm:init

Execution

  1. Check if wm binary exists:

    command -v wm
    
  2. If wm not found, tell the user to install it:

    The wm CLI is not installed.
    
    Install with Homebrew:
      brew install open-horizon-labs/homebrew-tap/wm
    
    Or with Cargo:
      cargo install working-memory
    
    Then run this command again.
    
  3. If wm exists, run:

    wm init
    

    This creates .wm/ directory with initial state.

/wm:pause

Pause wm operations (extract, compile, or both).

Usage

/wm:pause [extract|compile]

Execution

Run the wm pause command:

wm pause              # Pause both extract and compile
wm pause extract      # Pause only extract
wm pause compile      # Pause only compile

To resume operations later:

wm resume             # Resume both
wm resume extract     # Resume only extract
wm resume compile     # Resume only compile

Check current status with:

wm status

Pass through the output to the user.

/wm:review

Review current working memory state and context.

Usage

/wm:review [state|working|sessions]

Execution

Use the wm show command to display working memory contents:

wm show state      # Show .wm/state.md
wm show working    # Show compiled working set
wm show sessions   # List available sessions

Without arguments, show the state:

wm show

For a comprehensive review, you can also:

  1. Show distilled knowledge: cat .wm/distill/guardrails.md .wm/distill/metis.md
  2. Show dive context: cat .wm/dive_context.md

Pass through the output to the user.

Agents 5

Compress Knowledge

Synthesize accumulated knowledge in state.md to higher-level abstractions, reducing size while preserving critical insights.

Platform Support:

  • ✅ Claude Code - Full support
  • ✅ Codex - Full support (platform-independent)

When to Use

  • State.md is growing unwieldy — Too many specific items, hard to navigate
  • After distillation — Batch extraction added many items that need synthesis
  • Periodic maintenance — Every few weeks/months as knowledge accumulates
  • Before sharing — Clean up state before committing to repo or sharing with team

What It Does

  1. Reads state.md — Analyzes all accumulated knowledge
  2. Identifies patterns — Finds related items that can be merged
  3. Abstracts specifics — Converts concrete instances into general principles
  4. Removes obsolete items — Discards superseded or no-longer-relevant knowledge
  5. Preserves critical constraints — Keeps important guardrails and preferences
  6. Creates backup — Saves original to .wm/state.md.backup before modifying

Usage

# Compress state.md
wm compress

# Example output:
# Compressed: 42 → 18 lines (57% reduction)
# Backup saved to .wm/state.md.backup

Compression Strategies

The LLM applies these strategies when compressing:

1. Merge Related Items

Before:

- Prefer `Result<T, E>` for recoverable errors in Rust
- Use `Option<T>` for nullable values in Rust
- Return early with `?` operator in Rust

After:

- Rust error handling: Use `Result<T, E>` for recoverable errors, `Option<T>` for nullables, early return with `?` operator

2. Abstract to Principles

Before:

- Don't use `unwrap()` in production code
- Don't use `expect()` without clear reason
- Don't ignore error cases

After:

- Error handling principle: Always handle errors explicitly; never panic in production

3. Remove Obsolete

Before:

- Use old API version 1.x (deprecated)
- Migrate to API version 2.x (in progress)
- API 3.x is now stable and preferred

After:

- Use API version 3.x (current stable)

4. Preserve Critical Constraints

These are NEVER compressed away:

  • Security constraints (e.g., "never log passwords")
  • Architecture decisions (e.g., "use event sourcing for audit trail")
  • User preferences (e.g., "prefer functional style over OOP")

Integration with Distill

Compress works well after distillation:

# 1. Batch extract from all sessions
wm distill

# 2. Review raw extractions
cat .wm/distill/raw_extractions.md

# 3. Compress both raw extractions and state.md
wm compress

# Result: synthesized knowledge in state.md

Recovery

If compression removes something important:

# Restore from backup
cp .wm/state.md.backup .wm/state.md

# Or manually cherry-pick from backup
cat .wm/state.md.backup  # Review what was removed

Backups are timestamped, so multiple compressions create multiple backups.

Best Practices

  • Review after compression: Check that critical knowledge wasn't lost
  • Run periodically: Don't wait until state.md is massive (harder to compress effectively)
  • Manual curation first: Remove obviously obsolete items manually before compressing
  • Backup awareness: Know that .wm/state.md.backup exists for recovery

When NOT to Use

  • State.md is small — No need to compress if it's under ~30-40 lines
  • Just started wm — Let knowledge accumulate first before compressing
  • Uncertain about contents — Review state.md manually before running automated compression

Distill Knowledge

Extract tacit knowledge from all sessions at once, instead of relying on per-turn extraction.

Platform Support:

  • ✅ Claude Code - Full support (auto-discovers sessions)
  • ⚠️ Codex - Manual mode only (requires explicit transcript paths)

In Codex, you'll need to provide transcript paths manually since auto-discovery isn't yet implemented.

When to Use

  • Project onboarding: Extract knowledge from existing sessions when first setting up wm
  • Catchup after pause: Process sessions that weren't extracted due to pause or missing hooks
  • Audit existing knowledge: Review what patterns exist across all past work
  • Migration: Moving from another system and want to bootstrap knowledge

What It Does

In Claude Code:

  1. Discovers sessions — Finds all transcripts in ~/.claude/projects/<project>/
  2. Extracts incrementally — Uses cache to only process new/changed sessions
  3. Accumulates knowledge — Writes raw extractions to .wm/distill/raw_extractions.md
  4. Preserves existing state — Doesn't overwrite .wm/state.md automatically

In Codex (manual mode):

  1. Guide user to find transcripts in ~/.codex/sessions/YYYY/MM/DD/
  2. Extract from specific transcript: wm extract --transcript <path>
  3. Repeat for multiple sessions
  4. Review .wm/distill/raw_extractions.md

Usage

Claude Code (automatic):

# Standard distillation (process new/changed sessions only)
wm distill

# Preview what would be processed
wm distill --dry-run

# Re-extract everything (ignores cache)
wm distill --force

Codex (manual):

# Find transcripts
ls ~/.codex/sessions/2026/01/*/rollout-*.jsonl

# Extract from specific sessions
wm extract --transcript ~/.codex/sessions/2026/01/06/rollout-2026-01-06T10-30-00-<uuid>.jsonl
wm extract --transcript ~/.codex/sessions/2026/01/05/rollout-2026-01-05T14-15-00-<uuid>.jsonl

# Review accumulated extractions
cat .wm/state.md

Output Structure

.wm/distill/
├── raw_extractions.md    # All extracted knowledge (chronological)
├── cache.json            # Extraction cache (session ID → last processed)
└── errors.log            # Any extraction failures

After Distillation

Review the raw extractions and decide what to do:

  1. Review raw_extractions.md — See what knowledge was found
  2. Curate to state.md — Manually copy relevant items to .wm/state.md, or run wm compress to auto-synthesize
  3. Compress if needed — If state.md grows large, run wm compress to synthesize to higher abstractions

Integration Notes

  • Complementary to per-turn extraction: Distill catches what hooks missed, but hooks are still the primary mechanism
  • Idempotent: Running multiple times is safe (uses cache)
  • Session isolation: Each session's extraction is independent

Example Workflow

# 1. Initialize wm in existing project
cd /your/project
wm init

# 2. Run distillation
wm distill

# 3. Review what was found
cat .wm/distill/raw_extractions.md

# 4. Check if anything worth adding to state
wm show state

# 5. If raw extractions have value, manually curate or compress
# Manual: copy relevant items from raw_extractions.md → state.md
# Auto: wm compress (synthesizes both files)

When NOT to Use

  • Active sessions: Distill is for batch processing, not real-time extraction
  • Every session: Only run when you need catchup or audit—not after every conversation
  • As primary mechanism: Hooks provide better per-turn extraction; distill is backup/catchup

Dive Prep

Compile a session grounding manifest from available context sources, keyed by intent.

Platform Support:

  • ✅ Claude Code - Full support
  • ✅ Codex - Full support (platform-independent context gathering)

Named Dive Preps

WM supports multiple named dive preps (like git branches). Use the CLI to manage them:

wm dive list              # List all preps (* marks current)
wm dive new <name>        # Create new prep
wm dive switch <name>     # Switch to a prep
wm dive delete <name>     # Delete a prep
wm dive save <name>       # Save current dive_context.md as named prep
wm dive current           # Show current prep name
wm dive show [name]       # Show prep content

When /dive-prep creates a manifest, you can save it as a named prep:

  1. Run /dive-prep to generate context
  2. Run wm dive save my-feature to save and activate it

Named preps are stored in .wm/dives/{name}.md and the current prep is tracked in config.toml.

Invocation

/dive-prep [--intent <type>] [options]

Intent types: fix, plan, review, explore, ship (default: explore)

Options:

  • --oh <endeavor-id> - Include Open Horizons context for this endeavor
  • --issue <id> - Include issue/ticket context (GitHub, Linear, etc.)
  • --files <glob> - Include specific files as context
  • --no-local - Skip local context detection

Context Sources

A dive can pull grounding context from multiple sources:

SourceWhat it providesWhen used
LocalCLAUDE.md, .superego/, cwd structureAlways (auto-detected)
GitBranch, recent commits, changed filesAlways (auto-detected)
OHEndeavors, guardrails, metis, mission contextPreferred when connected
IssueTicket details, acceptance criteriaIf --issue provided
FilesSpecific code/docs for focusIf --files provided

OH is the preferred source when available because it's purpose-built for strategic alignment. It provides the "why" (mission context), the "don't" (guardrails), and the "learned" (metis) that local context alone can't provide.

Flow

Step 0: Detect OH Connection

Check if OH MCP is available by testing oh_get_contexts:

  • If connected: OH becomes the preferred context source
  • If not connected: Continue with local-only flow

When OH is available but no --oh flag provided, prompt:

OH connected. Link to an endeavor for strategic context?
[Select endeavor] [Skip - local only]

This encourages OH usage when available since it's purpose-built for strategic alignment.

Step 1: Determine Intent

If not provided via --intent, ask:

What's your intent for this session?
[ ] fix - Fix a bug or issue
[ ] plan - Design an approach
[ ] review - Reflect on recent work
[ ] explore - Understand something
[ ] ship - Get something deployed

Step 2: Gather Local Context

Always gather from current directory:

  1. CLAUDE.md - Project instructions and patterns
  2. .superego/ - Metacognitive config if present
  3. Git state - Current branch, uncommitted changes, recent commits
  4. Directory structure - Top-level layout for orientation

Step 3: Identify Related Implementations

Purpose: Surface existing code that could be leveraged or adapted, and identify existing duplication worth cleaning up.

Based on the user's intent, search the codebase for:

  1. Directly related code - Files, functions, and data structures that will be touched or extended
  2. Indirectly related code - Similar patterns, analogous implementations, and related schemas that could be reused
  3. Existing duplication - Code that already does the same thing in multiple places (cleanup opportunity)

Search strategy:

  • Grep for keywords from the intent/issue description
  • Find similar-named functions, structs, and modules
  • Look for existing implementations of related concepts
  • Check for utility functions that might already solve part of the problem
  • Identify data structures that could be extended vs duplicated
  • Search for parallel implementations (e.g., foo_claude() and foo_codex() doing the same thing)
  • Look for structurally similar code in different modules

Output for each finding:

Reusable: src/transcript/reader.rs
  - read_transcript() - JSONL parsing with error handling
  - Could adapt for: new file format parsing

Duplication: src/session.rs + src/codex/session.rs
  - system_time_to_datetime() - identical helper in both files
  - Opportunity: extract to shared module

Key questions to answer:

  • "What existing code does the same or similar thing?" (reuse opportunity)
  • "What code is already duplicated that we'd be adding to?" (cleanup opportunity)

This step helps catch "why have one function when you can have three" situations before they happen, and surfaces existing duplication worth consolidating.

Step 4: Gather Optional Sources

If OH connected and --oh provided:

oh_suggest_dive_pack({
  endeavor_id: "<endeavor-id>",
  intent_type: "<intent>"
})

Returns: mission context, guardrails, metis, related endeavors

If --issue provided:

  • Fetch issue details from configured tracker
  • Extract: title, description, acceptance criteria, labels

If --files provided:

  • Read specified files
  • Summarize key sections for context

Step 5: Present for Curation

Show gathered context, let user confirm in <30s:

Dive Context Summary
====================

Intent: fix

Local:
  ✓ CLAUDE.md (project instructions)
  ✓ .superego/ (metacognitive config)
  ✓ Branch: feature/dive-packs (3 uncommitted files)

OH Context (optional):
  ✓ Endeavor: Dive Prep feature
  ✓ Mission: Open Horizons System
  ✓ Guardrails: 2 active
  [ ] Include metis: "Contracts prevent drift"
  [ ] Include sibling: MetisCandidate capture

Workflow: fix-workflow
  Stage → sg review → handle findings → commit → PR

[Accept] [Edit] [Cancel]

Step 6: Build Workflow

Based on intent, include appropriate workflow:

fix:

1. Understand the issue
2. Write failing test (if applicable)
3. Implement fix
4. Stage changes
5. Run `sg review` - handle findings (P1-P3 fix, P4 discard)
6. Commit with clear message
7. PR → CodeRabbit review → iterate
8. Done when PR approved

plan:

1. Review available context (local docs, OH mission if available)
2. Identify options and trade-offs
3. Draft plan with concrete steps (no time estimates)
4. Surface risks and dependencies
5. Document decision rationale
6. Log findings (to OH if connected, else local)

review:

1. Gather recent work artifacts (commits, logs)
2. Identify patterns, learnings, surprises
3. Surface insights worth capturing
4. Document review findings

explore:

1. Understand the problem space
2. Read relevant code/docs
3. Ask clarifying questions
4. Document findings
5. Identify next steps or blockers

ship:

1. Verify all tests pass
2. Check constraints and guardrails
3. Review changes for completeness
4. Create PR with full context
5. Address review feedback
6. Deploy when approved

Step 7: Write Session Manifest

Write .wm/dive_context.md with curated grounding:

# Dive Session

**Intent:** fix
**Started:** 2026-01-03T10:30:00Z

## Context

### Project
[From CLAUDE.md - key instructions]

### Focus
[What we're working on - from OH endeavor, issue, or user input]

### Constraints
[From OH guardrails, .superego/, or user input]

### Relevant Knowledge
[From OH metis, or key patterns noted]

### Related Implementations
[Existing code that could be leveraged or adapted - from Step 3]

**Reusable:**
- `path/to/file.rs` - description of what it does and how it relates
- Pattern: [existing pattern that could be reused]

**Existing Duplication** (cleanup opportunity):
- `file_a.rs` + `file_b.rs` - [what's duplicated and why it matters]

## Workflow
[Selected workflow steps]

## Sources
- Local: CLAUDE.md, .superego/
- Git: feature/dive-packs branch
- OH: endeavor bd9d6ace (if connected)

Step 8: Confirm

✓ Dive session prepared

Context loaded to .wm/dive_context.md
Intent: fix
Workflow: fix-workflow

Ready to work. Start with: [first workflow step]

Without OH

If OH is not configured:

  1. Ask: "What are you working on?" (free text)
  2. Ask: "What's your intent?" (if not provided)
  3. Ask: "Any constraints to keep in mind?"
  4. Build manifest from local context + user answers
  5. Write .wm/dive_context.md
  6. Suggest OH setup: "For richer strategic context (missions, guardrails, learnings), set up Open Horizons: claude mcp add oh-mcp -- npx -y @cloud-atlas-ai/oh-mcp-server"

This still provides value: explicit intent, workflow guidance, and documented constraints. But OH adds the strategic layer that makes dives more grounded.

Exit Conditions

  • Success: Manifest written, user sees confirmation
  • Cancel: User cancels, no changes
  • Error: Report issue, suggest manual context setup

Examples

With OH context:

$ /dive-prep --intent fix --oh bd9d6ace

Gathering context...
  ✓ Local: CLAUDE.md, .superego/
  ✓ Git: feature/dive-packs (3 uncommitted)
  ✓ OH: Dive Prep feature → Open Horizons System

[Shows curation UI]

✓ Dive session prepared
  .wm/dive_context.md written
  Intent: fix
  Ready to work.

Local only:

$ /dive-prep --intent explore

Gathering context...
  ✓ Local: CLAUDE.md
  ✓ Git: main (clean)

What are you exploring?
> How the authentication flow works

✓ Dive session prepared
  .wm/dive_context.md written
  Intent: explore
  Focus: How the authentication flow works

With issue:

$ /dive-prep --intent fix --issue GH-123

Gathering context...
  ✓ Local: CLAUDE.md
  ✓ Git: fix/auth-bug
  ✓ Issue: GH-123 "Login fails with special characters"

✓ Dive session prepared
  Intent: fix
  Focus: Login fails with special characters (GH-123)

Pause and Resume

Temporarily disable wm operations without uninstalling or removing configuration.

Platform Support:

  • ✅ Claude Code - Full support (hooks respect pause state)
  • ✅ Codex - Full support (manual extractions respect pause state)

When to Use

Pause Extract

  • Sensitive work: Working on confidential code that shouldn't be extracted
  • Personal debugging: Troubleshooting without knowledge capture
  • Temporary privacy: Preventing certain conversations from being recorded

Pause Compile

  • Simple tasks: Skip context injection for trivial work (faster, lower cost)
  • Testing isolation: Want to work without historical context
  • Debugging wm: Isolate issues by disabling injection

Pause Both

  • Extended break: Disabling wm entirely for a period
  • Project handoff: Pausing before transferring to someone else
  • Performance testing: Measuring impact of wm on session speed/cost

Usage

# Pause both operations
wm pause

# Pause only extraction
wm pause extract

# Pause only compilation
wm pause compile

# Resume both operations
wm resume

# Resume only extraction
wm resume extract

# Resume only compilation
wm resume compile

# Check current status
wm status

How It Works

Pause/resume modifies .wm/pause_state.json:

{
  "extract_paused": false,
  "compile_paused": false
}

Hook behavior when paused:

  • Extract paused: Stop hook gracefully exits without extraction
  • Compile paused: UserPromptSubmit hook returns empty context

No configuration files are modified. No data is lost. Just a flag.

Status Check

wm status

Active (normal):

Working Memory Status
=====================

Extract:  active
Compile:  active

All operations running normally.

Paused:

Working Memory Status
=====================

Extract:  PAUSED
Compile:  active

Extract is paused. Run 'wm resume extract' to re-enable.

Common Scenarios

Scenario 1: Sensitive Code Review

# Working on security-critical code
wm pause extract

# Work on sensitive changes
# ... conversation happens ...

# Done with sensitive work
wm resume extract

Scenario 2: Quick Fix Without Context

# Need fast fix, don't need historical context
wm pause compile

# Make quick change
# ... conversation is faster, no context injected ...

# Resume normal operation
wm resume compile

Scenario 3: Complete Pause

# Taking break from project
wm pause

# ... time passes ...

# Resuming project work
wm resume

Integration with Other Operations

Pause + Distill

If you paused extract for a while and missed knowledge capture:

# Check status
wm status
# Extract: PAUSED (for last 2 weeks)

# Resume
wm resume extract

# Catch up with batch extraction
wm distill

Pause + Dive Prep

Dive prep works even if compile is paused:

# Compile is paused
wm status
# Compile: PAUSED

# Dive prep still gathers context
/dive-prep --intent fix

# Creates .wm/dive_context.md (independent of pause state)

State Persistence

Pause state persists across:

  • Sessions (stays paused in new Claude Code sessions)
  • Restarts (survives Claude Code restart)
  • Directory changes (tied to project .wm/ directory)

To fully reset:

rm .wm/pause_state.json
# Operations resume automatically

Best Practices

  • Default to active: Only pause when you have a specific reason
  • Resume after sensitive work: Don't forget to resume when done
  • Check status regularly: Run wm status if unsure
  • Document reasons: If pausing long-term, note why (in .wm/README or similar)

Agent Usage

As an agent, you might invoke pause/resume when:

  • User mentions working on sensitive/confidential code → suggest wm pause extract
  • User asks for faster responses on trivial task → suggest wm pause compile
  • User is debugging wm behavior → suggest isolating with pause
  • User finished sensitive work → remind to wm resume

Example dialogue:

User: "I need to work on some confidential API keys, don't want this captured"

Agent: "I'll pause wm extraction so this session isn't recorded."

wm pause extract

[... work on sensitive code ...]

Agent: "Done with the confidential work. Resuming wm extraction."

wm resume extract

Review Working Memory

Understand what knowledge wm has captured and what context is currently active.

Platform Support:

  • ✅ Claude Code - Full support (session discovery works)
  • ✅ Codex - Partial support (state/working set work, session listing limited)

When to Use

  • Session start — Review what patterns and constraints wm knows about this project
  • Before major changes — Check if existing knowledge suggests an approach
  • Debugging unexpected behavior — See if wm is injecting context that's affecting decisions
  • After distillation — Verify what knowledge was extracted
  • Planning work — Understand project patterns before designing solution

What to Review

1. Current State (wm show state)

View all accumulated tacit knowledge:

wm show state

What you'll see:

  • Rationale behind past decisions
  • Constraints discovered through work
  • Preferences revealed by corrections
  • Patterns followed in this project
  • Paths rejected and why

This is the "long-term memory" — knowledge accumulated across all sessions.

2. Active Context (wm show working)

View what context was last injected:

wm show working                      # Global working set
wm show working --session-id <id>   # Session-specific working set

What you'll see:

  • Filtered subset of state.md relevant to last intent
  • What context Claude received on last turn
  • Useful for debugging: "Why is Claude suggesting X?"

This is the "short-term memory" — what's active in current context.

3. All Sessions (wm show sessions)

Claude Code only:

List all sessions for this project:

wm show sessions

What you'll see:

  • Session IDs and timestamps
  • Transcript locations
  • Useful for running distillation or reviewing history

Note: In Codex, session listing requires manual discovery:

ls ~/.codex/sessions/2026/01/*/rollout-*.jsonl

4. Dive Context (wm dive show)

View current dive session context (if active):

wm dive show

What you'll see:

  • Intent (fix, plan, explore, review, ship)
  • Focus (what specifically you're working on)
  • Constraints from guardrails or .superego/
  • Workflow steps for this intent
  • Context sources (local, git, OH, etc.)

Example Workflow

# Starting new work - review what wm knows
wm show state

# Output shows:
# - "Prefer functional composition over inheritance"
# - "API calls require retry logic (flaky network)"
# - "Use snake_case for file names in this project"

# Now you understand the project patterns before coding

Integration with Other Commands

Review → Distill

# Check current state
wm show state

# Seems sparse - run distillation
wm distill

# Review again
wm show state

Review → Compress

# Check state size
wm show state | wc -l
# Output: 87 lines

# Too large - compress
wm compress

# Review result
wm show state | wc -l
# Output: 34 lines

Review → Dive Prep

# Review project knowledge
wm show state

# Now prepare focused dive with that context in mind
/dive-prep --intent fix

Understanding State vs Working Set

State.md (Long-term Memory):

  • All accumulated knowledge
  • May contain items not relevant to current task
  • Read with: wm show state

Working Set (Short-term Memory):

  • Filtered for current intent
  • Only relevant items injected to Claude
  • Read with: wm show working

Example:

If state.md contains:

- Prefer functional style over OOP
- API calls need retry logic
- Use PostgreSQL for persistence
- Frontend uses React hooks pattern

And your intent is "implement API retry logic", then working_set.md might contain:

- API calls need retry logic
- Prefer functional style over OOP

The PostgreSQL and React items weren't relevant to the intent, so they weren't injected.

Pause Status

Check if wm operations are paused:

wm status

Output:

Working Memory Status
=====================

Extract:  active
Compile:  active

All operations running normally.

Or if paused:

Extract:  PAUSED
Compile:  active

Extract is paused. Run 'wm resume extract' to re-enable.

When to Use Each Command

CommandWhen to Use
wm show stateUnderstand accumulated project knowledge
wm show workingDebug what context was injected
wm show sessionsFind sessions for distillation or audit
wm dive showReview current dive context
wm statusCheck if operations are paused

Agent Usage

As an agent, invoke this skill when you need to:

  • Understand project patterns before suggesting approach
  • Debug why certain context is appearing
  • Verify knowledge was captured after distillation
  • Check if dive context is active

Sponsors

Details

Marketplace
open-horizon-labs/wm
Source
plugin
Author
Cloud Atlas AI
Category
Community