Skip to main content
Glama

save_session

Save Claude Code development sessions to a database for tracking project conversations, summaries, and git commits to support Architecture Decision Records (ADR) creation.

Instructions

Save a Claude Code development session to the database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesProject name
conversationYesFull conversation text
git_commitNoCurrent git commit hash
summaryNoShort session summary

Implementation Reference

  • index.js:58-69 (handler)
    Tool registration and handler definition for 'save_session' in index.js.
    server.registerTool('save_session', {
      description: 'Save a Claude Code development session to the database',
      inputSchema: {
        project:      z.string().describe('Project name'),
        conversation: z.string().describe('Full conversation text'),
        git_commit:   z.string().optional().describe('Current git commit hash'),
        summary:      z.string().optional().describe('Short session summary'),
      },
    }, async (args) => {
      const id = saveSession(args);
      return { content: [{ type: 'text', text: `Session saved (ID: ${id})` }] };
    });
  • db.js:54-59 (handler)
    Actual implementation of the 'saveSession' function that interacts with the database.
    export function saveSession({ project, conversation, git_commit, summary }) {
      const result = db.prepare(
        'INSERT INTO sessions (project, conversation, git_commit, summary) VALUES (?, ?, ?, ?)'
      ).run(project, conversation, git_commit ?? null, summary ?? null);
      return result.lastInsertRowid;
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wooxogh/adr-mcp-setup'

If you have feedback or need assistance with the MCP directory API, please join our Discord server