Claude on Rails - Tooling System for Claude Code.
Not an official Anthropic tool.
- Memory - Solutions persist across sessions with semantic search
- Code Index - Fast navigation for 15 languages (TS, JS, Python, Go, Rust, Java, C, C++, etc.)
- Repomix - Pack external repos for context with token-efficient two-phase flow
- Warnings - Track problematic files and packages
- Hooks - Auto-approve tools, sensitive file detection, session analysis, package auditing
- Context7 - Up-to-date documentation for 100+ libraries
- Doctor - Comprehensive diagnostics with auto-fix
- Optimized - Compact JSON, Haiku-delegable tools, MCP annotations
- Auto-Approve Hooks - Read-only tools approved automatically (configurable)
- Sensitive File Detection - Warns on
.env,.pem,secrets/, etc. - Session Analysis - Extracts insights before context compaction
/matrix:doctor- Diagnose and auto-fix common issues- Config Moved - Now at
~/.claude/matrix/matrix.config(auto-migrated)
See CHANGELOG.md for full details.
/plugin marketplace add ojowwalker77/Claude-Matrix
/plugin install matrix@ojowwalker77-Claude-Matrix
Requires Bun v1.0+ and Claude Code v2.0+.
Navigate to /plugin → Marketplaces tab → Select Update marketplace:
Note: The update mechanism in Claude Code has known quirks. Updates may not take effect immediately—sometimes requiring a restart, cache invalidation (#14061), or multiple attempts. This is a Claude Code limitation, not Matrix.
Claude learns from your solutions and mistakes:
You solve a problem
↓
Matrix stores it with semantic embeddings
↓
Next time you face something similar, Matrix recalls it
↓
Feedback improves rankings over time
| Tool | Purpose |
|---|---|
matrix_recall |
Search for relevant solutions |
matrix_store |
Save a solution for future use |
matrix_reward |
Feedback on recalled solutions |
matrix_failure |
Record errors and fixes |
matrix_status |
Memory statistics |
Multi-language code navigation (auto-indexed on session start):
Supported Languages: TypeScript, JavaScript, Python, Go, Rust, Java, Kotlin, Swift, C#, Ruby, PHP, C, C++, Elixir, Zig
| Tool | Purpose |
|---|---|
matrix_find_definition |
Find where a symbol is defined |
matrix_search_symbols |
Search symbols by partial name |
matrix_list_exports |
List exports from file/directory |
matrix_get_imports |
Get imports for a file |
matrix_reindex |
Manually trigger reindexing |
Grammars are downloaded on first use (~1-2MB per language) and cached locally.
Track problematic files and packages:
| Tool | Purpose |
|---|---|
matrix_warn_check |
Check if file/package has warnings |
matrix_warn_add |
Mark something as problematic |
matrix_warn_remove |
Remove a warning |
matrix_warn_list |
List all warnings |
Pack external repositories for context with minimal token consumption:
Phase 1: Index repo (free) → suggest relevant files
↓
Phase 2: User confirms → pack selected files (tokens)
| Tool | Purpose |
|---|---|
matrix_repomix |
Pack external repos with semantic file selection |
Supports GitHub shorthand (owner/repo) or local paths. Smart exclusions for tests, docs, node_modules.
Up-to-date library documentation (bundled):
| Tool | Purpose |
|---|---|
resolve-library-id |
Find library ID for docs |
query-docs |
Get current documentation |
| Tool | Purpose |
|---|---|
matrix_doctor |
Run diagnostics and auto-fix issues |
Matrix runs automatically in the background:
| When | What Happens |
|---|---|
| Session starts | Initialize database, index code files (15 languages) |
| Permission requested | Auto-approve read-only tools (configurable) |
| You send a prompt | Analyze complexity, inject relevant memories |
| Before reading a file | Warn if sensitive (.env, keys, secrets) |
Before npm install |
Check for CVEs, deprecation, bundle size |
| Before editing a file | Warn if file has known issues |
| Before web fetch | Intercept library docs → use Context7 instead |
| Before context compaction | Analyze session, save insights |
| Session ends | Offer to save significant solutions |
| Command | Purpose |
|---|---|
/matrix:search <query> |
Search solutions |
/matrix:list |
List stored solutions |
/matrix:stats |
Show statistics |
/matrix:warn |
Manage warnings |
/matrix:export |
Export database |
/matrix:verify |
Check installation |
/matrix:reindex |
Reindex repository |
/matrix:repomix |
Pack external repo for context |
/matrix:doctor |
Run diagnostics and auto-fix |
- Compact JSON - All tool outputs use compact JSON (~10-15% token savings)
All 18 tools include official MCP hints for smarter handling:
| Annotation | Tools | Meaning |
|---|---|---|
readOnlyHint |
11 | No side effects, just queries |
idempotentHint |
6 | Safe to retry on failure |
destructiveHint |
1 | Deletes data (warn_remove) |
openWorldHint |
1 | External API (repomix) |
13 tools marked as delegable for sub-agent routing via MCP server instructions:
matrix_recall, matrix_reward, matrix_status
matrix_warn_check, matrix_warn_add, matrix_warn_remove, matrix_warn_list
matrix_find_definition, matrix_search_symbols, matrix_list_exports, matrix_get_imports
matrix_index_status, matrix_reindex
These are read-only/simple operations - the model just passes parameters, server does the work. Non-delegable tools (matrix_store, matrix_failure, matrix_prompt, matrix_repomix, matrix_doctor) require Opus reasoning.
Example: Haiku 4.5 sub-agent executing matrix_recall:
Matrix creates config at ~/.claude/matrix/matrix.config on first run:
{
"indexing": {
"enabled": true,
"excludePatterns": [],
"maxFileSize": 1048576,
"timeout": 60,
"includeTests": false
},
"hooks": {
"enabled": true,
"permissions": {
"autoApproveReadOnly": true,
"autoApprove": {
"coreRead": true,
"web": true,
"matrixRead": true,
"context7": true
}
},
"sensitiveFiles": {
"enabled": true,
"behavior": "ask"
},
"preCompact": {
"enabled": true,
"behavior": "suggest"
}
}
}~/.claude/matrix/
├── matrix.db # SQLite database
├── matrix.config # Configuration file
├── models/ # Embedding model cache (~23MB)
├── grammars/ # Tree-sitter WASM grammars (downloaded on demand)
├── session-analysis.jsonl # PreCompact logs
└── .initialized # Version marker
All data stays local. No external API calls for memory. Package auditing uses public APIs (OSV.dev, npm, Bundlephobia).
git clone https://github.com/ojowwalker77/Claude-Matrix
cd Claude-Matrix
bun install
bun run build
bun testTest locally:
claude --plugin-dir /path/to/Claude-MatrixWant to contribute? Check CONTRIBUTING.md first.
What we don't accept:
- Windows compatibility (can't test it)
- Features without a clear win
- High bloat for marginal gains
Core principle: Increase the chance and speed for Claude Code to deliver the First Satisfying Answer - not first-whatever-slop.
Submit issues and PRs using our templates.
Don't agree with how Matrix works? Fork it and make it yours:
Ask Claude: "Fork Claude Matrix using docs/reference-for-llms.md
and customize it for my workflow"
The reference-for-llms.md contains everything Claude needs to understand, customize, and help you self-host your own version through your own plugin marketplace.
MIT
