Augment Code Prompts
Relevant source files
The following files were used as context for generating this wiki page:
Augment Code Prompts define the operational framework for Augment Agent, an agentic AI coding assistant built by Augment Code. The system leverages a high-performance context engine to interface with a developer's codebase, utilizing models such as Claude 4 Sonnet and GPT-5 to perform complex engineering tasks including information gathering, codebase modification, and task management.
Sources: Augment Code/claude-4-sonnet-agent-prompts.txt:1-10, Augment Code/gpt-5-agent-prompts.txt:1-10
Architecture and Identity
The Augment Agent is designed as an autonomous collaborator that integrates directly into the developer's environment. It functions by receiving user requests and metadata, then executing a cycle of information gathering, planning, and editing. The agent identifies itself as a specialized coding assistant with deep access to repository-specific context and history.
Sources: Augment Code/claude-4-sonnet-agent-prompts.txt:12-20, Augment Code/gpt-5-agent-prompts.txt:12-20
Operational Flow
The agent follows a structured lifecycle to ensure code safety and accuracy:
This diagram illustrates the high-level decision path the agent takes when processing a user query, particularly the branch between complex multi-step tasks and trivial edits.
Sources: Augment Code/gpt-5-agent-prompts.txt:28-40, Augment Code/claude-4-sonnet-agent-prompts.txt:30-45
Information Gathering and Retrieval
Before any modifications are performed, the agent must establish a comprehensive understanding of the existing codebase. It utilizes several specialized tools to retrieve symbols, file contents, and historical changes.
| Tool Name | Purpose | Primary Use Case |
|---|---|---|
codebase-retrieval | High-level info gathering | Finding where features (e.g., Auth) are handled |
view | Reading specific files | Examining file structure or specific line ranges |
grep-search | Cross-file text search | Finding all usages or references of a symbol |
git-commit-retrieval | Historical context | Understanding why or how past changes were made |
Sources: Augment Code/gpt-5-agent-prompts.txt:47-110, Augment Code/claude-4-sonnet-agent-prompts.txt:22-28
Retrieval Logic
When preparing to edit, the agent is instructed to ask for ALL symbols at an extremely specific level of detail in a single call to minimize latency and ensure consistency. This includes class definitions, method signatures, and property types involved in the intended change.
Sources: Augment Code/claude-4-sonnet-agent-prompts.txt:75-85
Task Management System
For complex, multi-step tasks, the agent employs a structured task management system. This ensures transparency and allows the user to track progress through a live checklist.
Tasklist Triggers
The agent initiates a tasklist when one or more of the following conditions are met:
- Changes involve multiple files or cross-layer modifications.
- More than 2 edit/verify cycles or 5 info-gathering calls are expected.
- The user explicitly requests a plan or progress tracking.
Sources: Augment Code/gpt-5-agent-prompts.txt:34-43
Task State Transitions
The task management workflow prioritizes incremental updates and batch state changes (e.g., marking one task complete while starting the next).
Sources: Augment Code/claude-4-sonnet-agent-prompts.txt:55-73, Augment Code/gpt-5-agent-prompts.txt:120-145
Code Modification and Safety
Edits are performed using the str_replace_editor (or similar tools) rather than overwriting entire files. This preserves existing formatting and unrelated code.
Mandatory Rules for Edits:
- Conservative Editing: Respect existing codebase patterns and style.
- Symbol Verification: Confirm the existence and signature of all involved constants, classes, and functions before applying changes.
- Dependency Integrity: Always use package managers (npm, pip, cargo, etc.) for dependency changes; manual editing of lockfiles or manifest files (e.g.,
package.json) is strictly prohibited except for complex configurations.
Sources: Augment Code/claude-4-sonnet-agent-prompts.txt:74-84, 91-105, Augment Code/gpt-5-agent-prompts.txt:147-154, 156-173
Snippet Formatting
The agent must use a specialized XML-based format to display code to users:
<augment_code_snippet path="example.py" mode="EXCERPT">
````python
def hello_world():
print("Hello from Augment")
</augment_code_snippet>
Sources: [Augment Code/claude-4-sonnet-agent-prompts.txt:115-130](https://github.com/MKSK-Consulting/system-prompts-and-models-of-ai-tools/blob/HEAD/Augment%20Code/claude-4-sonnet-agent-prompts.txt#L115-L130), [Augment Code/gpt-5-agent-prompts.txt:198-210](https://github.com/MKSK-Consulting/system-prompts-and-models-of-ai-tools/blob/HEAD/Augment%20Code/gpt-5-agent-prompts.txt#L198-L210)
## Verification and Validation
Validation is a critical final step in the Augment workflow. The agent is considered "very good" at writing and iterating on unit tests until they pass.
- **Automated Checks**: Proactively runs tests, linters, and build commands after code changes.
- **Success Criteria**: A solution is only considered complete if the exit code is 0 and logs show no obvious errors.
- **User Permission**: Explicit permission is required for high-risk actions such as committing code, pushing to a branch, or deploying.
Sources: [Augment Code/gpt-5-agent-prompts.txt:180-196](https://github.com/MKSK-Consulting/system-prompts-and-models-of-ai-tools/blob/HEAD/Augment%20Code/gpt-5-agent-prompts.txt#L180-L196), [Augment Code/claude-4-sonnet-agent-prompts.txt:107-113](https://github.com/MKSK-Consulting/system-prompts-and-models-of-ai-tools/blob/HEAD/Augment%20Code/claude-4-sonnet-agent-prompts.txt#L107-L113)
## Summary of Agent Protocols
Augment Code Prompts establish a "simple-first" and "reuse-first" philosophy. The agent prioritizes the smallest possible fix and mirrors existing repository patterns for naming, error handling, and testing to maintain project consistency.
Sources: [Amp/gpt-5.yaml:35-42](https://github.com/MKSK-Consulting/system-prompts-and-models-of-ai-tools/blob/HEAD/Amp/gpt-5.yaml#L35-L42), [Augment Code/gpt-5-agent-prompts.txt:226-230](https://github.com/MKSK-Consulting/system-prompts-and-models-of-ai-tools/blob/HEAD/Augment%20Code/gpt-5-agent-prompts.txt#L226-L230)