memories.sh logomemories.sh
CLI Reference

memories add

Add a new memory to the store.

memories add <content> [options]

Store a new memory with optional type, tags, path scoping, and category. Memories are automatically scoped to the current project when inside a git repository.

Arguments

ArgumentDescription
contentThe memory content (required)

Options

OptionDescription
-t, --tags <tags>Comma-separated tags
-g, --globalStore as global memory (default: project-scoped if in git repo)
--type <type>Memory type: rule, decision, fact, note, skill (default: note)
-r, --ruleShorthand for --type rule
-d, --decisionShorthand for --type decision
-f, --factShorthand for --type fact
--paths <globs>Comma-separated glob patterns for path-scoped rules
--category <name>Grouping key (becomes rule filename or skill directory)

Examples

Add a rule:

memories add --rule "Always use early returns to reduce nesting"

Add a path-scoped rule:

memories add --rule "Use RESTful naming conventions" --paths "src/api/**" --category api

Add a decision with tags:

memories add --decision "Chose Tailwind over styled-components for utility-first approach" --tags "css,architecture"

Add a fact:

memories add --fact "API rate limit is 100 requests per minute"

Add a global memory:

memories add --global --rule "Use conventional commits in all projects"

Add a skill:

memories add --type skill "## Deploy\n\n1. Run tests\n2. Build\n3. Deploy" \
  --category deploy

Add a simple note (default type):

memories add "Legacy API deprecated in Q3 2026"

Path Scoping

When you set --paths, the memory becomes a path-scoped rule. During generation:

  • .agents/rules/ — written as a separate rule file with paths: frontmatter
  • Claude Code — copied to .claude/rules/ (native paths: support)
  • Cursor — translated to .cursor/rules/ with globs: frontmatter
  • Flat-file targets — merged into the single file with inline path annotations

Behavior

  • Each memory gets a unique 12-character nanoid
  • If authenticated, rate limits are checked against your plan
  • Project scope is automatically determined from the git remote URL
  • Pass --global to override automatic project scoping

On this page