memories ingest
Import memories from existing IDE rule files.
memories ingest [source] [options]Scan existing IDE rule files and extract memories from them. This is the fastest way to migrate an existing setup to memories.sh. Supports both flat file ingestion and structured directory-based ingestion with full metadata extraction.
Arguments
| Argument | Description |
|---|---|
source | Source name or file path (see sources below) |
Sources
Flat-file sources
| Source | Scanned Path | Description |
|---|---|---|
cursor | .cursorrules, .cursor/rules/memories.mdc | Cursor rules (legacy + current) |
claude | CLAUDE.md | Claude Code instructions |
agents | AGENTS.md | Multi-tool agents file |
copilot | .github/copilot-instructions.md | GitHub Copilot |
windsurf | .windsurfrules, .windsurf/rules/memories.md | Windsurf rules |
cline | .clinerules/memories.md | Cline rules |
roo | .roo/rules/memories.md | Roo rules |
gemini | GEMINI.md | Gemini instructions |
Directory-based sources
These sources parse structured configuration files and extract rich metadata (paths, category, skill metadata):
| Source | Scanned Path | What's Extracted |
|---|---|---|
claude-rules | .claude/rules/*.md | Path-scoped rules with paths: frontmatter |
cursor-rules | .cursor/rules/*.mdc | Path-scoped rules with globs: frontmatter |
skills | .agents/skills/, .claude/skills/, .cursor/skills/, .codex/skills/, .kiro/skills/, .kilo/skills/, .trae/skills/, .antigravity/skills/, .goose/skills/, .windsurf/skills/, .cline/skills/, .clinerules/skills/, .roo/skills/, .amp/skills/, .opencode/skills/, .factory/skills/, .gemini/skills/ | Skill memories with metadata |
.agents/ | .agents/ directory | Full canonical config (instructions, rules, skills) |
Options
| Option | Description |
|---|---|
--type <type> | Override type for all imported memories |
--dry-run | Preview without importing |
--all | Scan all known locations (flat files + directories) |
--no-dedup | Skip duplicate detection |
Examples
Ingest from a specific tool:
memories ingest cursor
memories ingest claudeIngest path-scoped rules from Claude Code:
memories ingest claude-rulesIngest path-scoped rules from Cursor:
memories ingest cursor-rulesIngest skills:
memories ingest skillsIngest from the canonical .agents/ directory:
memories ingest .agents/Ingest from all known locations:
memories ingest --allPreview what would be imported:
memories ingest cursor --dry-runIngest from a custom file:
memories ingest ./my-rules.md --type ruleDirectory-Based Ingestion
When ingesting from structured directories, memories.sh extracts richer metadata than flat-file ingestion:
Claude Rules (.claude/rules/*.md)
- Parses YAML frontmatter for
paths:globs - Sets the memory's
pathsfield from the frontmatter - Derives
categoryfrom the filename (e.g.,api.md→ categoryapi) - Extracts bullet points as individual rule memories
Cursor Rules (.cursor/rules/*.mdc)
- Parses MDC frontmatter for
globs:patterns - Translates
globs:→pathson the memory - Handles
alwaysApply: truerules as non-path-scoped - Derives
categoryfrom the filename
Skills (**/skills/**/SKILL.md)
- Parses YAML frontmatter for
name,description, and other skill metadata - Stores frontmatter as the memory's
metadataJSON field - Uses the parent directory name as the
category - Ingests the full markdown body as memory content
Behavior
- Extracts bullet points, numbered items, and significant plain text from rule files
- Auto-infers memory type from content keywords:
- "always", "never", "must", "should" →
rule - "chose", "decided", "because" →
decision - Specific values, numbers, limits →
fact
- "always", "never", "must", "should" →
- Skips files that were generated by memories.sh (detected by marker comment)
- Deduplicates against existing memories using content and path-aware comparison
- Scans both current and legacy file locations (e.g.,
.cursorrules,.windsurfrules)