faf_clear
Clear caches, temporary files, and reset FAF state to resolve issues and start fresh. Remove trust cache, todo lists, or backup files individually or clear everything at once.
Instructions
Clear caches, temporary files, and reset FAF state for a fresh start
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cache | No | Clear trust cache only | |
| todos | No | Clear todo lists only | |
| backups | No | Clear backup files only | |
| all | No | Clear everything (default) |
Implementation Reference
- src/handlers/tools.ts:737-775 (handler)The `handleFafClear` method is the core implementation, which constructs command-line arguments based on user input and calls the engine adapter to perform the clear operation.
private async handleFafClear(args: any): Promise<CallToolResult> { const clearArgs: string[] = []; if (args?.cache) { clearArgs.push('--cache'); } if (args?.todos) { clearArgs.push('--todos'); } if (args?.backups) { clearArgs.push('--backups'); } if (args?.all || (!args?.cache && !args?.todos && !args?.backups)) { clearArgs.push('--all'); } const result = await this.engineAdapter.callEngine('clear', clearArgs); if (!result.success) { return { content: [{ type: 'text', text: `🧹 Claude FAF Clear:\n\nFailed to clear: ${result.error}` }], isError: true }; } const output = typeof result.data === 'string' ? result.data : result.data?.output || JSON.stringify(result.data, null, 2); return { content: [{ type: 'text', text: `🧹 Claude FAF Clear:\n\n${output}` }] }; } - src/handlers/tools.ts:112-123 (registration)The `faf_clear` tool is registered within the tools configuration in `src/handlers/tools.ts`.
name: 'faf_clear', description: 'Clear caches, temporary files, and reset FAF state for a fresh start', inputSchema: { type: 'object', properties: { cache: { type: 'boolean', description: 'Clear trust cache only' }, todos: { type: 'boolean', description: 'Clear todo lists only' }, backups: { type: 'boolean', description: 'Clear backup files only' }, all: { type: 'boolean', description: 'Clear everything (default)' } }, } }, - src/handlers/tool-types.ts:108-112 (schema)`FafClearArgs` interface defines the expected arguments for the `faf_clear` tool.
export interface FafClearArgs { cache?: boolean; force?: boolean; all?: boolean; }