MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getScratchpadInstructions

Function getScratchpadInstructions

src/constants/prompts.ts:797–819  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

795 * The scratchpad is a per-session directory where Claude can write temporary files.
796 */
797export function getScratchpadInstructions(): string | null {
798 if (!isScratchpadEnabled()) {
799 return null
800 }
801
802 const scratchpadDir = getScratchpadDir()
803
804 return `# Scratchpad Directory
805
806IMPORTANT: Always use this scratchpad directory for temporary files instead of \`/tmp\` or other system temp directories:
807\`${scratchpadDir}\`
808
809Use 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
816Only use \`/tmp\` if the user explicitly requests it.
817
818The scratchpad directory is session-specific, isolated from the user's project, and can be used freely without permission prompts.`
819}
820
821function getFunctionResultClearingSection(model: string): string | null {
822 if (!feature('CACHED_MICROCOMPACT') || !getCachedMCConfigForFRC) {

Callers 1

getSystemPromptFunction · 0.85

Calls 2

isScratchpadEnabledFunction · 0.85
getScratchpadDirFunction · 0.85

Tested by

no test coverage detected