Agent
The agent is the core of Codality. It reads your code, makes changes, runs tests, and commits.
How it works
When you start the agent on a ticket, it receives:
- A system prompt composed of: base identity, the ticket kind's methodology, the priority's approach instructions, available tools, and git workflow rules
- The ticket description as the initial user message
- Access to tools for interacting with the codebase
The agent runs in a loop: it reasons about what to do, calls tools, processes results, and repeats until the work is complete.
Tools
The agent has access to these tools:
| Tool | Description |
|---|---|
bash |
Run shell commands (builds, tests, git operations) |
read_file |
Read file contents |
write_file |
Create or overwrite a file |
edit_file |
Search-and-replace within a file (the search text must be unique) |
grep |
Search files with regex patterns |
list_directory |
List directory contents |
get_ticket |
Look up another ticket by number |
search_tickets |
Search for related tickets by text |
memory |
Query project memory: past tickets, plans, agent sessions, reviews |
browser_navigate |
Open a URL in a headless browser |
browser_screenshot |
Take a screenshot of the current page |
browser_eval_js |
Execute JavaScript in the browser |
browser_wait |
Wait for a duration (max 5 seconds) |
browser_resize |
Resize the browser viewport |
web_search |
Search the web for documentation and solutions |
web_extract |
Extract full content from a URL |
Memory
The memory tool gives the agent read-only access to project history. It can query:
- Project overview and recent tickets
- Individual ticket details and timelines
- Past agent sessions and their outcomes
- Plans and plan details
- Code reviews
This lets the agent understand context from previous work. It typically uses this at the start of a session to orient itself.
Git workflow
Each ticket gets a dedicated branch and worktree. The agent:
- Makes atomic commits as it completes logical units of work
- Writes descriptive commit messages prefixed with the ticket number
- Runs tests before the final commit
- Never commits generated files or build artifacts
Real-time streaming
The web UI streams agent activity in real time via Server-Sent Events (SSE). You see:
- Thinking — The agent's reasoning process (displayed with a brain icon)
- Tool calls — Commands executed, files read, searches performed
- Text responses — The agent explaining what it's doing
- Commits — Git commits as they happen
Stopping the agent
Click Stop to interrupt the agent. It stops after completing the current tool call. Any commits already made are preserved in the worktree.
Re-running the agent
You can run the agent multiple times on the same ticket. Each run continues from where the worktree was left — previous commits are preserved. Add comments before re-running to give the agent additional instructions.
Trigger context
When the agent is triggered by external events (CI failure, PR comment, review feedback), it receives a trigger context prepended to its initial message. This context includes the specific failure details, comment text, or review feedback that prompted the run.
See CI Feedback Loop for details on automated triggers.