Skip to content
Productivity
Skill

/databases

View all Claudia memory databases, switch between them, manage isolation. Triggers on "which database?", "switch workspace", "show databases", "list databases".

From plugin
claudia
28333 skills6 agents
Install
$ npx -y skills add kbanc85/claudia --skill databases --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/databases

Context preview

The summary Claude sees to decide when to auto-load this skill.

View all Claudia memory databases, switch between them, manage isolation. Triggers on "which database?", "switch workspace", "show databases", "list databases".

SKILL.md

databases.SKILL.md
name: databases
description: View all Claudia memory databases, switch between them, manage isolation. Triggers on "which database?", "switch workspace", "show databases", "list databases".
argument-hint: "[list|use|info|delete] [hash]"
effort-level: low

Databases

View all Claudia memory databases, see what's in each, and switch between them.

**Triggers:** `/databases`, `/db`, "show databases", "list my databases", "switch database", "which database am I using?"

---

Argument Handling

Parse the user's input to determine the subcommand:

| Input | Subcommand | |-------|------------| | `/databases`, `/db`, "show databases", "list databases" | **list** | | `/databases use <hash>`, "switch to <hash>", "use database <hash>" | **use** | | `/databases info <hash>`, "database info", "show database <hash>" | **info** | | `/databases delete <hash>`, "delete database <hash>" | **delete** |

If no subcommand is clear, default to **list**.

---

List (Default)

Scan all Claudia databases and display their stats.

Step 1: Find all databases

# List production databases
ls -la ~/.claudia/memory/*.db 2>/dev/null || echo "NO_PROD_DBS"

# List demo databases
ls -la ~/.claudia/demo/*.db 2>/dev/null || echo "NO_DEMO_DBS"

Step 2: Get current database

The currently active database is determined by the workspace directory. The CLI hashes the project path to find the right database:

# Check current working directory to compute expected hash
pwd | shasum -a 256 | head -c 12

Step 3: Query each database for stats

For each `.db` file found, query it directly using sqlite3:

# For each database file, extract stats
# Replace <db_path> with actual path
sqlite3 "<db_path>" "
SELECT
    (SELECT value FROM _meta WHERE key = 'workspace_path') as workspace,
    (SELECT COUNT(*) FROM entities WHERE type = 'person') as people,
    (SELECT COUNT(*) FROM memories) as memories,
    (SELECT COUNT(*) FROM entities) as entities,
    (SELECT MAX(created_at) FROM memories) as last_memory
"

If `_meta` table doesn't exist or `workspace_path` is NULL, show "Unknown (legacy)".

Step 4: Get file sizes

# Get file sizes in human-readable format
du -h ~/.claudia/memory/*.db 2>/dev/null
du -h ~/.claudia/demo/*.db 2>/dev/null

Output Format

Present the results in a clean table:

## Claudia Databases

### Production (~/.claudia/memory/)

| # | Hash | Workspace | Size | People | Memories | Last Active |
|---|------|-----------|------|--------|----------|-------------|
| > | a1b2c3d4e5f6 | ~/projects/startup | 2.3 MB | 18 | 127 | 2h ago |
|   | 9z8y7x6w5v4u | ~/work/client-a | 890 KB | 3 | 22 | 3d ago |
|   | x7y8z9a0b1c2 | Unknown (legacy) | 156 KB | 0 | 5 | 14d ago |

### Demo (~/.claudia/demo/)

| # | File | Description | Size | People | Memories | Last Active |
|---|------|-------------|------|--------|----------|-------------|
|   | claudia-demo.db | Global demo | 1.1 MB | 12 | 19 | 1d ago |

> = currently active

---

**Actions:**
- `/databases use <hash>` - Switch to a different database
- `/databases info <hash>` - Deep dive into a specific database
- `/databases delete <hash>` - Delete a database (with confirmation)

Format "Last Active" as relative time (e.g., "2h ago", "3d ago", "14d ago").

---

Use

Switch to a different database by setting the `CLAUDIA_DB_OVERRIDE` environment variable.

Step 1: Verify database exists

ls ~/.claudia/memory/<hash>.db 2>/dev/null || ls ~/.claudia/demo/<hash>.db 2>/dev/null

If not found, report error:

Database '<hash>' not found. Run `/databases` to see available databases.

Step 2: Get workspace info from target database

sqlite3 "~/.claudia/memory/<hash>.db" "SELECT value FROM _meta WHERE key = 'workspace_path'" 2>/dev/null || echo "Unknown workspace"

Step 3: Show warning and get confirmation

Before switching, warn the user:

**Database Switch**

You're about to switch from:
  **Current:** [current workspace path] ([current hash])

To:
  **Target:** [target workspace path] ([target hash])

This will set `CLAUDIA_DB_OVERRIDE` in your environment.
**You'll need to restart Claude Code for the change to take effect.**

Proceed? (yes/no)

Step 4: Modify .mcp.json

If confirmed, update the `.claude/settings.local.json` file to add `CLAUDIA_DB_OVERRIDE` environment variable:

Read the current settings, then add or update the environment variable:

# Check if settings exist
cat .claude/settings.local.json 2>/dev/null || echo "NO_SETTINGS"

Then edit the file to add:

{
  "env": {
    "CLAUDIA_DB_OVERRIDE": "/Users/kamil/.claudia/memory/<hash>.db"
  }
}

Step 5: Confirm and instruct user

**Database switched to:** [target hash]
   **Workspace:** [target workspace path]

**Action required:** Restart Claude Code for the change to take effect.
   - Exit this session (type `/exit` or close terminal)
   - Start a new `claude` session

To switch back to your original database, run `/databases use <original-hash>`.

---

Info

Show detailed statistics about a specific database.

Step 1: Verify database exists

ls ~/.claudia/memory/<hash>.db 2>/dev/null || ls ~/.claudia/demo/<hash>.db 2>/dev/null

Step 2: Query detailed stats

sqlite3 "<db_path>" "
-- Workspace info
SELECT 'workspace' as section, key, value FROM _meta;

-- Entity breakdown
SELECT 'entity_type' as section, type, COUNT(*) as count FROM entities GROUP BY type;

-- Memory breakdown
SELECT 'memory_type' as section, type, COUNT(*) as count FROM memories GROUP BY type;

-- Relationship count
SELECT 'relationships' as section, 'total' as type, COUNT(*) as count FROM relationships;

-- Episode count
SELECT 'episodes' as section, 'total' as type, COUNT(*) as count FROM episodes;

-- Pattern count
SELECT 'patterns' as section, 'total' as type, COUNT(*) as count FROM patterns;

-- Prediction count (active)
SELECT 'predictions' as se
Read more
Ships withclaudia

Terminal-based AI chief of staff. Remembers relationships, tracks commitments, helps you think strategically. Runs on Claude Code.

Get the whole plugin

Other skills on claudia.