Memory

Long-term memory across sessions — search, read, save. The memory skill gives CLI-JAW persistent recall of user preferences, project decisions, and durable knowledge that survives beyond a single conversation.

Default Active: Yes Category: Productivity L1 + L2 Scope

Quick Reference

Skill namememory
StatusActive (auto-injected into every session)
CategoryProductivity
SKILL.md path~/.cli-jaw/skills/memory/SKILL.md
Data directory~/.cli-jaw/memory/structured/
RequiresNone (no external dependencies)
InstallPre-installed (ships with CLI-JAW)
ScopeL1 instance-local (read/write) + L2 dashboard (read-only)
Embedding searchOptional, default OFF

Overview

The memory skill is the persistent knowledge layer for CLI-JAW. It enables the AI to remember facts, preferences, and decisions across sessions without relying solely on conversation context. Every session has the memory skill injected automatically — there is no need to load it manually.

Memory operates at two scopes:

L1 Instance-Local Memory

  • Commands: cli-jaw memory search/read/save
  • Default path for all operations
  • Current instance only
  • Read + Write
  • Used for all save operations

L2 Dashboard Memory

  • Commands: cli-jaw dashboard memory search/read/instances
  • Cross-instance federation
  • Multiple instances / homes
  • Read-Only
  • Used only when user explicitly asks for cross-instance data
Use L2 dashboard memory only when the user asks for dashboard memory, all instances, another instance/home, or cross-instance context. Default to L1 for everything else.

Rules

The memory skill follows seven strict rules that govern when and how memory is used:

#RuleDetails
1Search before answeringWhen asked about past work, decisions, or preferences, always run cli-jaw memory search <keywords> first before responding.
2Save durable facts immediatelyUser preferences, key decisions, and stable project facts should be saved as soon as they are identified.
3Use structured destinationsPrefer structured/profile.md, structured/semantic/..., or structured/episodes/... over ad-hoc paths.
4Admit gapsIf search returns nothing, say "I don't have a record of that." Do not fabricate memories.
5Save stable facts onlyDo not save transient TODOs, phase logs, or temporary checklists. Only durable knowledge belongs in memory.
6Search broadlyConsider Korean/English variants, error codes, symbols, and filenames when constructing search queries.
7Use injected contextA task snapshot may already be in the prompt; still search when precision matters or exact wording is needed.

Commands

Search

Search the memory index for keywords. Returns matching entries with their source file paths.

# Basic keyword search
cli-jaw memory search "keyword"

# Search for user preferences
cli-jaw memory search "user preference"

# Search with error codes or technical terms
cli-jaw memory search "auth login 401"

# Search with system/service terms
cli-jaw memory search "launchd plist service"

# Cross-instance search (L2 dashboard, read-only)
cli-jaw dashboard memory search "cross-instance topic"
Tip: Search broadly. If your first query returns nothing, try Korean/English variants. For example, search both "인증" and "auth" to catch bilingual entries.

Read

Read the full contents of a specific memory file, or a line range within it.

# Read the user profile
cli-jaw memory read structured/profile.md

# Read a semantic knowledge file
cli-jaw memory read structured/semantic/cli-jaw.md

# Read an episodic entry
cli-jaw memory read structured/episodes/live/2026-03-07.md

# Read only specific lines (useful for large files)
cli-jaw memory read structured/profile.md --lines 1-30

Save

Append durable facts to a memory file. Content is appended, not overwritten.

# Save a user preference to the profile
cli-jaw memory save structured/profile.md "- User prefers Korean UI and English code"

# Save a technical fact to a semantic file
cli-jaw memory save structured/semantic/cli-jaw.md "- Memory runtime uses task snapshots before response generation"

# Save a time-bound episode
cli-jaw memory save structured/episodes/live/2026-03-07.md "## 16:30\n- Decided to remove query-provider setup from memory UX"
Important: Only save stable, durable facts. Transient data like "current task progress" or "temporary debug notes" should not go into memory. If in doubt, ask whether this fact will still be relevant next week.

List & Init

Utility commands for inspecting and initializing the memory directory.

# List all memory files and their sizes
cli-jaw memory list

# Initialize the memory directory structure (first-time setup)
cli-jaw memory init

Storage Layout

Memory is organized into a structured directory hierarchy under ~/.cli-jaw/memory/. Each subdirectory serves a distinct purpose:

