---
published: true
id: system-prompt
title: System Prompt
description: Knowledge captured in João Lopes' learning graph.
tags:
- ai-engineering
- llm
- agent-design
locale: en
resource: https://joaolopes.dev.br/knowledge/concepts/en/system-prompt/
created: '2026-03-27'
---

# System Prompt
The initial set of instructions injected before any user message in an LLM conversation that shapes the model's behavior.

## Definition
The system prompt defines the model's persona, constraints, available tools, and behavioral rules. The user never sees it directly, but it shapes every response. In agent runtimes like Claude Code, it is assembled automatically from built-in instructions, CLAUDE.md files, tool definitions, skill descriptions, and auto-memory. Because it is re-injected on every API call, it survives context window compaction — unlike mid-conversation instructions which may be summarized away.

## Source
- [Prompt engineering - Wikipedia](https://en.wikipedia.org/wiki/Prompt_engineering)
- [Claude Code overview](https://code.claude.com/docs/en/overview)

## Related
- [Context Window](/concepts/en/context-window.md)
- [Tokens](/concepts/en/tokens.md)
- [Turn](/concepts/en/turn.md)
