skills/memories-cli/SKILL.md
CLI reference and workflows for memories.sh — the persistent memory layer for AI agents. Use when: (1) Running memories CLI commands to add, search, edit, or manage memories, (2) Managing lifecycle workflows (session/checkpoint/compaction/consolidation/OpenClaw memory files), (3) Setting up memories.sh in a new project (memories init), (4) Generating AI tool config files (CLAUDE.md, .cursor/rules, etc.), (5) Importing existing rules from AI tools (memories ingest), (6) Managing cloud sync, embeddings, git hooks, or reminders, (7) Troubleshooting with memories doctor, (8) Working with memory templates, links, history, tags, or reminder schedules.
npx skillsauth add webrenew/memories memories-cliInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
CLI reference for @memories.sh/cli — manage memories, generate configs, and sync across tools.
The CLI is the primary way to interact with memories.sh. Use it to store memories, generate native config files, and manage your memory store. For environments where the CLI isn't available (v0, bolt.new, Lovable, or other browser-based agents), use the MCP server as a fallback.
npm install -g @memories.sh/cli # or: npx @memories.sh/cli
memories init # Initialize in current project
memories init auto-detects AI tools (Claude Code, Cursor, Windsurf, VS Code) and configures MCP + generates instruction files.
| Command | Purpose |
|---------|---------|
| memories add <content> | Store a memory |
| memories recall | Context-aware memories for current project |
| memories search <query> | Full-text search |
| memories list | List memories with filters |
| memories edit <id> | Edit content, type, or tags |
| memories forget <id> | Soft-delete a memory |
| memories generate | Generate AI tool config files |
| memories prompt | Generate a system prompt |
| memories serve | Start MCP server |
| memories session <subcommand> | Manage explicit sessions (start, checkpoint, status, end, snapshot) |
| memories compact run | Run inactivity compaction worker |
| memories consolidate run | Merge duplicates and supersede stale truths |
| memories openclaw memory <subcommand> | OpenClaw file-mode workflows (bootstrap, flush, snapshot, sync) |
| memories reminders | Manage cron reminders (add, list, run, enable, disable, delete) |
cd my-project
memories init # Detect tools, configure MCP, generate files
memories add "Use pnpm" --type rule
memories add "Chose Supabase for auth" --type decision
memories generate # Update all AI tool configs
memories ingest claude # Import from CLAUDE.md
memories ingest cursor # Import from .cursorrules / .cursor/rules/
memories ingest copilot # Import from copilot-instructions.md
memories search "auth" # Full-text search
memories search "auth" --semantic # Vector similarity (requires embeddings)
memories recall # Context for current project
memories list --type rule # Filter by type
memories list --tags api,auth # Filter by tags
memories generate # All detected tools
memories generate claude # Only CLAUDE.md
memories generate cursor # Only .cursor/rules/memories.mdc
memories diff # Preview changes before generating
Supported targets: claude, cursor, copilot, windsurf, cline, roo, gemini
memories login # Device code auth flow
memories sync # Sync local DB to cloud
memories files ingest # Upload config files
memories files apply --global --force # Restore configs on new machine
memories embed # Generate embeddings for all memories
memories embed --dry-run # Preview what would be embedded
memories config model <model-name> # Change embedding model
memories doctor # Diagnose issues
memories stats # Memory statistics
memories stale --days 90 --conflicts-only # Find stale conflicting memories
memories review --superseded-only # Interactive superseded cleanup
memories validate # Check memory integrity
# Start session
memories session start --title "checkout timeout triage" --client codex
# Add checkpoints as work progresses
memories session checkpoint <session-id> "Root cause narrowed to auth callback timeout" --kind summary
# Run inactivity compaction worker (batch job)
memories compact run --inactivity-minutes 60 --limit 25
# End session and optionally snapshot
memories session end <session-id> --status closed
memories session snapshot <session-id> --trigger manual
# Preview consolidation impact first
memories consolidate run --types rule,decision,fact --dry-run
# Apply consolidation
memories consolidate run --types rule,decision,fact
# OpenClaw memory file workflows
memories openclaw memory bootstrap
memories openclaw memory flush <session-id>
memories openclaw memory snapshot <session-id> --trigger reset
memories openclaw memory sync --direction both
memories reminders add "0 9 * * 1-5" "Review open TODOs"
memories reminders list
memories reminders run
Use --type flag with add:
memories add "Always use strict mode" --type rulememories add "Chose JWT for auth" --type decisionmemories add "Rate limit: 100/min" --type factmemories add "Refactor auth module"memories add "Use TypeScript" --type rule --globalWhen using MCP instead of CLI commands (for example from browser tools or agents running outside the repo), use add_memory with project_id to force project scope.
memories add --template decision — structured prompts for common patternsmemories link <id1> <id2> --type supports — relate memoriesmemories history <id> / memories revert <id> --to <version>memories tag <id> add api,authmemories export > backup.yaml / memories import backup.yamlmemories hook install — auto-generate on commitmemories reminders ... — cron-style prompts persisted in the local DBtools
OpenClaw integration workflows for memories.sh. Use when: (1) Setting up OpenClaw with memories.sh (`openclaw onboard`, `memories init`), (2) Syncing OpenClaw workspace contracts (`~/.openclaw/workspace/AGENTS.md`, `SOUL.md`, `TOOLS.md`, `IDENTITY.md`, `USER.md`, `HEARTBEAT.md`, `BOOTSTRAP.md`, memory files, and skills), (3) Running lifecycle memory file workflows via `memories openclaw memory bootstrap|flush|snapshot|sync`, (4) Scheduling reminder prompts for OpenClaw refresh via `memories reminders`, (5) Troubleshooting OpenClaw workspace drift, missing skills, or path/config mismatches, (6) Updating OpenClaw runbooks or `llms.txt` guidance.
tools
Build against the memories.sh SDK packages in application code. Use when working with `@memories.sh/core` or `@memories.sh/ai-sdk`, including: (1) Initializing `MemoriesClient`, (2) Reading, writing, searching, or editing memories from backend code, route handlers, workers, or scripts, (3) Integrating memories with the Vercel AI SDK via `memoriesMiddleware`, `memoriesTools`, `preloadContext`, or `createMemoriesOnFinish`, (4) Choosing and applying `tenantId` / `userId` / `projectId` scoping, (5) Managing SDK skill files or management APIs, or (6) Debugging memories SDK usage in TypeScript or JavaScript applications. Use `memories-cli` for CLI workflows, `memories-mcp` for MCP setup, and `memories-dev` for monorepo internals.
tools
MCP server integration for memories.sh — the persistent memory layer for AI agents. Use when: (1) Configuring the memories.sh MCP server for any client (Claude Code, Cursor, Windsurf, VS Code, v0, Claude Desktop, OpenCode, Factory), (2) Using MCP tools to store, search, retrieve memories, run lifecycle session workflows, or manage reminders, (3) Understanding get_context vs search_memories vs list_memories, (4) Working with streaming memory tools for SSE content, (5) Troubleshooting MCP connection issues, (6) Choosing between cloud MCP (HTTP) and local MCP (stdio) transports.
tools
Developer guide for contributing to and extending the memories.sh codebase. Use when: (1) Understanding the memories.sh architecture and lifecycle model, (2) Adding new CLI commands or MCP tools, (3) Modifying the memory storage layer (SQLite/libSQL), (4) Working on the web dashboard (Next.js/Supabase), (5) Adding new generation targets for AI tools, (6) Extending cloud sync, session compaction, or embeddings functionality, (7) Debugging build, test, or deployment issues in the monorepo.