Skip to main content
Glama

resume

Restore previous project context and conversation state when starting a new session with Claude Infinite Context.

Instructions

Load the last checkpoint at session start. Returns formatted context to inject into the conversation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core implementation of the resume tool: retrieves the latest project state from Redis, validates active files exist, formats the state into a markdown context summary, and returns it for conversation injection.
    async resume(): Promise<string> { const sessionId = this.ensureInitialized(); try { logger.info('Resuming from last checkpoint', { sessionId }); const state = await this.redis.getState(sessionId); // Validate active files still exist const validatedFiles = await this.filterExistingFilesWithCache(state.active_context.active_files); // Format context for Claude const formatted = this.formatStateForResume(state, validatedFiles); logger.info('Resume completed', { version: state.meta.version, activeFiles: validatedFiles.length, }); return formatted; } catch (error) { logger.error('Resume failed', { error, sessionId }); throw new Error(`Resume failed: ${error}`); } }
  • Helper function that formats the project state into a structured Markdown document for resuming context in the conversation, including overview, architecture, tasks, files, changes, decisions, and metadata.
    private formatStateForResume(state: ProjectState, validatedFiles: string[]): string { const sections: string[] = []; sections.push('# Project Context Resume'); sections.push(''); // Overview if (state.project_context.overview) { sections.push('## Overview'); sections.push(state.project_context.overview); sections.push(''); } // Architecture if (state.project_context.architecture) { sections.push('## Architecture'); sections.push(state.project_context.architecture); sections.push(''); } // Current task if (state.active_context.current_task) { sections.push('## Current Task'); sections.push(state.active_context.current_task); sections.push(''); } // Active files if (validatedFiles.length > 0) { sections.push('## Active Files'); validatedFiles.forEach((file) => sections.push(`- ${file}`)); sections.push(''); } // Recent changes if (state.project_context.recent_changes.length > 0) { sections.push('## Recent Changes'); state.project_context.recent_changes.slice(0, 5).forEach((change) => { sections.push(`### ${new Date(change.timestamp).toLocaleString()}`); sections.push(change.summary); if (change.files.length > 0) { sections.push(`Files: ${change.files.join(', ')}`); } sections.push(''); }); } // Active decisions if (state.active_context.active_decisions.length > 0) { sections.push('## Active Decisions'); state.active_context.active_decisions.forEach((decision) => { const status = decision.status === 'decided' ? '✓' : '?'; sections.push(`${status} ${decision.question}`); if (decision.decision) { sections.push(` → ${decision.decision}`); } }); sections.push(''); } // Metadata sections.push('---'); sections.push( `Last checkpoint: ${new Date(state.meta.last_checkpoint).toLocaleString()}` ); sections.push(`Version: ${state.meta.version}`); sections.push(`Token budget used: ${state.meta.token_budget_used.toLocaleString()}`); return sections.join('\n'); }
  • src/index.ts:76-84 (registration)
    MCP tool registration for 'resume', listed in ListToolsRequestSchema handler with description and empty input schema (no parameters required).
    { name: 'resume', description: 'Load the last checkpoint at session start. Returns formatted context to inject into the conversation.', inputSchema: { type: 'object', properties: {}, }, },
  • MCP CallToolRequestSchema handler for 'resume' tool: delegates execution to ProjectBrain.resume() and formats response as MCP content.
    case 'resume': { const result = await this.brain.resume(); return { content: [{ type: 'text', text: result }], }; }
  • Input schema for resume tool: empty object (no required parameters).
    inputSchema: { type: 'object', properties: {}, },

Other Tools

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/coderdeep11/claude-memory-mcp'

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