GitLab

Connect a GitLab project so the AI can reference your code and its structure — and so Delivery can open merge requests against it.

Overview

The GitLab Connection gives Hamster two things at once:

  • Read access for the AI. Once connected, the AI can answer questions about the codebase, reference file structure and content when generating Briefs, and ground its suggestions in the project you're actually working on.
  • A delivery target. When you deliver a Brief against a connected GitLab project, Hamster pushes a delivery branch and opens a merge request on it.

GitLab connects with an OAuth grant, not an app install, so one Connection covers whatever the authorizing GitLab user can see. You add another GitLab Connection only if you need to bring in a second GitLab account.

gitlab.com only. Self-managed GitLab instances are not supported.

What It Syncs

  • Files and content — The contents of files in the project at the branch you select, indexed for AI search and context.
  • Repository structure — Directory layout and file organization.
  • Code symbols — Functions, classes, and other named symbols extracted from 27 languages and file formats, the same indexer that backs GitHub.

Each project tracks one branch, which you choose when you connect it.

How to Connect

  1. Go to Workspace Settings > Connections and click the GitLab Repos tile.
  2. A GitLab consent popup opens straight away. There is no Hamster dialog before it and no personal access token to paste.
  3. Approve the authorization on GitLab. Hamster requests a single OAuth scope, api. The read-only scopes would cover indexing on their own, but registering the project webhook that keeps your index fresh needs api.
  4. Hamster returns you to the Connections page and opens the repository picker.
  5. Select projects — Choose which projects to index:
    • Free plan — You can connect 1 repository.
    • Paid plan — You can connect up to 100 repositories.
    • On the free plan, selecting more than one repository offers you an upgrade before you can confirm.

If you cancel on GitLab's consent screen, nothing is connected and Hamster reports "Couldn't connect to GitLab. Please try again." Closing the popup window instead leaves the connect flow waiting, and after about two minutes it times out with the same message. Either way you can start again from the same tile.

Repository Selection and Branches

The picker is the same one GitHub uses. For each project you select, Hamster reads the branch list and lets you pick the branch to track — by default the project's own default branch. Hamster indexes code from that branch.

Confirming the selection records each project and queues its first index. Projects you clear from the selection stop syncing and their indexed content is removed, without affecting the Connection itself.

A brand-new project with no commits yet is selectable and connects normally. The first sync finds nothing to index and succeeds anyway, and the first push you make to the project is picked up and indexed like any other change.

Keeping the Index Fresh

Hamster registers a push webhook on each connected project, so a push re-indexes the project instead of waiting for a scheduled pass.

Registering the hook needs Maintainer on the project. Without it, GitLab refuses the registration; Hamster records that and leaves the project to the 15-minute reconciliation sweep, which re-checks every connected repository. The sweep is a scheduled retry, not a guarantee — it keeps a project current where it still has access, it affects only that project, and it picks changes up less promptly than the hook would.

Connection Health

The connected GitLab card shows how many repositories are connected and a rollup of indexing state across them: Indexing, Embedding, Indexed, Index stale, or Sync failed. A failed sync surfaces the reason so you can act on it.

If the OAuth grant expires or you revoke Hamster's access in GitLab, the card reads "Reconnect to continue syncing." Re-authorize from the connect tile and the new grant replaces the old one in place — your project selections are preserved.

Managing the Connection

Click the connected GitLab card to reopen the repository picker. Unlike GitHub, there is no installation to configure on GitLab's side and no Manage on GitLab link — an OAuth grant reaches whatever the authorizing user can see, so the project selection is the thing you manage from Hamster.

To stop indexing a project, clear it from the selection. To change which branch a project tracks, reopen the picker and choose a different one.

Delivery and Merge Requests

Delivering a Brief against a connected GitLab project pushes the delivery branch and opens a draft merge request. It stays a draft when the run finishes — mark it ready yourself when you want reviewers on it. If a merge request is already open for that branch, Hamster reuses it instead of opening a second one.

Delivery pushes with the OAuth grant that connected GitLab, so the merge request is opened by the GitLab account that authorized the Connection. Commits are authored as Hamster Agent.

The merge request is linked back to the Brief that produced it. On the Brief, the delivery control reads Open Merge Request before one exists, then becomes a state pill — Draft, Open, Merged, or Closed — linking out to the merge request on GitLab.

Review on a Merge Request

Review reads a delivered GitLab merge request the same way it reads a GitHub pull request: the file diffs, the discussion threads, the pipeline results, and the approve / request-changes controls all work against GitLab. Sign in with GitLab from Review so your comments and approvals post as you instead of sitting in Hamster. Three differences come from GitLab's own model, not from Hamster:

  • Request changes removes your approval and posts a note. GitLab does not track a review decision separately, so requesting changes withdraws your approval on the merge request and leaves your explanation as a discussion note — which is why the comment is required here. The decision still reads as Changes requested inside Hamster.
  • Decisions made on GitLab come back as approvals only. GitLab tells Hamster when a reviewer approves or withdraws an approval, and nothing else — so a review someone writes on GitLab itself appears as an approval or a discussion note, never as a Changes requested or Commented decision.
  • Pipeline checks carry a result and a link, not the output. GitLab pipelines report as Pending, Passing, or Failing with a link out to the pipeline; unlike GitHub's checks, there is no returned output to expand inline.

Importing Skills

Import skills from repo reads SKILL.md files out of a connected repository and adds them to your Skills library. It works with any connected code provider, so a GitLab project can be the source.

Tips

  • Track the branch you develop on — usually main or develop, not a feature branch.
  • Ask for Maintainer on the projects that matter. Without it the push webhook cannot be registered and the project falls back to the periodic sweep, so changes take longer to show up in the AI's answers.
  • Connecting a project indexes it, it does not run it. Indexing reads and references the code for context; running code is Delivery's job, not the Connection's.
  • Pair GitLab with Linear or Jira so the issue and the code that addresses it are both in reach when you ask.
  • You can connect GitHub and GitLab side by side. They are separate Connections with separate repository selections.

Related