# PrimeAgent Default Prompts Explained: How the System Prompt Is Built

> Discover how PrimeAgent builds its default system prompt by combining code assistant details, tool definitions, and project context. Learn to inspect and customize it.

- Repository: [Prime Intellect/prime-agent](https://github.com/PrimeIntellect-ai/prime-agent)
- Tags: deep-dive
- Published: 2026-08-20

---

**PrimeAgent constructs its system prompt by combining a built-in coding-assistant description, tool definitions, project context files, and optional user overrides.** The final prompt is assembled at runtime by the `buildSystemPrompt` function and can be inspected or customized through CLI flags and slash commands.

PrimeAgent, developed by PrimeIntellect-ai, is an open-source coding agent that communicates with large language models (LLMs) through a carefully structured system prompt. Understanding how these **default prompts** are constructed helps developers customize agent behavior and debug prompt-related issues. The prompt architecture lives primarily in [`packages/coding-agent/src/core/system-prompt.ts`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/coding-agent/src/core/system-prompt.ts).

---

## How PrimeAgent Builds the System Prompt

The `buildSystemPrompt` function in [`packages/coding-agent/src/core/system-prompt.ts`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/coding-agent/src/core/system-prompt.ts) creates the final prompt through a deterministic five-step process.

### Step 1: Base Coding-Assistant Description

The foundation is a static text block that establishes the agent's role as a **coding assistant**. This description explains that the model has access to file system tools and should help with software development tasks.

### Step 2: Tool Descriptions

A `toolDescriptions` map is appended, listing each available tool with its purpose:

- **read** – Read file contents
- **bash** – Execute shell commands (ls, grep, find, etc.)
- **edit** – Make targeted edits to files
- **write** – Create or overwrite files
- **grep** – Search file contents for patterns
- **find** – Locate files by glob patterns
- **ls** – List directory contents

### Step 3: Project Context Files

The `loadProjectContextFiles` helper scans the repository for documentation files. It automatically loads and appends content from:

- [`AGENTS.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/AGENTS.md)
- [`CLAUDE.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/CLAUDE.md)
- [`README.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/README.md)
- Any `*.md` files found under the project root

This injects domain-specific knowledge and project conventions into the prompt.

### Step 4: User Override via `--system-prompt`

If provided, the `--system-prompt` flag **completely replaces** the built-in base description while preserving the tool list and project context.

### Step 5: Append via `--append-system-prompt`

Multiple `--append-system-prompt` entries (text strings or file paths) are concatenated to the end of the prompt in order.

---

## Default Prompt Structure Without Flags

When running PrimeAgent without prompt-related flags, the resulting system prompt follows this structure:

```

You are a coding assistant with the following tools:
• read – Read file contents
• bash – Execute shell commands (ls, grep, find, …)
• edit – Make targeted edits to files
• write – Create or overwrite files
• grep – Search file contents for patterns
• find – Locate files by glob patterns
• ls – List directory contents

[Project-specific context from AGENTS.md, README.md, etc.]

```

The exact content can be verified at runtime using the `/system-prompt` slash command.

---

## CLI Examples for Prompt Customization

### Run with Default Prompt

```bash
pi

```

Starts the interactive TUI using the built-in system prompt as defined in [`packages/coding-agent/src/core/system-prompt.ts`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/coding-agent/src/core/system-prompt.ts).

### Override with Custom System Prompt

```bash
pi --system-prompt "You are an expert Python developer. Assist only with Python code."

```

This replaces the coding-assistant base description while keeping tool descriptions and project context.

### Append Additional Instructions

```bash
pi --append-system-prompt "Use only type-safe APIs." \
   --append-system-prompt ./extra-instructions.txt

```

Multiple append flags are processed in sequence. File paths are resolved relative to the working directory.

### Inspect Current System Prompt

```bash
/system-prompt

```

Issued inside the TUI, this prints the complete prompt actually sent to the LLM—useful for debugging prompt construction.

---

## Key Source Files

| File | Purpose |
|------|---------|
| [`packages/coding-agent/src/core/system-prompt.ts`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/coding-agent/src/core/system-prompt.ts) | Contains `buildSystemPrompt` and `loadProjectContextFiles` for prompt assembly |
| [`packages/coding-agent/src/cli/args.ts`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/coding-agent/src/cli/args.ts) | Parses `--system-prompt` and `--append-system-prompt` CLI flags |
| [`packages/coding-agent/src/core/slash-commands.ts`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/coding-agent/src/core/slash-commands.ts) | Registers the `/system-prompt` inspection command |
| [`packages/coding-agent/docs/usage.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/coding-agent/docs/usage.md) | Documents prompt-related CLI options according to the PrimeAgent source code |
| [`packages/coding-agent/README.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/coding-agent/README.md) | Summarizes default prompt behavior and quick-start instructions |

View these files in the PrimeIntellect-ai/prime-agent repository:

- https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/coding-agent/src/core/system-prompt.ts
- https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/coding-agent/src/cli/args.ts
- https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/coding-agent/src/core/slash-commands.ts

---

## Summary

- **PrimeAgent default prompts** are assembled dynamically from a base description, tool catalog, and project documentation files
- The `buildSystemPrompt` function in [`src/core/system-prompt.ts`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/src/core/system-prompt.ts) orchestrates prompt construction in five ordered steps
- **Tool descriptions** are hard-coded and include read, bash, edit, write, grep, find, and ls capabilities
- **Project context** is auto-loaded from [`AGENTS.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/AGENTS.md), [`CLAUDE.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/CLAUDE.md), [`README.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/README.md), and other markdown files via `loadProjectContextFiles`
- **Customization flags**: `--system-prompt` replaces the base, `--append-system-prompt` extends it
- **Inspection**: The `/system-prompt` slash command reveals the exact prompt sent to the LLM

---

## Frequently Asked Questions

### What is the exact text of PrimeAgent's default system prompt?

The base prompt describes the agent as a "coding assistant" equipped with file system tools. The complete text is hard-coded in [`packages/coding-agent/src/core/system-prompt.ts`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/coding-agent/src/core/system-prompt.ts) and combines this description with dynamic tool listings and project context. Run `/system-prompt` in the TUI to see the fully assembled prompt for your session.

### How do I add project-specific instructions without replacing the default prompt?

Use `--append-system-prompt` followed by your text or a file path. This flag can be repeated multiple times and concatenates content to the end of the default prompt. Your instructions will appear after the tool descriptions and any loaded markdown context.

### Why does PrimeAgent load markdown files automatically?

The `loadProjectContextFiles` function scans for [`AGENTS.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/AGENTS.md), [`CLAUDE.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/CLAUDE.md), [`README.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/README.md), and `*.md` files to inject relevant domain knowledge without manual configuration. This lets teams document conventions in version-controlled files that the agent naturally discovers.

### Can I disable the automatic loading of project context files?

There is no dedicated disable flag in the source code. To suppress project context, provide a minimal `--system-prompt` override and avoid placing markdown files in the repository root, or use an empty [`AGENTS.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/AGENTS.md) file.