soul_context
Load your soul context at the start of each conversation to provide identity, frameworks, signals, lessons, and state. Choose full or slim mode.
Instructions
Load your soul context — identity, frameworks, signals, lessons, and state. Call this at the start of every conversation. Default is 'full' (~4500 tokens). Use 'slim' for identity only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Context mode: 'full' (default) = identity + frameworks + signals + lessons + state. 'slim' = identity only. |
Implementation Reference
- Handler function for the soul_context tool. In 'slim' mode, returns just the SOUL.md identity. In 'full' mode, initializes the framework engine, renders frameworks, updates state engine, then assembles full context via assembleSoulContext.
export async function handleSoulContext( mode: "slim" | "full" = "full", ): Promise<string> { await ensureDirs(); if (mode === "slim") { const context = await assembleSlimContext(); if (!context.trim()) { return "Soul system initialized but no context files found yet. Soul files are at ~/.soul/files/"; } return context; } const frameworkEngine = new FrameworkEngine(); const store = await frameworkEngine.initialize(); const frameworksMd = renderFrameworksToMarkdown(store); await fs.writeFile(soulFilePath("FRAMEWORKS.md"), frameworksMd, "utf-8"); const stateEngine = new StateEngine(); await stateEngine.load(); stateEngine.recordEvent({ type: "session_start" }); await stateEngine.tick(); const config = await loadConfig(); const context = await assembleSoulContext(config); if (!context.trim()) { return "Soul system initialized but no context files found yet. Soul files are at ~/.soul/files/"; } return context; }