update_session_summary
Append current session information to the summary file without closing the session, enabling ongoing documentation of work progress.
Instructions
Update the session summary file with current session info without doing a full session close.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| summary | Yes | Session summary text to append to session-summary.md |
Implementation Reference
- src/index.ts:159-182 (handler)Main tool handler for 'update_session_summary' that constructs a SessionSummary object (ignoring input args) and delegates to SessionCloser.updateSessionSummary()case 'update_session_summary': { const summary = { timestamp: new Date().toISOString(), accomplishments: [], decisions: [], blockers: [], nextSteps: [], filesChanged: [], }; await (this.sessionCloser as any).updateSessionSummary(summary); return { content: [ { type: 'text', text: JSON.stringify({ success: true, message: 'Session summary updated!', }), }, ], }; }
- src/session-closer.ts:82-100 (helper)Core implementation of session summary update: appends formatted session entry to .agent-os/session-summary.md fileprivate async updateSessionSummary(summary: SessionSummary): Promise<void> { const summaryPath = path.join(this.projectRoot, '.agent-os', 'session-summary.md'); // Ensure directory exists await fs.mkdir(path.dirname(summaryPath), { recursive: true }); let existingContent = ''; try { existingContent = await fs.readFile(summaryPath, 'utf-8'); } catch { // File doesn't exist, create it existingContent = '# Session Summary\n\n'; } const sessionEntry = this.formatSessionEntry(summary); const updatedContent = existingContent + '\n' + sessionEntry; await fs.writeFile(summaryPath, updatedContent, 'utf-8'); }
- src/index.ts:85-98 (registration)Tool registration in ListToolsRequest handler, including name, description, and JSON input schema{ name: 'update_session_summary', description: 'Update the session summary file with current session info without doing a full session close.', inputSchema: { type: 'object', properties: { summary: { type: 'string', description: 'Session summary text to append to session-summary.md', }, }, required: ['summary'], }, },
- src/types.ts:1-8 (schema)TypeScript interface defining the SessionSummary structure used by the updateSessionSummary methodexport interface SessionSummary { timestamp: string; accomplishments: string[]; decisions: Decision[]; blockers: string[]; nextSteps: string[]; filesChanged: string[]; }