clear_scratch
Remove temporary scratch notes to free up cognitive processing space and maintain organized background thinking.
Instructions
Clear temporary scratch notes
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:337-354 (handler)Core handler function clearScratch() in ContemplationManager class that implements the logic to clear temporary scratch files by recursively deleting daily directories and returns the count of files cleared.async clearScratch(): Promise<number> { const scratchPath = '/Users/bard/Code/contemplation-loop/tmp/contemplation'; let count = 0; try { const days = fs.readdirSync(scratchPath); for (const day of days) { const dayPath = path.join(scratchPath, day); const files = fs.readdirSync(dayPath); count += files.length; fs.rmSync(dayPath, { recursive: true, force: true }); } } catch (e) { // Directory might not exist } return count; }
- src/index.ts:564-569 (registration)Registration and dispatching of the clear_scratch tool in the CallToolRequestSchema handler switch statement, which calls the clearScratch method and formats the response.case 'clear_scratch': { const count = await contemplation.clearScratch(); return { content: [{ type: 'text', text: `Cleared ${count} scratch files` }], }; }
- src/index.ts:473-480 (schema)Tool registration in ListToolsRequestSchema including the name, description, and empty inputSchema for clear_scratch (no parameters required).{ name: 'clear_scratch', description: 'Clear temporary scratch notes', inputSchema: { type: 'object', properties: {}, }, },