Skip to content

Setup Guide

Prerequisites

Installation

The fastest path is the one-liner:

curl -fsSL https://raw.githubusercontent.com/wiktordepina/mait-code/main/scripts/bootstrap.sh | bash

This installs uv if missing, clones the latest release tag to ~/.local/share/mait-code/source/, runs uv tool install, then execs mait-code install to set up symlinks, settings, and data directories. Idempotent — a re-run keeps your settings, data and edited templates, though mait-code update is the usual way to upgrade.

Flags

Pass flags via bash -s --:

curl -fsSL https://raw.githubusercontent.com/wiktordepina/mait-code/main/scripts/bootstrap.sh \
    | bash -s -- --embedding-provider bedrock --ref v0.89.0
Flag Default Purpose
--embedding-provider local\|bedrock the configured provider, else local Forwarded to mait-code install when given. On a re-run, leave it off to keep the current provider (and its [bedrock] extra).
--ref <tag\|branch\|sha> latest v* tag Checkout this ref after cloning. main for bleeding edge.
--dir <path> ~/.local/share/mait-code Install root. Source goes in <dir>/source.
--no-uv off Don't try to install uv (fail if not on PATH).
--repo-url <url> upstream repo Override the clone source (mainly for testing).
--help — Print usage.

Inspect before running

curl … \| bash requires trusting the URL. To audit the script first:

curl -fsSL https://raw.githubusercontent.com/wiktordepina/mait-code/main/scripts/bootstrap.sh \
    -o /tmp/mait-code-bootstrap.sh
less /tmp/mait-code-bootstrap.sh
bash /tmp/mait-code-bootstrap.sh

From a local clone

If you're developing mait-code itself or want the source in a specific location:

git clone https://github.com/wiktordepina/mait-code.git
cd mait-code
uv sync
./scripts/install.sh

./scripts/install.sh is a thin shim around mait-code install. For non-interactive installs (e.g. CI, automation), invoke the CLI directly:

uv tool install . --force --reinstall --python 3.13
mait-code install --from "$PWD" --embedding-provider local

