Skip to main content

Overview

The memory sessions command lists recent session files stored in the vault. Session files are markdown documents that capture agent interactions and can be automatically generated by integrations.

Syntax

memory sessions [OPTIONS]

Options

--limit
integer
default:"10"
Maximum number of sessions to show.
--project
string
Filter by project name.

Examples

List recent sessions

memory sessions
Output:
Sessions:
  2026-03-03 | myproject
  2026-03-02 | myproject
  2026-03-01 | anotherproject
  2026-02-28 | myproject
  2026-02-27 | thirdproject
  2026-02-26 | myproject
  2026-02-25 | myproject
  2026-02-24 | anotherproject
  2026-02-23 | myproject
  2026-02-22 | thirdproject

Show more sessions

memory sessions --limit 20

Filter by project

memory sessions --project myproject
Output:
Sessions:
  2026-03-03 | myproject
  2026-03-02 | myproject
  2026-02-28 | myproject
  2026-02-26 | myproject
  2026-02-25 | myproject
  2026-02-23 | myproject

Show all sessions for a project

memory sessions --project myproject --limit 100

Session Files

File naming

Session files follow this pattern:
YYYY-MM-DD-session.md
Example: 2026-03-03-session.md

Location

Stored in the vault under project directories:
~/.memory/vault/
  myproject/
    2026-03-03-session.md
    2026-03-02-session.md
    2026-03-03-a3f9c8d2e1b4.md  # regular memory
  anotherproject/
    2026-03-01-session.md

Content

Session files typically contain:
  • Timestamp and agent info
  • Conversation history
  • Commands run
  • Files modified
  • Decisions made
  • TODOs and follow-ups

Use Cases

Review recent work

Check what was done in recent sessions:
memory sessions --limit 5
cat ~/.memory/vault/myproject/2026-03-03-session.md

Find sessions by project

When switching contexts:
memory sessions --project oldproject

Audit trail

Review all activity over time:
memory sessions --limit 50

Extract learnings

Mine session files for memories to save:
# Review a session
cat ~/.memory/vault/myproject/2026-03-01-session.md

# Save important decisions as memories
memory save \
  --title "Extracted from 2026-03-01 session" \
  --what "Key decision here"

Viewing Session Content

Direct file access

# View latest session for current project
project=$(basename $(pwd))
latest=$(ls -t ~/.memory/vault/$project/*-session.md | head -1)
cat "$latest"

With pagination

memory sessions --project myproject | head -1
# Get the date from output, then:
less ~/.memory/vault/myproject/2026-03-03-session.md

Search within sessions

grep -r "authentication" ~/.memory/vault/*/

Session Creation

Session files are typically created by:
  1. Agent integrations: Cursor, Claude Code, Codex hooks
  2. MCP server: EchoVault MCP automatically logs sessions
  3. Manual creation: You can create them yourself

Manual session file

Create a session file manually:
project=$(basename $(pwd))
date=$(date +%Y-%m-%d)
file=~/.memory/vault/$project/$date-session.md

cat > "$file" << 'EOF'
# Session: 2026-03-03

## Context
Working on authentication refactor

## Work done
- Implemented JWT refresh tokens
- Updated middleware
- Added tests

## Decisions
- Using 7-day access tokens
- 30-day refresh tokens

## Follow-up
- Add token revocation
- Monitor security metrics
EOF

echo "Created $file"

Output Format

The command outputs a simple table:
Sessions:
  <date> | <project>
  <date> | <project>
  ...
  • Date: YYYY-MM-DD format
  • Project: Project directory name
  • Sorted by date (most recent first)

When No Sessions Found

memory sessions
Output:
No sessions found.
This means:
  • No *-session.md files exist in the vault
  • Or the project filter didn’t match any sessions
Review session files periodically to extract important decisions and save them as structured memories with memory save.
Session files are separate from memories. They’re raw logs, while memories are structured, searchable records. Use sessions for historical review and extract key points into memories.

Build docs developers (and LLMs) love