PitchHut logo
Claude-Matrix
Claude on Rails - Tooling System for Claude Code.
Pitch

Claude-Matrix empowers Claude Code by providing a persistent memory system that learns from past experiences. With features like semantic search, local embeddings, and a reward system, it helps coders to quickly recall solutions, learn from failures, and build knowledge all within a streamlined, offline environment.

Description

Why Matrix?

Claude Code is exceptional at coding. Matrix makes it exceptional at everything else—remembering what worked, navigating codebases, catching bad dependencies, and turning insights into reusable skills.

Without MatrixWith Matrix
Solutions forgotten next sessionMemory recalls what worked before
Grep/find for symbol locationsCode Index finds definitions instantly (15 languages)
Bad packages discovered too lateWarnings + CVE checks catch them first
Library docs out of dateContext7 provides current documentation
Good solutions stay buriedSkill Factory promotes them to reusable Skills
Changes break unknown callersBlast Radius shows impact before you commit
Need context from external reposRepomix packs them with semantic file selection
Research scattered across tabsDeep Research aggregates sources into polished markdown
Code reviews miss the big pictureCode Review runs 5-phase analysis with impact mapping

Install

/plugin marketplace add ojowwalker77/Claude-Matrix
/plugin install matrix@ojowwalker77-Claude-Matrix

Requires Bun v1.0+ and Claude Code v2.0+

Verify with /matrix:doctor

Platform: macOS and Linux only. Windows users should use WSL or fork the repo and adjust paths manually.


What's New in v2.0

v2.0.2

  • Subagent HooksSubagentStart injects Matrix guidance to Explore/Plan agents
  • Wildcard Warnings — Glob patterns in warning rules (src/legacy/**)
  • Hook Timeouts — Configurable timeout (default 30s, max 120s)
  • Index Tools Anywhere — Query any indexed repo via repoPath parameter
  • Token Optimization — ~10-12% reduction in MCP tool definitions

v2.0.0

  • Hook Verbositycompact mode cuts token overhead by 80%
  • Unified Warn API — Single matrix_warn tool with action parameter
  • Skill Factory — Promote high-value solutions to Claude Code Skills
  • Blast Radiusmatrix_find_callers shows impact before changes
  • Code Review — 5-phase review pipeline via /matrix:review
  • Deep Research — Multi-source aggregation via /matrix:deep-research
  • User Rules — Custom pattern matching (block, warn, allow)

Breaking Changes (v2.0)

  • Removed: /matrix:verify, /matrix:stats, /matrix:search
  • Changed: Four warn tools → single matrix_warn

See CHANGELOG.md for details.


Features

Memory System

Solutions persist across sessions with semantic search:

You solve a problem → Matrix stores it with embeddings
       Similar problem later → Matrix recalls the solution
            Feedback → Rankings improve over time
ToolPurpose
matrix_recallSearch for relevant solutions
matrix_storeSave a solution
matrix_rewardProvide feedback on solutions
matrix_failureRecord errors and fixes
matrix_statusView memory statistics

Code Index

Fast navigation across 15 languages—auto-indexed on session start.

Languages: TypeScript, JavaScript, Python, Go, Rust, Java, Kotlin, Swift, C#, Ruby, PHP, C, C++, Elixir, Zig

ToolPurpose
matrix_find_definitionFind where a symbol is defined
matrix_find_callersFind all files that use a symbol
matrix_search_symbolsSearch by partial name
matrix_list_exportsList exports from file/directory
matrix_get_importsGet imports for a file
matrix_reindexManually trigger reindexing

Warnings

Track problematic files and packages with a unified API:

matrix_warn({ action: 'check', type: 'file', target: 'src/legacy.ts' })
matrix_warn({ action: 'add', type: 'package', target: 'moment', reason: 'Use date-fns' })
matrix_warn({ action: 'remove', id: 'warn_abc123' })
matrix_warn({ action: 'list' })

Skill Factory

Identify and promote high-value solutions to Claude Code Skills:

ToolPurpose
matrix_skill_candidatesFind solutions ready for promotion
matrix_link_skillLink solution to a created skill

External Context

ToolPurpose
matrix_repomixPack external repos with semantic file selection
resolve-library-idFind library ID for documentation
query-docsGet current library documentation (Context7)

Diagnostics

ToolPurpose
matrix_doctorRun diagnostics and auto-fix issues

Automatic Hooks

Matrix runs in the background without explicit invocation:

TriggerAction
Session startsInitialize database, index code
Permission requestedAuto-approve read-only tools
You send a promptAnalyze complexity, inject memories
Before reading fileWarn if sensitive (.env, keys)
Before npm installCheck CVEs, deprecation, size
Before editing fileWarn if file has known issues
Before web fetchRedirect library docs to Context7
Before compactionSave session insights
Session endsOffer to save notable solutions

Commands

CommandPurpose
/matrix:listView solutions, stats, warnings
/matrix:doctorDiagnostics + auto-fix
/matrix:warnManage warnings
/matrix:reindexRebuild code index
/matrix:repomixPack external repo
/matrix:exportExport database
/matrix:review5-phase code review
/matrix:deep-researchMulti-source research
/matrix:skill-candidatesView promotable solutions
/matrix:create-skillCreate skill from solution

Configuration

Matrix creates ~/.claude/matrix/matrix.config on first run:

{
  "indexing": {
    "enabled": true,
    "excludePatterns": [],
    "maxFileSize": 1048576,
    "includeTests": false
  },
  "hooks": {
    "enabled": true,
    "verbosity": "compact",
    "permissions": {
      "autoApproveReadOnly": true,
      "autoApprove": {
        "coreRead": true,
        "web": true,
        "matrixRead": true,
        "context7": true
      }
    },
    "userRules": {
      "enabled": true,
      "rules": []
    }
  }
}

Verbosity Levels

LevelTokensDescription
full~500Verbose (default)
compact~80Recommended
minimal~20Critical only

User Rules

Add custom patterns to hooks.userRules.rules[]:

{
  "name": "block-rm-rf",
  "event": "bash",
  "pattern": "rm\\s+-rf\\s+/",
  "action": "block",
  "message": "Dangerous command blocked"
}

See User Rules Templates for 30+ ready-to-use rules.


Performance

MCP Annotations

All 18 tools include official MCP hints:

HintCountMeaning
readOnlyHint11No side effects
idempotentHint6Safe to retry
destructiveHint1Deletes data
openWorldHint1External API

Haiku Delegation

12 tools delegable to Haiku sub-agents for cost optimization:

matrix_recall, matrix_reward, matrix_status, matrix_warn
matrix_find_definition, matrix_find_callers, matrix_search_symbols
matrix_list_exports, matrix_get_imports, matrix_index_status
matrix_reindex, matrix_skill_candidates
Example: Haiku sub-agent executing matrix_recall Haiku delegation

Data Storage

~/.claude/matrix/
├── matrix.db              # SQLite database
├── matrix.config          # Configuration
├── models/                # Embedding model (~23MB)
├── grammars/              # Tree-sitter parsers (on-demand)
└── session-analysis.jsonl # Session logs

All data local. No external API calls for memory.


Update

Navigate to /pluginMarketplacesUpdate marketplace

Screenshot Update

Note: Claude Code updates have known quirks. May require restart or multiple attempts.


0 comments

No comments yet.

Sign in to be the first to comment.