mait-code install performs:

  1. Validates the source path is a mait-code clone.
  2. Creates ~/.claude/mait-code-data/ with memory subdirectories (memory/observations/, memory/reflections/).
  3. Copies identity templates (soul_document.md, user_context.md, communication_style.md) and the files skills read on demand (writing_style.md, testing_strategies.md) — never overwrites a file you have edited. An untouched copy of an older template is replaced with the current one.
  4. Bootstraps memory/MEMORY.md with a placeholder if missing.
  5. Symlinks CLAUDE.md into ~/.claude/ (backs up any existing file to CLAUDE.md.backup).
  6. Symlinks every skills/* directory into ~/.claude/skills/.
  7. Symlinks any agents/* files into ~/.claude/agents/.
  8. Writes the centralised settings file at $XDG_CONFIG_HOME/mait-code/settings.toml with all configuration values (including the chosen embedding provider).
  9. Propagates settings as MAIT_CODE_* env vars and merges hook registrations into ~/.claude/settings.json (preserving any pre-existing keys). When the mods setting is on, also registers the companion mod.
  10. Writes the install record at $XDG_DATA_HOME/mait-code/install.json (default ~/.local/share/mait-code/install.json).

Lifecycle

Once installed, the mait-code binary owns the full install lifecycle. Its subcommands cover the common cases:

mait-code status            # read-only summary with a health badge, first-install
                            # and last-update dates (use --json)
mait-code doctor            # run the health checks; --fix applies safe fixes (--json)
                            # --llm adds one real nested model call
mait-code settings          # edit config interactively (lists when piped)
mait-code settings list     # read-only view of the active config (use --json)
mait-code settings get log-level         # one resolved value and its source (--json)
mait-code settings set log-level DEBUG   # validate, persist, enforce one knob
mait-code settings unset env.FOO         # drop a custom [env] variable
mait-code update            # fetch, advance, reinstall if HEAD moved
mait-code uninstall         # remove symlinks, settings file and the uv tool;
                            # preserves data by default
mait-code uninstall --purge-data   # also delete the data directory
mait-code version           # print the installed version

doctor --fix currently repairs four findings: dangling symlinks, a missing data directory, missing embeddings, and a missing or stale embedding-model record (re-embedding when the stored vectors came from another model). The rest it reports.

uninstall also runs uv tool uninstall mait-code, which removes the mait-code binary itself — pass --keep-uv-tool to leave it in place.

The TUI surfaces are separate subcommands:

mait-code                   # the home hub on a terminal; help when piped
mait-code home              # the home hub explicitly
mait-code board             # kanban board
mait-code board --initiatives   # the board, opened on its Initiatives view
mait-code memory            # memory browser
mait-code review            # the memory review queue
mait-code observations      # observations browser
mait-code graph             # knowledge-graph explorer
mait-code logs              # log viewer

The Bridge configurator and the start-page editor have no subcommand of their own — they open from the home hub.

The install-lifecycle commands (install, update, uninstall, status, doctor) accept --claude-dir, and all but update accept --data-dir, for non-default layouts. The TUI subcommands, settings and version take neither. Coloured output can be disabled with the global --no-color flag. See the CLI reference for full per-command flag tables, behaviour notes, and exit codes.

Personalisation

After installation, edit these files to customise your companion:

Soul Document (~/.claude/mait-code-data/soul_document.md)

Defines the companion's identity — its values and personality. Key sections to personalise:

  • Core Values — Pick 3-5 values that matter to you (defaults provided)
  • Personality — Set the tone for how the companion develops over time
  • Constructive Challenge — How pushback should feel

User Context (~/.claude/mait-code-data/user_context.md)

Tells the companion about you:

  • Identity — Name, role, timezone
  • Technical Environment — Languages, infra, CI/CD, IDE
  • Working Style — Commit conventions, review prefs, testing approach
  • Current Projects — What you're working on

Fill in what's relevant, delete what isn't. The observation system will suggest additions over time.

Communication Style (~/.claude/mait-code-data/communication_style.md)

Shapes how responses are written:

  • Basics — Length, clarification, handling mistakes
  • Attention Markers — A small set of inline markers (❓ ⛔ ❗ ⚠️ 💭 ✅) that make whatever needs you easy to spot
  • Side-effect Markers — A closing block listing what changed (📝 files written, 🔧 anything else with a lasting effect)
  • Shaping Rules — When to number steps, how side issues are raised, restating progress on multi-step work

Drop the markers, add your own, or rewrite it entirely — it's your copy.

Writing Style (~/.claude/mait-code-data/writing_style.md)

The rules /outward-comms applies to text written on your behalf for other people: PR and review comments, commit messages, issue comments, chat, email and committed docs. No em dashes, plain characters in prose (glyphs only where they carry structure), no AI clichés, concise and direct, and your spelling convention.

Unlike the files above it isn't loaded into every session: the skill reads it each time it runs, so an edit takes effect the next time you use it. The home hub shows it at the end of Identity ▸ System prompt, outside the session-start total. Install seeds it once and never overwrites your edits.

Testing Strategies (~/.claude/mait-code-data/testing_strategies.md)

The ways a card's work can be tested. When the board skill refines a card, it reads this file and writes a Testing strategy section into the description, naming the strategies that fit and what each will check; /work runs exactly those at its test step. It ships with unit (the project's own test suite) and manual (a scripted check on a throwaway target).

Add the environments you test in, each as a ## heading with what it proves and how to run it. A Projects: line under the heading limits a strategy to the projects it names; without one, it's offered everywhere. Like the writing style, it's read on demand rather than at session start, and shown at the end of Identity ▸ System prompt.

Verification

After installation, verify everything works:

# Check CLAUDE.md symlink
ls -la ~/.claude/CLAUDE.md
# Should point to → ~/.local/share/mait-code/source/config/CLAUDE.md
# (or your clone's config/CLAUDE.md for a development install)

# Check data directory
ls ~/.claude/mait-code-data/
# Should contain: soul_document.md  user_context.md  communication_style.md  writing_style.md  testing_strategies.md  memory/

# Check settings
cat ~/.claude/settings.json | python3 -m json.tool
# Should contain mait-code hooks

# Verify the memory CLI tool works
mc-tool-memory stats
# Should print "No memories stored yet." on fresh install

# Check skills are symlinked
ls -la ~/.claude/skills/recall/
# Should point to → ~/.local/share/mait-code/source/skills/recall

# Start Claude Code — companion context should load
claude
# Try: /recall test  (should return "No memories found" on fresh install)

Updating

Use the built-in updater:

mait-code update

It fetches, advances the source clone, and reinstalls only if HEAD actually moved — then refreshes symlinks, merges settings changes, and brings the identity templates up to date the same way install does: missing files are created and untouched copies of older templates are replaced, but edited files are left alone. That step runs the code update started with, so a template shipped in the release being installed lands on the following update. Useful flags: --ref to advance to a specific branch or tag, --no-pull to reinstall from the clone as-is, and --force to reinstall even when nothing moved.

Do not git pull a bootstrap install. The clone at ~/.local/share/mait-code/source is pinned to a release tag in detached HEAD, where git pull fails outright — resolving that is exactly why update exists.

From a development clone you can still update by hand:

cd /path/to/mait-code
git pull
./scripts/install.sh

Because CLAUDE.md is a symlink, Claude Code always reads the latest config either way.

Troubleshooting

Start here: mait-code doctor --fix. It runs 16 checks covering the install record and source clone, the settings file and its values, the [env] table, hook registration, hooks-on-PATH, symlinks, the data directory, the embedding record, memory embeddings, vector search, the observe pipeline, the Bridge, the companion mod and uv — and repairs the four it safely can. --llm adds a seventeenth that makes one real nested model call. mait-code logs (or $XDG_STATE_HOME/mait-code/mait-code.jsonl) shows what actually happened.

If a specific symptom persists:

CLAUDE.md not loading: Check that ~/.claude/CLAUDE.md is a valid symlink (ls -la ~/.claude/CLAUDE.md). doctor --fix repairs dangling symlinks.

Hooks not firing: Verify ~/.claude/settings.json contains the hook definitions. Check that mc-hook-session-start works from the command line — the hooks-on-path check covers this case.

Memory tool not working: Run mc-tool-memory stats to verify. The memory-embeddings and vector-search checks cover degraded search.

Python version mismatch: Run uv python install 3.13 to ensure Python 3.13 is available.

Stale install: mait-code update — see Updating.