Repository navigation
MatrixClaw 0.2.1
The native agent now works on large coding tasks by itself: it knows the
project, edits robustly, checks its own work, can be undone, splits work
across isolated subagents and keeps going on a goal until it is verifiably
done.
Coding agent
- Coding runs (a working directory and tools) get an operating manual:
autonomy, verification after changes, reading before editing, matching the
code's style, git safety, todo discipline, prompt-injection caution. The
manual names only the tools the run has; subagents get the same manual. - Project instructions:
~/.config/matrixclaw/AGENTS.md, thenAGENTS.md
(orCLAUDE.md) and.matrixclaw/instructions.mdfrom the project top down
to the working directory, 32 KiB at most. Runs also get the date, timezone,
client, permission mode, OS and a git snapshot (branch, status, recent
commits) in the context note. readpages within a token budget, cuts very long lines and refuses binary
files.edit/multiedit/writerefuse a file the session has not read or
that changed since; edits fall back from exact matching to indentation-,
whitespace- and quote-tolerant matching with guards, report the closest
lines on a miss, return a numbered snippet and write atomically.apply_patch(Codex patch format, multi-file and all-or-nothing) replaces
edit/multieditfor GPT and Codex models.glob,grepandlsuse one matcher (**/matches zero directories,
braces, classes) and follow.gitignore;grepgained case-insensitive,
context, output modes and paging. A deny rule on a path no longer blocks a
whole search; matches under it are left out.bashresults always state the exit code, keep the head and the tail of
long output, and kill processes the command left behind. Commands, hooks,
MCP stdio servers and language servers no longer inherit provider API keys.- Diagnostics after edits: gofmt and
go vet,tsc, Python compile,cargo checkor JSON parsing, and language servers (gopls, typescript-language-
server, pyright/pylsp, rust-analyzer) when installed, including errors in
other files a change broke. Newlsptool for definitions, references,
hover, symbols and implementations; newrepo_maptool with an Aider-style
ranked map of a code base. - Verification gate: a run that changed files and did not build or test
afterwards is asked once to verify before it ends. - File checkpoints: a shadow git snapshot before each tool batch that may
change files (bash included)./undo,/rewindand thecheckpoint_diff
tool. - Plan mode (
/plan): read-only work, thenexit_plan_modeshows the plan
for approval and switches the session toaccept_edits. - Hooks compatible with the Claude Code protocol (PreToolUse, PostToolUse,
Stop, SubagentStop, SessionStart, PreCompact, Notification) from setup.json
and from a project's.matrixclaw/hooks.jsononce the owner trusts it. - Goals:
/goal <objective> [--check cmd] [--max-runs N] [--tokens N]keeps
starting runs until the model reports the goal complete with evidence, the
check passes and no todo item is open; the same failure three times blocks
it. - Subagents:
agent_type(general,explore,plan,review,verify
and user agents from.matrixclaw/agents/*.mdor
~/.config/matrixclaw/agents/*.md),output_schema,agent_steer.
Worktree children start from the parent's current files, commit to
mc/<task>and are brought back withworktree_mergeor dropped with
worktree_discard. - Session learning: an idle session that did enough work gets one background
review that files quarantined skill drafts and memory suggestions for the
owner to approve (modules.skills.review; on when skills are on).
Reliability
- One retry policy for generations and summaries (6 attempts, server-requested
waits honoured); a reply cut mid-stream is generated again; malformed tool
arguments go back to the model as an error. Provider errors are classified
(rate limit, overloaded, auth, quota, transient), and quota errors are no
longer retried. - The reasoning-text filter no longer cuts replies that mention a tag.
- The loop guard catches failing repeats, two-call cycles and echoed replies.
- One compaction path for runs and
/compact; summaries keep work state,
tests and version-control status, and the files edited last are re-attached
after a summary. - Events are delivered in order; a lagging client is disconnected and reloads
instead of silently missing events. SSE sends a keepalive. - A run's end always notifies waiting parents; blocking subagent calls no
longer fail when the child ends first. - Learned model metadata stays with the provider that listed it. Codex token
refreshes are locked across processes and a 401 refreshes once. - Reload re-applies run budgets, model concurrency, background limits, the
automation timezone and delivery targets. - A memory scope other than global, user or project is refused (400 on the
API) instead of being saved as global. Memory that cannot be read is
logged, and a run is no longer told every entry was removed. - A message sent while a run works (and
agent_steerto a subagent) reaches
the model as a user message before its next step. It used to be appended
to a tool result, where models took it for tool output and ignored it. - The model is told which provider and model it runs on in the context note
next to the newest messages, so after a model switch it no longer repeats
the name an earlier model gave itself. - On Linux a shell command dies with the daemon, so a killed daemon leaves
no command running unseen. - A Go file a language server checked is also checked for gofmt formatting.
Install and service
install.shpiped without a controlling terminal no longer fails when it
starts setup: it says to runmatrixclaw setuplater.uninstall.sh --purgewithout a terminal refuses unless--yesis given, by the same
check.- Without a systemd user session (containers, macOS)
matrixclaw service stop
stops the daemon through its API and waits until it is down,service restartreplaces the running daemon instead of starting a second one the
data lock refused, and a daemon that fails to start is an error with the
end of its log.uninstall.shstops such a daemon before removing the
binaries and reports one it could not stop. - A directly launched daemon runs detached and logs to
~/.local/state/matrixclaw/matrixclawd.log;service logsreads it when
the journal has nothing. - On macOS
install.shanduninstall.sh --purgeuse the directory the
daemon keeps setup.json in (~/Library/Application Support/matrixclaw),
so--purgeremoves the API keys there too. Setup written by v0.2.0 stays
where it is. - A leading
~indaemon.db_path(orMATRIXCLAW_DB_PATH) is the home
directory, not a directory named~. matrixclaw doctorbefore the first start notes the missing api_token and
database as created on first start instead of reporting errors.matrixclaw setup --helpandtui --helpprint usage; an unknownupdate
subcommand is an error.
Security
- Every API route has one policy (
open,owner,session); members and
guests are refused on all session writes in unattended sessions. - Deny rules reach commands run through package runners and wrappers
(npx,pnpm exec,uv run,docker run,sh -c, ...); in-place editors
(sed -i,perl -i) count as risky. - Skills installs run with a timeout, no prompts, the keyless environment and
path checks. - Shell sandbox (
daemon.sandbox, docs/SANDBOX.md):full_autocommands
may write only the working directory, its.git, temporary directories and
package caches; plan mode and read-only children run read-only. It uses
bubblewrap, Landlock or sandbox-exec, whichever works, and/statusshows
which one or that none is available.
Telegram and terminal
/provider(and a session's Model row) picks provider and model in one
go: every configured provider, the current one too, opens its model picker,
which falls back to the setup model and typing a model id when the provider
lists no models. A session's choice no longer rewrites the provider's model
in setup.json. The provider form keeps key, endpoint and options (a model
only for custom providers) and saving it no longer switches the session; the
owner picks Default for new sessions (provider, then model) explicitly,
and the setup wizard has the same row in its provider form. A session
without a model uses its own provider's default, not the active one's.
Upgrade notes (breaking)
-
Back up first, with the daemon running or stopped (see
docs/STORAGE.md):sqlite3 ~/.local/state/matrixclaw/matrixclaw.db ".backup '$HOME/matrixclaw-backup.db'" cp ~/.config/matrixclaw/setup.json ~/setup.json.backup
-
Replace both binaries (
matrixclaw update install, or the installer), then
runmatrixclaw service restartso the running daemon is the new one.
Installs older than v0.2.0 must upgrade through v0.2.0 first. -
The first start converts the database once to a canonical schema
(PRAGMA user_version), keepingmatrixclaw.db.pre-v1next to it, drops
tables and columns nothing reads, then applies migrations 002-007. -
setup.json is converted to version 4 when the new daemon first starts (or a
setup change is saved), keepingsetup.json.pre-v4. From then on unknown
keys and alias values are refused with an error naming them. -
Rollback: stop the daemon, restore
matrixclaw.db.pre-v1over
matrixclaw.db(delete the-wal/-shmfiles) andsetup.json.pre-v4
oversetup.json, then start the old binary. A backup made before the
upgrade works the same way. -
Telegram buttons sent before the upgrade are stale and answer "Unknown
command"; use the command again to get fresh ones. -
Sandbox:
full_autosessions are confined by the shell sandbox as soon as
the host supports it. A session working in~can then write only
temporary directories and caches. Setdaemon.sandbox.modetooffto opt
out. -
The built-in default assistant system prompt is gone. A
system_prompt
saved in setup.json by an older wizard still applies and may contradict the
coding manual; clear it unless you wrote it. -
/providerchanged:/provider <id>opens the provider's models instead of
its settings (/provider edit <id>),/provider usetakes
<session> <provider> <model>, and/provider keyis gone (set the key in
the provider's form or withapi_key_env). Other typed commands changed
too:/modules mcp delete <id>,/tasks bg-output <id>. -
API:
PATCH /v1/sessions/{id}/llmrequiresmodel_id(with an optional
provider_id, else the session's) and no longer saves the owner's choice to
setup.json;GET /v1/sessions/{id}/modelstakes?provider=and reports a
failed discovery inmodels_error. Saving a provider through
PATCH /v1/setup/providers/{id}makes it active only with"active": true
or when no provider is active.GET /v1/approvalsrequiressession_id
(it answered an empty list without one). Sessions lostruntime_id(use
kind); new routes cover checkpoints, hooks, goals and memory approval.
Full history: CHANGELOG.md. Backup and rollback: docs/STORAGE.md.