Skip to content
Esc
↑↓navigate↵open⌘Jpreview
Start
On this page

System Prompt Customization

Customize or replace the default system prompt to tailor the agent's behavior, personality, constraints, and output style for your specific needs.

Overview

The system prompt is the foundational instruction set that shapes how the agent behaves. Autohand ships with a carefully crafted default prompt, but you can customize it for specialized use cases.

There are two approaches:

  • Replace — Swap out the entire system prompt with your own
  • Append — Add instructions to the end of the default prompt

Replacing the system prompt

Use --sys-prompt to completely replace the default system prompt:

# Inline text
autohand --sys-prompt "You are a senior Python developer. Always use type hints and write docstrings."

# From a file
autohand --sys-prompt ./prompts/python-expert.md

Autohand auto-detects whether the value is a file path or inline text. See File path detection for the rules.

Appending to the system prompt

Use --append-sys-prompt to add instructions without removing the defaults:

# Add inline instructions
autohand --append-sys-prompt "Always write tests for new functions. Prefer vitest over jest."

# Append from a file
autohand --append-sys-prompt ./prompts/team-guidelines.md

This is the safer option — you keep all built-in behavior while adding your own constraints on top.

File path detection

Both flags auto-detect file paths. A single-line value is treated as a path when it:

  1. Starts with ./, ../, /, ~/ or a Windows drive such as C:\
  2. Ends with .md, .txt or .prompt
  3. Contains / or \ and no spaces

Relative paths resolve from the workspace root. If the path exists, the file contents are used; the file must be under 1 MB and not empty, and a directory is an error. Any other value, including multi-line text, is used as inline text.

Check the path: if a value looks like a path but no file exists there, Autohand does not report an error. It sends the path itself as the prompt text, so a misspelled file name silently becomes a one-line prompt.

# These read from files:
autohand --sys-prompt ./my-prompt.md
autohand --append-sys-prompt /absolute/path/to/guidelines.txt

# These use inline text:
autohand --sys-prompt "Be concise and direct"
autohand --append-sys-prompt "Always explain your reasoning"

Use cases

Team coding standards

# Append team guidelines to every session
autohand --append-sys-prompt ./team/coding-standards.md

Domain-specific assistant

# Create a specialized data engineering assistant
autohand --sys-prompt "You are a data engineering expert. Focus on SQL optimization, ETL pipelines, and data modeling. Use dbt best practices."

Output formatting

# Force specific output style
autohand --append-sys-prompt "Always respond in bullet points. Keep explanations under 3 sentences."

CI/CD integration

# Strict mode for automated pipelines
autohand --sys-prompt ./ci/review-prompt.md \
  --restricted \
  -p "Review staged changes for security issues"

Precedence rules

System prompt components are assembled in this order:

  1. Base prompt: default system prompt, including the tool capability catalog
  2. Memory: stored memories from /memory and # entries
  3. AGENTS.md: project-level instructions from your AGENTS.md file
  4. Skills: available and active skills
  5. Append prompt: content from --append-sys-prompt

Exact tool schemas are attached to each request separately. --bare skips memory and AGENTS.md; the append prompt still applies.

When using --sys-prompt, items 2-5 do not apply. The replacement text is used as the entire system prompt, so include any project instructions you still need in it.

Last updated on

Was this helpful?

Send Feedback

Help us improve this documentation page. Your feedback is valuable.

We'll only contact you if we need clarification