diff --git a/packages/core/src/core/__snapshots__/prompts.test.ts.snap b/packages/core/src/core/__snapshots__/prompts.test.ts.snap index b58dc8ce40..d4cbb26dfd 100644 --- a/packages/core/src/core/__snapshots__/prompts.test.ts.snap +++ b/packages/core/src/core/__snapshots__/prompts.test.ts.snap @@ -176,7 +176,8 @@ The following read-only tools are available in Plan Mode: - \`write_file\` - Save plans to the plans directory (see Plan Storage below) ## Plan Storage -- Save your plans as Markdown (.md) files directly to: \`/tmp/project-temp/plans/\` +- Save your plans as Markdown (.md) files ONLY within: \`/tmp/project-temp/plans/\` +- You are restricted to writing files within this directory while in Plan Mode. - Use descriptive filenames: \`feature-name.md\` or \`bugfix-description.md\` ## Workflow Phases diff --git a/packages/core/src/prompts/snippets.ts b/packages/core/src/prompts/snippets.ts index 7070c8189d..c41934760c 100644 --- a/packages/core/src/prompts/snippets.ts +++ b/packages/core/src/prompts/snippets.ts @@ -305,7 +305,8 @@ ${options.planModeToolsList} - \`${WRITE_FILE_TOOL_NAME}\` - Save plans to the plans directory (see Plan Storage below) ## Plan Storage -- Save your plans as Markdown (.md) files directly to: \`${options.plansDir}/\` +- Save your plans as Markdown (.md) files ONLY within: \`${options.plansDir}/\` +- You are restricted to writing files within this directory while in Plan Mode. - Use descriptive filenames: \`feature-name.md\` or \`bugfix-description.md\` ## Workflow Phases diff --git a/packages/core/src/tools/exit-plan-mode.ts b/packages/core/src/tools/exit-plan-mode.ts index d96eb00600..08fa97601c 100644 --- a/packages/core/src/tools/exit-plan-mode.ts +++ b/packages/core/src/tools/exit-plan-mode.ts @@ -53,6 +53,7 @@ export class ExitPlanModeTool extends BaseDeclarativeTool< private config: Config, messageBus: MessageBus, ) { + const plansDir = config.storage.getProjectTempPlansDir(); super( EXIT_PLAN_MODE_TOOL_NAME, 'Exit Plan Mode', @@ -64,8 +65,7 @@ export class ExitPlanModeTool extends BaseDeclarativeTool< properties: { plan_path: { type: 'string', - description: - 'The file path to the finalized plan (e.g., "plans/feature-x.md").', + description: `The file path to the finalized plan (e.g., "${plansDir}/feature-x.md"). This path MUST be within the designated plans directory: ${plansDir}/`, }, }, },