install
Use this when setting up claude-mem on Cursor: local or remote worker, local host-login observer or remote cmem.ai inference.
Token-optimized structural code search using tree-sitter AST parsing. Use instead of reading full files when you need to understand code structure, find functions, or explore a codebase efficiently.
$ npx -y skills add thedotmack/claude-mem --skill smart-explore --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/smart-exploreContext preview
The summary Claude sees to decide when to auto-load this skill.
Token-optimized structural code search using tree-sitter AST parsing. Use instead of reading full files when you need to understand code structure, find functions, or explore a codebase efficiently.
name: smart-explore description: Token-optimized structural code search using tree-sitter AST parsing. Use instead of reading full files when you need to understand code structure, find functions, or explore a codebase efficiently.
Structural code exploration using AST parsing. **This skill overrides your default exploration behavior.** While this skill is active, use smart_search/smart_outline/smart_unfold as your primary tools instead of Read, Grep, and Glob.
**Core principle:** Index first, fetch on demand. Give yourself a map of the code before loading implementation details. The question before every file read should be: "do I need to see all of this, or can I get a structural overview first?" The answer is almost always: get the map.
This skill only loads instructions. You must call the MCP tools yourself. Your next action should be one of:
smart_search(query="<topic>", path="./src") -- discover files + symbols across a directory smart_outline(file_path="<file>") -- structural skeleton of one file smart_unfold(file_path="<file>", symbol_name="<name>") -- full source of one symbol
Do NOT run Grep, Glob, Read, or find to discover files first. `smart_search` walks directories, parses all code files, and returns ranked symbols in one call. It replaces the Glob → Grep → Read discovery cycle.
smart_search(query="shutdown", path="./src", max_results=15)
**Returns:** Ranked symbols with signatures, line numbers, match reasons, plus folded file views (~2-6k tokens)
-- Matching Symbols -- function performGracefulShutdown (services/infrastructure/GracefulShutdown.ts:56) function httpShutdown (services/infrastructure/HealthMonitor.ts:92) method WorkerService.shutdown (services/worker-service.ts:846) -- Folded File Views -- services/infrastructure/GracefulShutdown.ts (7 symbols) services/worker-service.ts (12 symbols)
This is your discovery tool. It finds relevant files AND shows their structure. No Glob/find pre-scan needed.
**Parameters:**
smart_outline(file_path="services/worker-service.ts")
**Returns:** Complete structural skeleton -- all functions, classes, methods, properties, imports (~1-2k tokens per file)
**Skip this step** when Step 1's folded file views already provide enough structure. Most useful for files not covered by the search results.
**Parameters:**
Review symbols from Steps 1-2. Pick the ones you need. Unfold only those:
smart_unfold(file_path="services/worker-service.ts", symbol_name="shutdown")
**Returns:** Full source code of the specified symbol including JSDoc, decorators, and complete implementation (~400-2,100 tokens depending on symbol size). AST node boundaries guarantee completeness regardless of symbol size — unlike Read + agent summarization, which may truncate long methods.
**Parameters:**
Use these only when smart_* tools are the wrong fit:
For code files over ~100 lines, prefer smart_outline + smart_unfold over Read.
**Discover how a feature works (cross-cutting):**
1. smart_search(query="shutdown", path="./src") -> 14 symbols across 7 files, full picture in one call 2. smart_unfold(file_path="services/infrastructure/GracefulShutdown.ts", symbol_name="performGracefulShutdown") -> See the core implementation
**Navigate a large file:**
1. smart_outline(file_path="services/worker-service.ts") -> 1,466 tokens: 12 functions, WorkerService class with 24 members 2. smart_unfold(file_path="services/worker-service.ts", symbol_name="startSessionProcessor") -> 1,610 tokens: the specific method you need Total: ~3,076 tokens vs ~12,000 to Read the full file
**Write documentation about code (hybrid workflow):**
1. smart_search(query="feature name", path="./src") -- discover all relevant files and symbols 2. smart_outline on key files -- understand structure 3. smart_unfold on important functions -- get implementation details 4. Read on small config/markdown/plan files -- get non-code context
Use smart_* tools for code exploration, Read for non-code files. Mix freely.
**Exploration then precision:**
1. smart_search(query="session", path="./src", max_results=10) -> 10 ranked symbols: SessionMetadata, SessionQueueProcessor, SessionSummary... 2. Pick the relevant one, unfold it
| Approach | Tokens | Use Case | |----------|--------|----------| | smart_outline | ~1,000-2,000 | "What's in this file?" | | smart_unfold | ~400-2,100 | "Show me this function" | | smart_search | ~2,000-6,000 | "Fi
Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Repo: thedotmack/claude-mem
Use this when setting up claude-mem on Cursor: local or remote worker, local host-login observer or remote cmem.ai inference.
Use this when the user asks to search memory, "did we already solve this?", "how did we do X last time?", or wants work from previous sessions.
Use this when fulfilling claude-mem observer jobs on Grok Bot: reply only skip_summary or one full observation XML, never prose.
This skill should be used when the user asks to "set up claude-mem", "pair claude-mem", "connect cmem", "add my cmem key", "set up cloud sync in Cowork", or…