Skip to content

Commit de5157a

Browse files
author
Eric Wheeler
committed
system instructions: clarify terminal directory operations
Clear guidance for the AI system on: - Working directory constraints - Path handling requirements - Tool vs terminal directory behavior Signed-off-by: Eric Wheeler <[email protected]>
1 parent 2c2eec9 commit de5157a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/prompts/sections/rules.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ export function getRulesSection(
6464
6565
RULES
6666
67-
- Your current working directory is: ${cwd.toPosix()}
67+
- The project base directory is: ${cwd.toPosix()}
68+
- All all file paths must be relative to this directory. However, commands may change directories in terminals, so respect working directory specified by the response to <execute_command>.
6869
- You cannot \`cd\` into a different directory to complete a task. You are stuck operating from '${cwd.toPosix()}', so be sure to pass in the correct 'path' parameter when using tools that require a path.
6970
- Do not use the ~ character or $HOME to refer to the home directory.
7071
- Before using the execute_command tool, you must first think about the SYSTEM INFORMATION context provided to understand the user's environment and tailor your commands to ensure they are compatible with their system. You must also consider if the command you need to run should be executed in a specific directory outside of the current working directory '${cwd.toPosix()}', and if so prepend with \`cd\`'ing into that directory && then executing the command (as one command since you are stuck operating from '${cwd.toPosix()}'). For example, if you needed to run \`npm install\` in a project outside of '${cwd.toPosix()}', you would need to prepend with a \`cd\` i.e. pseudocode for this would be \`cd (path to project) && (command, in this case npm install)\`.

0 commit comments

Comments
 (0)