Skip to content

appendCwdNote

appendCwdNote(systemPrompt, cwd): string

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/utils/systemPromptNotes.d.ts:57

EXT-13 (part b): append a real-cwd / path-model note to the composed code-mode system prompt.

Code mode runs in REAL-path mode, so the filesystem tools and run_shell_command share one real-absolute-path namespace rooted at cwd. The shared .gsloth.code.md prompt already tells the model “the current working directory is provided to you separately”; this note is what provides it — without it the model assumes / is cwd and hands /-rooted paths to the real-fs shell. The cwd is injected dynamically (never baked into the .md). Backend-agnostic — the lean backend also runs real-fs code sessions and previously received NO cwd value, so GS2-27 composes it in the shared path. Returns the note alone when there is no base prompt.

string | undefined

string

string