Background Agents

Assign a task to an AI coding agent and let it work on the implementation while you focus on something else.

This feature may need to be enabled for your workspace.

Overview

Background agents let you hand off implementation work from a task directly to an AI coding agent. You select a task, point the agent at your repository, and it runs autonomously — reading the task description, understanding the codebase, writing code, and opening a pull request when it's done. You don't need to wait for it to finish. The agent works in the background and reports status back as it progresses.

This is designed for teams that want to move from a written brief and task list to working code without manual hand-off steps. Once your plan is generated and tasks are defined, individual tasks can be delegated to a background agent for execution.

How It Works

  1. Select a task — Navigate to a task in a brief's task list. Background agents work at the individual task level. The task's title, description, acceptance criteria, and any subtasks are all passed to the agent as context.

  2. Configure the run — Specify the repository URL and branch the agent should work from. You can optionally set the target branch name for the pull request and provide additional context instructions for the agent.

  3. Launch the agent — The agent starts working immediately. Hamster records the run and begins receiving status updates from the agent provider as the run progresses.

  4. Track progress — The task view shows the current agent run status. When the agent completes, it opens a pull request in your repository. The run record in Hamster links to the PR so your team can review the work.

What the Agent Receives

When you launch a background agent for a task, it receives:

  • The task title and full description
  • The brief document content, giving the agent the full project context
  • Any subtasks, which the agent treats as implementation steps
  • The repository and branch to work from
  • Your additional context instructions, if provided

The agent uses this to understand not just what to build, but why — which leads to more contextually appropriate implementation decisions.

Agent Run States

Each run moves through a set of states that Hamster tracks and displays:

  • Pending — The run has been created and the agent is starting up
  • Running — The agent is actively working in the repository
  • Completed — The agent finished and opened a pull request
  • Failed — The agent encountered an error; the run record includes details
  • Cancelled — The run was cancelled before completion

Only one background agent run can be active for a given task at a time. If you try to launch a second run while one is in progress, you'll need to wait for it to finish or cancel it first.

Setting Up Background Agents

Background agents require an API key for the agent provider connected to your workspace. The key is stored securely in your workspace vault and used to authenticate agent launch requests.

To configure:

  1. Go to your workspace settings and find the Background Agents section
  2. Add your agent provider API key
  3. Enable the configuration

Once configured, the option to launch a background agent becomes available on any task in your workspace.

Key Capabilities

  • Full task context: The agent reads the brief document alongside the task, so it understands the broader project before writing any code.

  • Pull request creation: By default, the agent opens a pull request when it finishes. The PR is linked back to the task run in Hamster.

  • Real-time status updates: The task view stays current as the run progresses, without manual refreshing.

  • Run history: Each agent run is recorded with its status, timestamps, and outcome. You can review the history of runs on a task over time.

  • Non-blocking: Launching an agent doesn't block you in any way. Close the tab, work on something else, or start another session — the agent continues running independently.

Tips

  • Write clear, specific task descriptions before launching an agent. The more precisely the acceptance criteria are written, the better the agent's output will be.
  • Add subtasks to break down the implementation into discrete steps. The agent uses subtasks as an implementation guide.
  • Use the additional context field to provide constraints the agent should follow: "use the existing authentication middleware," "follow the patterns in the users module," "avoid changing the database schema."
  • Check the pull request carefully before merging. Background agents are capable, but code review remains important — especially for tasks with security implications or complex integration points.
  • If a run fails, check the run details for an error description. Common causes include repository access issues or ambiguous task instructions that the agent couldn't resolve.

Related