Run Goose with Ollama: Free Local AI Agent in 30 Minutes
What Goose is
Goose is an open-source AI agent that works instead of just chatting. Give it a goal and it plans the steps, edits files, runs commands and tests, and keeps going until the job is done. Block (the Square and Cash App company) open-sourced it in early 2025, and in April 2026 handed it to the Linux Foundation's Agentic AI Foundation. The repository moved from block/goose to aaif-goose/goose.
It has more than 56,000 GitHub stars, 6,600 forks, and an Apache 2.0 license. The latest release, v1.60.2, shipped on November 20, 2026. It ships as a Rust CLI and a desktop app for macOS, Linux, and Windows, talks to 15+ LLM providers, and gains tools through MCP extensions. For self-hosters, Ollama is a first-class provider, not a compatibility shim.
Why run it locally
Privacy comes first: prompts and code stay on localhost:11434. Cost is second: the whole stack is free, with no per-token bill. Offline work is third: once the model is downloaded, Goose works without a network. The catch: Goose is only as good as the model behind it, and small local models handle tool calling less reliably than frontier ones
What you need
- A Mac, Linux PC, or Windows machine with at least 16 GB of RAM.
- Ollama installed and running.
- A tool-calling model: the default developer extension alone exposes 11 tools, so a model without tool support can only chat.
Good picks: qwen3-coder:30b is the most forgiving local choice for coding, but needs a 24 GB GPU or 32 GB unified-memory Mac. gpt-oss:20b is a solid middle ground at around 14 GB, and qwen3:8b, around 5 GB, is the lightest option that still calls tools.
Step 1: Install Ollama and pull a model
On macOS or Linux, install Ollama with one command:
curl -fsSL https://ollama.com/install.sh | sh
Windows users can grab the installer from the same page. Then pull a model that can call tools:
ollama pull qwen3-coder:30b
Short on GPU memory? Pull qwen3:8b instead. Check that Ollama answers:
curl http://localhost:11434/api/tags
Step 2: Raise Ollama's context window
This is the step that breaks most first attempts. Ollama's default context window is 4,096 tokens, and it truncates silently, so the agent starts forgetting the task halfway through. Tool definitions, file contents, and command output all count against it.
Set the context length before starting the Ollama server:
OLLAMA_CONTEXT_LENGTH=32768 ollama serve
On macOS, where Ollama usually runs as an app, use a Modelfile:
FROM qwen3-coder:30b
PARAMETER num_ctx 32768
ollama create goose-coder -f Modelfile
Either route works.
Step 3: Install Goose
Install the CLI with the official script, using the aaif-goose organization. Older guides still point at block/goose, which redirects:
curl -fsSL https://github.com/aaif-goose/goose/releases/download/stable/download_cli.sh | bash
On macOS, Homebrew works too:
brew install block-goose-cli
Prefer a GUI? The desktop app installs with brew install --cask block-goose, or from the official installation page. Verify the install:
goose --version
Step 4: Point Goose at Ollama
Run the interactive configurator:
goose configure
Choose Configure Providers, then Ollama. Accept the default host http://localhost:11434 unless your Ollama lives on another machine, then enter the model name, for example qwen3-coder:30b. The settings land in ~/.config/goose/config.yaml.
If you prefer environment variables, for scripts or a remote Ollama box, these three do the same job:
export GOOSE_PROVIDER=ollama
export GOOSE_MODEL=qwen3-coder:30b
export OLLAMA_HOST=http://localhost:11434
Note: environment variables override the config file.
Step 5: Your first agent task
Start an interactive session:
goose session
Then give it a real job, not a hello-world. In a project folder, try something like:
Find the function that parses dates in this repo, add unit tests for leap-year edge cases, and run the test suite until it passes.
Goose reads the files, writes the tests, runs them, and reports back. Watch the first run: check which files it touches and whether the tests cover the edge cases.
Goose runs tools without asking by default. To approve each step instead, start it with GOOSE_MODE=smart_approve. List past sessions with goose session list and resume one with goose session --resume.
Step 6: Run headless with goose run
For repeatable jobs, run Goose from a script:
goose run --text "Run the linter, fix every warning, and summarize what changed."
Useful flags: --instructions plan.md runs the task in a file; --no-session runs without saving the session; --max-turns 20 caps turns so a loop cannot run forever; --output-format json gives machine-readable output for scripts and CI. --recipe recipe.yaml runs a saved recipe with typed parameters, retries, and success checks: a repeatable task you can hand to a teammate.
Step 7: Add tools with MCP extensions (optional)
Goose ships with a developer extension for files and shell commands. For more, run goose configure, choose Add Extension, and wire in a community MCP server: a fetch tool, a SQLite or Postgres connector, or a git server. Extensions are shared between the CLI and the desktop app, so configure once.
Troubleshooting
The agent answers with XML instead of doing anything. The model emits tool calls as plain text instead of executing them. Switch to qwen3-coder:30b or gpt-oss:20b.
The agent forgets the task halfway through. The context window ran out. Confirm the model runs with 32K context, not the 4K default (Step 2).
Goose uses the wrong provider or model. Environment variables override the config file. Unset GOOSE_PROVIDER and GOOSE_MODEL, or align them with the config file.
Everything works but slowly. Drop to qwen3:8b, or check Ollama is actually using the GPU. A CPU-only 30B run will crawl.
How Goose compares to the other local coding agents
NewsCarpenter has covered the same idea with OpenCode, Aider, and OpenHands, which all run against Ollama too. Goose differs in three ways: it was built provider-agnostic from day one, so swapping Ollama for Claude or GPT later is a config change; it ships a polished desktop app next to the CLI; and its recipe system treats repeatable tasks as first-class objects.
Which one to pick comes down to taste: Aider is the most focused on pair-programming edits, OpenCode is the most terminal-native, and Goose is the most general-purpose. All three are free and open source, so try Goose for a week on real tasks and keep the one that earns its place.
Bottom line
Goose plus Ollama is the most complete free local agent setup around. The two settings that decide whether it works or flails are the model choice and the context window.


Comments
Post a Comment