memories.sh logomemories.sh
CLI Reference

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

ArgumentDescription
sourceSource name or file path (see sources below)

Sources

Flat-file sources

SourceScanned PathDescription
cursor.cursorrules, .cursor/rules/memories.mdcCursor rules (legacy + current)
claudeCLAUDE.mdClaude Code instructions
agentsAGENTS.mdMulti-tool agents file
copilot.github/copilot-instructions.mdGitHub Copilot
windsurf.windsurfrules, .windsurf/rules/memories.mdWindsurf rules
cline.clinerules/memories.mdCline rules
roo.roo/rules/memories.mdRoo rules
geminiGEMINI.mdGemini instructions

Directory-based sources

These sources parse structured configuration files and extract rich metadata (paths, category, skill metadata):

SourceScanned PathWhat's Extracted
claude-rules.claude/rules/*.mdPath-scoped rules with paths: frontmatter
cursor-rules.cursor/rules/*.mdcPath-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/ directoryFull canonical config (instructions, rules, skills)

Options

OptionDescription
--type <type>Override type for all imported memories
--dry-runPreview without importing
--allScan all known locations (flat files + directories)
--no-dedupSkip duplicate detection

Examples

Ingest from a specific tool:

memories ingest cursor
memories ingest claude

Ingest path-scoped rules from Claude Code:

memories ingest claude-rules

Ingest path-scoped rules from Cursor:

memories ingest cursor-rules

Ingest skills:

memories ingest skills

Ingest from the canonical .agents/ directory:

memories ingest .agents/

Ingest from all known locations:

memories ingest --all

Preview what would be imported:

memories ingest cursor --dry-run

Ingest from a custom file:

memories ingest ./my-rules.md --type rule

Directory-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 paths field from the frontmatter
  • Derives category from the filename (e.g., api.md → category api)
  • Extracts bullet points as individual rule memories

Cursor Rules (.cursor/rules/*.mdc)

  • Parses MDC frontmatter for globs: patterns
  • Translates globs:paths on the memory
  • Handles alwaysApply: true rules as non-path-scoped
  • Derives category from the filename

Skills (**/skills/**/SKILL.md)

  • Parses YAML frontmatter for name, description, and other skill metadata
  • Stores frontmatter as the memory's metadata JSON 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
  • 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)

On this page