Skip to content

yusufcmg/Agent_Memory_System

Repository files navigation

Agent Memory System (Universal Edition)

Agent Memory System transforms Claude Code (Anthropic's terminal-based AI assistant) into a manageable, organized, and memory-persistent software development team consisting of 37 specialized agents.

This repository solves the two biggest problems in standard Claude Code usage:

  1. Context Loss and Bloat: Instead of dumping everything into one massive log, the system divides work into modular memory-bank markdown files, saving tokens by pruning finalized tasks.
  2. High API Costs: The claude command uses your Claude Pro subscription for quality work, while ccr code routes routine tasks to ultra-cheap models (DeepSeek, Qwen) via OpenRouter — dramatically cutting costs.

Based on the Everything Claude Code architecture, enhanced with OpenRouter/CCR support, 108 predefined skills, and 37 distinct expert agents.


What's Included?

  • 37 Expert Agents: Frontend, Backend, Database, Security, DevOps, Java Reviewer, Rust Resolver...
  • 108 Custom Skills: TDD loops, E2E test generation, Django/Laravel patterns, Architecture reviews.
  • Persistent Memory (Memory-Bank): All architecture decisions (ADR) and tasks are stored under .claude/.
  • Self-Learning (/learn): Extract patterns from a successful session to create a new reusable skill.

Installation

1. Prerequisites

  • Node.js 18+ installed.
  • A terminal application (Mac Terminal, iTerm, Windows PowerShell, or WSL).

2. Install Claude Code CLI

npm install -g @anthropic-ai/claude-code

3. Clone and Run

git clone https://github.com/yusufcmg/Agent_Memory_System.git
cd Agent_Memory_System
bash install.sh

Once complete, the .claude/ directory with all expert agents and Claude Code Router (CCR) will be ready on your machine.


API Setup

This system uses two separate commands. Each requires its own one-time setup.


🔵 Step 1 — Claude Pro Login (for the claude command)

For complex, quality coding tasks, use the claude command. It connects directly to Anthropic and uses your Claude Pro subscription.

1. Go to any project folder and start Claude:

claude

2. On first use, authenticate:

> /login

A browser will open → Log in with your Anthropic account (claude.ai) → Authorize → Return to terminal. When you see "Login successful", type /exit to close.

⚠️ You only need to do this once. Next time you run claude, you'll be logged in automatically.


🟢 Step 2 — OpenRouter API Key (for the ccr code command)

For routine tasks like writing tests, reading logs, and code review, use ccr code. This routes everything to ultra-cheap models (DeepSeek, Qwen) via OpenRouter.

1. Go to openrouter.ai, create an account and generate an API Key (starts with sk-or-). Add some credit ($5-10 can last a very long time).

2. Open the config file created during installation:

nano ~/.claude-code-router/config.json

3. Replace BURAYA-OPENROUTER-KEY-GIRIN with your actual key:

{
  "Providers": [
    {
      "name": "openrouter",
      "api_base_url": "https://openrouter.ai/api/v1/chat/completions",
      "api_key": "sk-or-YOUR-ACTUAL-KEY-HERE",
      "models": [
        "deepseek/deepseek-chat",
        "minimax/minimax-m2.5",
        "minimax/minimax-m2.1"
      ],
      "transformer": {
        "use": ["openrouter"],
        "deepseek/deepseek-chat": {
          "use": ["openrouter", "tooluse", "enhancetool"]
        },
        "minimax/minimax-m2.5": {
          "use": ["openrouter"]
        }
      }
    }
  ],
  "Router": {
    "default":    "openrouter,deepseek/deepseek-chat",
    "background": "openrouter,minimax/minimax-m2.1",
    "think":      "openrouter,minimax/minimax-m2.5",
    "longContext": "openrouter,minimax/minimax-m2.5"
  }
}

⚠️ Important: Use OpenRouter model IDs in the models list (e.g. anthropic/claude-3-5-sonnet). Do NOT use Claude Code's internal aliases (e.g. claude-sonnet-4-6) here — they won't work with OpenRouter.

4. Press CTRL+XYEnter to save.

5. After any config change, restart the CCR service:

ccr restart

🚀 Step 3 — Initialize the Project

Go to any project folder. On first setup, initialize the memory-bank using the claude command:

claude
> /init

The onboarding agent will ask questions about your project (language, framework, database, etc.). Your answers will fill .claude/memory-bank/ with a permanent, project-specific constitution. You only need to do this once per project.


Usage

Once the memory-bank is set up, here's how to work with the agent team:

Quality Work → claude

For complex coding, architecture decisions, and critical features:

claude -p "as backend agent, create POST /api/auth endpoint"
claude -p "as architect, review the current system design"

Cheap / Routine Work → ccr code -p "..."

For writing tests, reading logs, updating docs, small fixes.

⚠️ IMPORTANT: Always use ccr code with the -p flag for cheap models (DeepSeek, Qwen). Running it in interactive mode (just ccr code and hitting enter) can confuse these models and trap them in a tool loop.

# ✅ CORRECT — single-shot job
ccr code -p "as qa-backend agent, write tests for the auth endpoint"
ccr code -p "as docs agent, update the API documentation"

# ❌ WRONG — interactive mode may cause issues with cheap models
ccr code

(The QA agent writes tests cheaply via OpenRouter and logs errors to memory-bank/state/tasks.md.)


Slash Commands

Command What it does
/model Switch the active model
/init Initialize project memory (first time only per project)
/tdd Start a Test-Driven Development loop
/code-review Scan the entire codebase for security and performance issues
/sync-memory Prune agent log directories to save tokens
/new-adr Create a new Architecture Decision Record
/learn Extract patterns from a session to create a new skill

Contributing

Open source — feel free to open an issue or submit a Pull Request!

License

MIT License

About

Plug & play multi-agent architecture for Claude Code CLI — 37 expert agents, 108 skills, persistent memory-bank, and multi-model cost routing via OpenRouter. One key to rule them all.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors