Skip to content
AlbertCode SWE

Using the agents

Configuration

Connect a model, keep keys safe, set a repository's limits with a contract, and extend the agents with custom commands, agents and MCP servers.

Both agents are configured from inside themselves — slash commands in the terminal, menus in the browser — and keep what they learn about a repository in files you can read and commit.

Models

The agent handles the engineering workflow: the plan, the isolated copy, the tests, the reviews and the approvals. The model you choose does the reasoning. You can change models at any time, even between two tasks in the same session.

Provider Connect with
Hosted model providers (OpenAI, Anthropic and others), Kimi An API key
OpenRouter An API key: many vendors' models through one account
Hugging Face A token, for open-weight models
Any compatible API service Its address, and a key if it needs one
A model on your own machine Its server's address: Ollama, LM Studio, vLLM (AlbertCode SWE Agent) or llama.cpp (mini-AlbertCode), among others
To Terminal Browser
Connect a provider /connect Connect a provider
Choose a model /model The model chip, or Alt M

In AlbertCode SWE Agent, /disconnect removes a saved key and /disconnect all removes every key (Settings… → Providers in the browser).

The key or address is checked before it is saved, and a provider is shown as connected only once that check has passed.

Local models

Start your model server, then connect it by address. The usual addresses:

Server Address
Ollama http://localhost:11434/v1
LM Studio http://localhost:1234/v1
vLLM http://localhost:8000/v1

With a local model, your code never leaves your computer.

What a model needs

The model must support tool calling reliably: that is how it reads files, runs tests and makes changes. Most current hosted models do; among local models, results vary with size and quantisation. Check one before relying on it:

Terminal
albertcode models test      # or: albert-mini models test

How much the model thinks

Agent Setting Values
AlbertCode SWE Agent Pace — /pace fast or /pace thorough thorough (default) runs an independent security review and quality review on every governed change; fast skips the reviews, for about half the model calls. The checks, the contract and both approvals apply at either pace
mini-AlbertCode SWE Agent Speed — Settings, or /speed Fast (default) answers and reviews sooner and plans and builds as deeply as ever; Thorough thinks longest at every step

Keys and privacy

  • Keys are kept by your operating system: the macOS Keychain, Windows data protection, or your Linux desktop keyring. Without a keyring (servers, containers, SSH sessions) they go in a file only your user can read.
  • A key goes only to the provider it belongs to, is never shown again, and is never given to the commands a task runs.
  • If a saved key turns up in a file or command output, AlbertCode SWE Agent masks it before anything goes to the model.
  • There is no telemetry and no account.

The repository contract

AlbertCode SWE Agent. A repository can carry a contract that sets what AlbertCode may do there: which paths a change may touch and how big it may be, which commands may run, which checks must pass, which reviews are required, and who may approve. With no contract, sensible defaults apply: a change keeps to the files its plan named, files that look like secrets are never changed, credentials are never written into files, and both reviews run.

AlbertCode reads the first of these at the repository root: albertcode.contract.toml, albertcode.contract.json, .albertcode/contract.toml, .albertcode/contract.json. It is read from your repository, never from the isolated copy, so a task cannot widen its own limits.

TOML
version = 1
name = "shop"

[scope]
forbidden_paths = ["src/payments/**", "infra/**", "**/migrations/**"]
max_files_changed = 15

[verification]
required = true
must_pass = [["npm", "test"]]

[approvals]
require_admin_for_risk = ["high"]

Commit it, and a plan that wants to touch src/payments is refused at once, a change that fails npm test cannot be accepted, and a high-risk plan waits for an administrator.

You don't have to write it by hand: /contract (or Contract and memory… in the browser) drafts one from a description, shows it in full, and saves it when you say so. Every saved version is kept and can be restored.

Section Enforced
[scope] Twice: a write outside it is refused as it happens, and the whole change is checked again before you can accept it
[commands] allowed and forbidden narrow the built-in command list; run grants extra ones. forbidden always wins; every command runs with no shell, a scrubbed environment and a time limit
[verification] The must_pass commands must succeed in the isolated copy before the change can be accepted
[review] Which reviews run, and how severe a finding must be to block
[approvals] Whether the requester may also approve, which risk levels need an administrator, and whether a blocked change can ever be accepted with a recorded reason
[obligations] Engineering rules checked on every plan and change, such as forbid_new_dependencies and forbid_secret_paths
[extensions] Which tools and skills may be switched on in this repository

The full format is in docs/contract.md.

Custom commands

A command is a prompt you write once and call by name — a Markdown file. Both agents support them.

Markdown
---
description: Review a file for correctness bugs
agent: reader          # optional: run as this custom agent
mode: ask              # optional: ask, governed or direct
argument-hint: <file>
---
Review $ARGUMENTS for correctness bugs, not style. Start with $1.

Saved as .albertcode/commands/review.md, it is /review. Keep commands in .albertcode/commands/ in a repository (shared when you commit it) or in commands/ in your settings folder (every repository, for you only). $ARGUMENTS is everything typed after the command; $1 to $9 are its words. A command is text: running one runs no program — it is sent as your own message, and the mode and approvals apply as if you had typed it.

Custom agents

An agent is a role a task works as. It can only narrow what the agent may do, never widen it.

Markdown
---
description: Reads and reports; never edits
tools: read, run
---
You are reviewing someone else's change. Find correctness bugs, with file and line.

Keep agents in .albertcode/agents/ or in agents/ in your settings folder; choose one with /agent. With no tools line, an agent changes only the instructions. An agent that cannot edit answers questions only.

AlbertCode SWE Agent also has saved tools, skills and plugins — see docs/extending.md.

MCP servers

Both agents can use MCP servers: outside tools such as Git, browsers, databases and your company's services. The quickest way is the connectors gallery (/connectors or /mcp in AlbertCode SWE Agent; albert-mini mcp connectors in mini-AlbertCode). To add any server:

Terminal
# A local server: a command the agent starts, with its variables
albertcode mcp add docs --command "npx -y @example/docs-mcp" --env DOCS_TOKEN=xyz

# A remote server that signs you in with OAuth (a browser window opens)
albertcode mcp add tracker --url https://mcp.example.com/mcp

mini-AlbertCode uses the same shape: albert-mini mcp add NAME --command "…" or --url URL. Remote sign-ins ask only for the scopes the server names, and tokens are kept in your system's key store. What an MCP server's tools are given goes to that server.

Environment variables

AlbertCode SWE Agent:

Variable Effect
ALBERTCODE_SURFACE ui makes albertcode open the browser by default; terminal keeps it in the terminal
ALBERTCODE_CLASSIC 1 opens the classic terminal instead of the full-screen one
ALBERTCODE_API_KEY The key for a shared AlbertCode service (as --api-key)
ALBERTCODE_CLIENT_TIMEOUT_SECONDS How long the terminal waits for the service to answer
HTTPS_PROXY, HTTP_PROXY, NO_PROXY Your network's proxy, for reaching your model provider

Where things are kept

In your repository — yours to read, edit and commit: custom commands and agents in .albertcode/commands/ and .albertcode/agents/. AlbertCode SWE Agent also keeps the contract, .albertcode/requirements.json, .albertcode/memory.md (what it has learned about the repository) and .albertcode/skills/ there.

On your computer, outside the repository:

AlbertCode SWE Agent mini-AlbertCode SWE Agent
macOS ~/Library/Application Support/AlbertCode SWE Agent ~/Library/Application Support/mini-AlbertCode SWE Agent
Linux ~/.local/share/AlbertCode SWE Agent (data), ~/.config/AlbertCode SWE Agent (settings) ~/.local/share/mini-AlbertCode SWE Agent, ~/.config/mini-AlbertCode SWE Agent
Windows %LOCALAPPDATA%\AlbertCode SWE Agent, %APPDATA%\AlbertCode SWE Agent %LOCALAPPDATA%\mini-AlbertCode SWE Agent, %APPDATA%\mini-AlbertCode SWE Agent

These hold task history, sessions, the isolated copies and settings. uninstall --all removes them.

A guide written for this site, covering both agents. For every command and setting, see the full reference for AlbertCode SWE Agent and mini-AlbertCode.