mx
A Swiss army knife for Claude Code and multi-agent toolkits.
A Rust CLI providing encoded git operations, a SurrealDB-backed knowledge graph, session archival, GitHub sync, and emotional state tensors. Designed for use with Claude Code, but works with any multi-agent workflow that needs persistent memory, encoded commits, or session management.
Installation
Or from source:
Requires Rust 2024 edition. The binary is named mx.
Quick Start
Encoded Git Commits
mx commit wraps git commit but encodes the message using base-d. The commit title is hashed and the body is compressed, each encoded through a randomly selected dictionary. The result looks like hieroglyphs in git log but decodes cleanly with mx log.
# Stage all and commit with an encoded message
# Stage all, commit, and push
# See what the encoding produces without committing
Decoded Git Log
# Last 10 commits, decoded
# Last 20 commits with full details
Knowledge / Memory
The memory system is a knowledge graph backed by SurrealDB (or embedded SurrealKV). Entries have categories, tags, resonance levels, embeddings, and relationships.
# Search knowledge entries
# Semantic (vector) search
# Add a knowledge entry
# Show a specific entry
# List entries filtered by category
# Statistics
Default categories: pattern, technique, insight, gotcha, reference, decision, bloom, session. Categories are customizable per-deployment -- run mx memory categories list to see available categories.
PR Merge
# Squash merge (default) with encoded commit message
# Rebase merge
# Standard merge commit
Session Archival (Codex)
Archives Claude session JSONL files to permanent storage with transcripts, extracted images, and manifests.
# Archive the current session
# Archive with clean markdown transcript only (no raw JSONL)
# Archive all unarchived sessions
# List archived sessions
# Read an archived session
# Search across all archives
GitHub Sync
Pull and push issues/discussions as local YAML files.
Environment Doctor
Base-d Encoding
Commits made with mx commit look unreadable in raw git log output. This is intentional. The commit message is encoded using base-d:
- Title: A hash of the diff, encoded through a randomly chosen dictionary. The title is a fingerprint, not human text.
- Body: The actual commit message, compressed and then encoded through another random dictionary.
- Footer: A bracket-delimited line indicating which algorithms and dictionaries were used, e.g.
[sha256:ocean|zstd:forest].
If both title and body happen to draw the same dictionary, the footer includes whoa. -- a dejavu marker.
Use mx log to read commits. Use git log if you enjoy puzzles.
Configuration
Key environment variables:
| Variable | Purpose |
|---|---|
MX_MEMORY_PATH |
Override default SurrealDB storage path |
MX_CURRENT_AGENT |
Active agent identity (required for memory wake, used as default for --source-agent) |
MX_SURREAL_MODE |
SurrealDB connection mode (embedded or network) |
MX_CODEX_PATH |
Override default codex archive storage path |
MX_STATE_SCHEMA |
Default tensor schema ID (defaults to crewu) |
MX_USER_NAME |
Display name for user in codex transcripts |
MX_ASSISTANT_NAME |
Display name for assistant in codex transcripts |
Further Documentation
See the project wiki for full documentation on the memory system, encoding details, tensor schemas, and sync workflows.
Status
Published on crates.io. The API surface is evolving.
Licensed under Apache 2.0.