Skip to the content.

Goose Global Setup

Configure Goose with persistent instructions that apply across all projects and sessions.

What It Does

  1. Creates a persistent instructions file at ~/.config/goose/instructions.md
  2. Registers it in ~/.config/goose/config.yaml via GOOSE_MOIM_MESSAGE_FILE
  3. Instructions are injected into Goose’s working memory every turn, so they can never be forgotten

Prerequisites

Note on Tool Discovery

Previous versions of this skill included “Tool Discovery” instructions to help Goose find devbox/Nix-installed tools at non-standard paths. This is no longer needed if you have configured the goose-shell wrapper (~/.local/bin/goose-shell) and set GOOSE_SHELL in the Goose Desktop .desktop file. The wrapper sources ~/.bashrc before executing commands, which sets up nix, devbox, crc/oc, sdkman, and all other PATH entries automatically — even for non-interactive shells.

See the related files:

Steps

Step 1: Create the instructions file

Create ~/.config/goose/instructions.md with your global instructions:

## Path Hygiene

- **Never use explicit home directory paths** like `/home/<user>/` in scripts, configurations, or output.
- Always use `~` or `$HOME` instead.
- When displaying paths to the user, prefer `~/...` over `/home/<user>/...`.

## Git Push Safety

Before any `git push`, follow these steps **in order**. Do NOT skip
any step, even if the user says "go ahead", "push it", or "yes".

1. **STOP** — do NOT push yet. The user's "go ahead" authorizes the
   *intent* to push, not the push itself. The preflight must run first.
2. **Scan** the commits to be pushed for:
   - Secrets, credentials, API keys, tokens, private keys
   - Hardcoded user paths (`/home/<user>/`, `/Users/<user>/`)
   - PII (personal emails, phone numbers, addresses)
   - Sensitive data (internal IPs, hostnames, URLs)
3. **Present** the evaluation report to the user in table format,
   with a clear CLEAN / ISSUES FOUND verdict.
4. **Wait** for explicit approval **after** the report is shown.
5. **Then** — and only then — execute `git push`.

Add any other cross-project instructions you want Goose to always follow.

Step 2: Register in config.yaml

Add the following line to ~/.config/goose/config.yaml (at root level, alongside other GOOSE_* settings):

GOOSE_MOIM_MESSAGE_FILE: ~/.config/goose/instructions.md

How it works: Goose uses MOIM (Model-Observed Internal Memory) to inject this file’s contents into the model’s context every turn. Changes to the file take effect immediately — no session restart needed.

Step 3: Verify

Start a new Goose session and test that your persistent instructions are active.

Customization

The instructions file supports any Markdown content. Common additions:

## Code Style
- Use `python3` not `python`
- Prefer `pnpm` over `npm`

## Security
- Never upload code to external services
- Always confirm before making network requests

## Git
- Always use `cd <repo-dir> &&` before git commands when CWD differs from the target repo

Persistent Instructions vs goosehints

Feature Persistent Instructions goosehints
When loaded Every turn Session start
Can be forgotten No Yes, as context fills
Best for Critical guardrails Project context
Token cost Per turn Once at start
Update requires No restart Session restart

Key Files

File Purpose
~/.config/goose/instructions.md Persistent instructions content
~/.config/goose/config.yaml Goose config — GOOSE_MOIM_MESSAGE_FILE entry

References

Changelog

See CHANGELOG.md for version history.