PathPurposeWhen to Use
structured/profile.md Stable profile, preferences, long-lived project context User preferences, tool settings, default behaviors
structured/episodes/ Time-ordered episodic memory Session outcomes, decisions with dates, time-bound events
structured/semantic/ Durable facts and extracted knowledge Technical knowledge, project architecture notes, API patterns
structured/procedures/ Reusable workflows and rules Step-by-step guides, deployment procedures, standard processes
structured/sessions/ Optional session-derived memory Auto-extracted insights from completed sessions
structured/index.sqlite Search index Automatically maintained; powers memory search
~/.cli-jaw/memory/
  structured/
    profile.md                          # User preferences and identity
    index.sqlite                        # Full-text search index
    episodes/
      live/
        2026-03-07.md                   # Daily episodic entries
        2026-05-29.md
    semantic/
      cli-jaw.md                        # CLI-JAW-specific knowledge
      deployment.md                     # Deployment procedures
      project-architecture.md           # Architecture decisions
    procedures/
      release-checklist.md              # Reusable workflows
      code-review-process.md
    sessions/
      session-2026-05-29-abc123.md      # Auto-extracted session notes

Workflows

The memory skill defines four standard workflows that govern how memory is used during a conversation.

New Conversation

When a new session begins:

1Use injected memory context if present (the system may pre-load relevant memories)
2Search memory if the task depends on prior decisions or preferences
3Read the relevant file when exact wording or details matter

User Mentions a Preference

When the user states a preference (e.g., "I prefer tabs over spaces"):

1Acknowledge briefly ("Got it, noted.")
2Save to structured/profile.md
3If project-specific, also save to an appropriate semantic file

User Asks "Do you remember...?"

When the user asks whether something was previously discussed:

1Run cli-jaw memory search "<keywords>"
2If found, answer with the remembered fact and cite the source file
3If not found, say there is no saved record and offer to save it

End of Important Session

When a session yields a significant decision or outcome:

1Save the durable decision or fact
2Use episodic files (episodes/) for time-bound outcomes
3Use semantic or profile files for long-lived knowledge

Usage Examples (~해줌)

Here are real-world usage patterns in the natural Korean style that CLI-JAW understands.

"내가 저번에 Tailwind 쓰다고 했던 거 기억해?"
Triggers the "Do you remember?" workflow. The agent runs cli-jaw memory search "Tailwind", finds the saved preference in structured/profile.md, and responds with the exact entry and its source file.
"앞으로 코드는 영어, UI 텍스트는 한국어로 해줌"
Triggers the "User Mentions a Preference" workflow. The agent acknowledges, then saves - Code language: English, UI text: Korean to structured/profile.md so all future sessions respect this preference.
"지난번 배포 때 DB 마이그레이션 어떻게 했더라?"
Triggers the "Search before answering" rule. The agent searches for "DB migration deploy" and "배포 마이그레이션" across memory, then reads the relevant episodic entry to recall the exact migration steps used.
"이 프로젝트에서 API 에러 해들링은 항상 ErrorResponse 타입 쓰기로 결정했어. 기억해줌."
Triggers an immediate save. The agent saves - API error handling: always use ErrorResponse type to structured/semantic/project-architecture.md so this architectural decision persists.
"다른 인스턴스에서 이 프로젝트 어떻게 설정했는지 찾아뵐"
Triggers L2 dashboard memory. The agent recognizes "other instance" and runs cli-jaw dashboard memory search "project setup" to federate across instances, returning read-only results from the dashboard.

What to Save vs. What to Skip

Save (Durable)Skip (Transient)
User prefers dark mode in all UIsCurrent task: "fix the login bug"
Project uses pnpm, not npmPhase log: "Phase 2 started at 3pm"
API response format decisionTemporary debug checklist
Deployment procedure for production"Remind me to check this tomorrow"
Architecture: microservices with event busIn-progress TODO list
Team uses Conventional CommitsSession-specific variable values

Choosing the Right Destination

When saving a fact, select the destination based on the nature of the information:

Information TypeDestinationExample
Personal preferencestructured/profile.md"User prefers Korean UI, English code"
Project architecture factstructured/semantic/<project>.md"CLI-JAW uses SQLite for memory index"
Decision with a datestructured/episodes/live/<date>.md"2026-05-29: Chose Drizzle ORM over Prisma"
Reusable workflowstructured/procedures/<name>.md"Release checklist: lint, test, tag, deploy"
Domain knowledgestructured/semantic/<domain>.md"Cloudflare D1 has 10GB limit per database"

Search Tips

The memory search index supports full-text keyword matching. To get the best results:

Embedding search is optional and default OFF. The skill does not assume vector/semantic search is available. All search operations use the SQLite full-text index by default.

Notes

Related