()
| 795 | * The scratchpad is a per-session directory where Claude can write temporary files. |
| 796 | */ |
| 797 | export function getScratchpadInstructions(): string | null { |
| 798 | if (!isScratchpadEnabled()) { |
| 799 | return null |
| 800 | } |
| 801 | |
| 802 | const scratchpadDir = getScratchpadDir() |
| 803 | |
| 804 | return `# Scratchpad Directory |
| 805 | |
| 806 | IMPORTANT: Always use this scratchpad directory for temporary files instead of \`/tmp\` or other system temp directories: |
| 807 | \`${scratchpadDir}\` |
| 808 | |
| 809 | Use this directory for ALL temporary file needs: |
| 810 | - Storing intermediate results or data during multi-step tasks |
| 811 | - Writing temporary scripts or configuration files |
| 812 | - Saving outputs that don't belong in the user's project |
| 813 | - Creating working files during analysis or processing |
| 814 | - Any file that would otherwise go to \`/tmp\` |
| 815 | |
| 816 | Only use \`/tmp\` if the user explicitly requests it. |
| 817 | |
| 818 | The scratchpad directory is session-specific, isolated from the user's project, and can be used freely without permission prompts.` |
| 819 | } |
| 820 | |
| 821 | function getFunctionResultClearingSection(model: string): string | null { |
| 822 | if (!feature('CACHED_MICROCOMPACT') || !getCachedMCConfigForFRC) { |
no test coverage detected