Documentation / SDK and API
Prompt
How the system prompt is assembled and how to add to it, replace parts of it, or guide individual tools.
The system prompt is built every turn from layers. You customise it with a PromptConfig, without touching the core sections.
How it is assembled
- Core sections: identity, runtime contract, working rules, tool use, output discipline and more. They never change, which is why they can be cached by the provider.
- Runtime context: session, turn number, working directory, model, available tools.
- Runtime guidance.
- Project instructions, when the working directory has them (see below).
- Memory context, when memory is enabled.
- Stage overlay, when you set a stage other than the default.
- Your appended text, always last.
Tool definitions sent to the provider come from the tool registry. Your hints are added to their descriptions.
Project instructions
If the working directory contains an instructions file, its content is added to the prompt every turn, before the memory context. Seshat looks for these files in order and uses the first one that is not empty:
SESHAT.mdAGENTS.md.seshat/instructions.md
The content is cut at 32 KB. Use it for rules that belong to a project: how to build and test, conventions, things to avoid.
These files are read only for a project you trust. In the terminal interface, run seshat trust first: one command covers the project’s configuration files and its instruction files, and a file is trusted for its exact content, so a change brings the question back. In Go, set ClientConfig.TrustProjectInstructions, a function that receives the path and the content of each file and returns true to use it. Left empty, no instructions file is read at all.
Configure it
extra := "Always answer in French. Prefer small, reviewable changes."
cfg := sdk.DefaultClientConfig()
cfg.PromptConfig = &sdk.PromptConfig{
AppendSystemPrompt: &extra,
ToolHints: map[string]string{
"bash": "Prefer `rg` over `grep`. Never run commands that need a TTY.",
},
}
| Field | Effect |
|---|---|
AppendSystemPrompt | Text added after everything else, every turn. The safest way to add rules |
SystemPrompt | Replaces the whole default prompt. The core sections and stage overlay are then not used |
ToolHints | Per-tool guidance added to a tool’s description, keyed by tool name |
Stage | An overlay for how the model should behave this turn (see below) |
StageOverrides | Replace the built-in overlay text of a stage |
Stages
A stage adds a short instruction for a situation:
| Stage | Meaning |
|---|---|
StageDefault | Normal operation, nothing added |
StageToolCall | The model is expected to call tools |
StageToolResult | The model should work with the tool results it received |
StageContinuation | Resume from where it stopped |
StagePlan | Plan mode overlay: the model is told to describe a plan instead of running tools |
For normal use you do not set a stage. StagePlan is the one most apps use, to let the user review a plan first.
On one session
A session can change its prompt after creation:
session.SetAppendSystemPrompt("This conversation is about the billing service.")
session.SetSystemPromptTemplate(template)
session.SetWorkingDirectory("/srv/projects/billing")Updated on 2026-10-13