Session
sessionPreserve and retrieve session context: capture insights, lessons, and plans; recall prior conversations; and ground current tasks with relevant history.
Instructions
Session and memory management — NOT for codebase/file search (use the 'search' tool for that). LESSONS LIVE HERE: when a mistake or correction happens, call action='capture_lesson' (NEVER write lessons to ~/.claude/.../memory/, .cursorrules, or other local markdown — local files are invisible to [LESSONS_WARNING] auto-surfacing on future turns and across sessions). PAST SESSIONS LIVE HERE: use action='recall' FIRST when the user references "last time", "previous", "yesterday", or is continuing prior work — full-text transcripts are indexed across every prior session. context() may surface [GROUNDING]; use action='ground' with user_message for a one-shot bundle (recall + docs + decisions + lessons + skills) outside context(). Actions: capture (save decision/insight), capture_lesson (mistakes/corrections — title+trigger+impact+prevention), get_lessons (retrieve lessons), recall (retrieve past conversation context via ranked fusion of transcripts/snapshots/docs/decisions), ground (one-shot prior-work bundle), remember (quick save), user_context (get preferences), summary (workspace summary), compress (compress chat), delta (changes since timestamp), smart_search (searches MEMORY/conversation history only, not code), decision_trace (trace decision provenance), restore_context (restore state after compaction). Plan actions: capture_plan, get_plan, update_plan, list_plans. Suggested rules actions: list_suggested_rules, suggested_rule_action, suggested_rules_stats. Team actions: team_decisions, team_lessons, team_plans.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action to perform | |
| workspace_id | No | Workspace ID (UUID). | |
| project_id | No | Project ID (UUID). | |
| query | No | Query for recall/search/lessons/decision_trace | |
| user_message | No | Natural-language anchor for action=ground (falls back to query) | |
| content | No | Content for capture/remember/compress | |
| title | No | Title for capture/capture_lesson/capture_plan | |
| agent | No | Agent name metadata for capture/search filtering | |
| mode | No | Mode metadata for capture/search filtering (e.g., primary/subagent) | |
| event_type | No | Event type for capture | |
| importance | No | Input parameter: importance. | |
| tags | No | Input parameter: tags. | |
| category | No | Input parameter: category. | |
| trigger | No | What caused the problem (for capture_lesson), or restore trigger for restore_context | |
| impact | No | What went wrong | |
| prevention | No | How to prevent in future | |
| severity | No | Input parameter: severity. | |
| keywords | No | Keywords for matching. | |
| since | No | ISO timestamp for delta | |
| limit | No | Maximum number of results to return. | |
| max_tokens | No | Max tokens for summary | |
| include_decisions | No | Include related decisions. | |
| include_related | No | Include related context. | |
| include_impact | No | Whether to include impact. | |
| session_id | No | Session identifier. | |
| code_refs | No | Input parameter: code refs. | |
| provenance | No | Input parameter: provenance. | |
| plan_id | No | Plan ID (full 36-char UUID) for get_plan/update_plan | |
| event_id | No | Event ID (full 36-char UUID) | |
| task_id | No | Task ID (full 36-char UUID) | |
| node_id | No | Node ID (full 36-char UUID) | |
| lesson_id | No | Lesson ID (full 36-char UUID) | |
| suggestion_id | No | Suggestion ID (full 36-char UUID) | |
| description | No | Description for capture_plan | |
| goals | No | Goals for capture_plan | |
| steps | No | Implementation steps for capture_plan | |
| status | No | Plan status | |
| due_at | No | Due date for plan (ISO timestamp) | |
| source_tool | No | Tool that generated this plan | |
| include_tasks | No | Include tasks when getting plan | |
| is_personal | No | Mark plan as personal (only visible to creator). For capture_plan/list_plans. | |
| snapshot_id | No | Specific snapshot ID to restore (defaults to most recent) | |
| max_snapshots | No | Number of recent snapshots to consider (default: 1) | |
| include_durable_context | No | Include durable snapshots/transcripts/docs/decisions in restore payload (default true) | |
| rule_id | No | Suggested rule ID for actions | |
| rule_action | No | Action to perform on suggested rule | |
| modified_keywords | No | Modified keywords when action is modify | |
| modified_instruction | No | Modified instruction when action is modify | |
| min_confidence | No | Minimum confidence threshold for listing rules |