This repository is not an application β it is a configuration and architecture kit for Claude Code, Anthropic's terminal-based AI coding assistant.
When installed into any project, it transforms a single Claude Code session into a managed, memory-persistent software development team with specialized agents, reusable skills, and persistent project memory β all stored as plain markdown files under .claude/.
This repository solves the two biggest problems in standard Claude Code usage:
- 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.
- High API Costs: The
claudecommand uses your Claude Pro subscription for quality work, whileccr code -proutes routine tasks to ultra-cheap models (DeepSeek, Minimax) via OpenRouter β dramatically cutting costs.
Based on the Everything Claude Code architecture, enhanced with OpenRouter/CCR support.
- 37 Expert Agents: Frontend, Backend, Database, Security, DevOps, Java/Go/Rust/Python reviewers, TDD Guide, Architect...
- 114 Custom Skills: TDD loops, E2E test generation, Django/Laravel patterns, Architecture reviews, Deep Research, and more.
- Skills are auto-configured during
/initβ only skills relevant to your stack are loaded, keeping token overhead minimal. - A fresh install starts with 14 universal skills active (always on: TDD, security, memory, research, etc.).
- After
/init, Claude enables only the skills matched to your stack keywords (~20β30 total out of 114). - Disabled skills cost zero tokens β fully excluded from the context window via
disable-model-invocation: truein their frontmatter.
- Skills are auto-configured during
- 62 Slash Commands:
/init,/tdd,/code-review,/learn,/new-adr, language-specific build/test/review commands. - Persistent Memory (Memory-Bank): All architecture decisions (ADR) and tasks are stored under
.claude/memory-bank/. Ships empty β populated entirely by/init. - Self-Learning (/learn): Extract patterns from a successful session to create a new reusable skill.
- Node.js 18+ installed (nodejs.org).
- A terminal application (Mac Terminal, iTerm, Windows PowerShell, or WSL).
- Windows users: Use WSL for full compatibility. Native PowerShell is not recommended.
npm install -g @anthropic-ai/claude-codegit clone https://github.com/yusufcmg/Agent_Memory_Systems.git
cd Agent_Memory_Systems
bash install.shOnce complete, the .claude/ directory with all expert agents will be installed on your machine. You'll still need to run /init and configure your OpenRouter key (see below).
To install into an existing project, see Integrating into an Existing Project below.
This system uses two separate commands. Each requires its own one-time setup.
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:
claude2. On first use, authenticate:
> /loginA 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 runclaude, you'll be logged in automatically.
For routine tasks like writing tests, reading logs, and code review, use ccr code. This routes everything to ultra-cheap models (DeepSeek, Minimax) 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.json3. 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 themodelslist (e.g.deepseek/deepseek-chat). Do NOT use Claude Code's internal aliases (e.g.claude-sonnet-4-6) here β they won't work with OpenRouter.
4. Press CTRL+X β Y β Enter to save.
5. After any config change, restart the CCR service:
ccr restartGo to your project folder. On first setup, initialize the memory-bank using the claude command:
claude
> /initClaude will ask a few contextual questions about your project (language, framework, database, deployment, etc.). Your answers will:
- Fill
.claude/memory-bank/with a permanent, project-specific constitution. - Automatically enable only the skills relevant to your stack β disabling the other 80+ to keep the context window lean.
You only need to do this once per project. The result is printed at the end:
β
MyProject initialized! 28 skills active for your stack.
Once the memory-bank is set up, here's how to work with the agent team:
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"For writing tests, reading logs, updating docs, small fixes.
β οΈ IMPORTANT: Always useccr codewith the-pflag for cheap models (DeepSeek, Minimax). Running it in interactive mode (justccr codeand 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.)
You can add this system to any project you're already working on:
cd /path/to/your-existing-project
git clone https://github.com/yusufcmg/Agent_Memory_Systems.git /tmp/ams
cp -r /tmp/ams/{.claude,.claude-code-router,CLAUDE.md,AGENTS.md,install.sh} ./
rm -rf /tmp/ams
bash install.shThen initialize the memory-bank so the agents understand your codebase:
claude
> /initπ‘ Tip: The agents automatically respect
.gitignore. Directories likenode_modules/,venv/,__pycache__/,dist/are never read. For additional exclusions (large data files, media assets), create a.claudeignorefile in your project root β it works exactly like.gitignore.
To pull in the latest agents, skills, and commands without touching your memory-bank:
bash install.sh --updateUpdate mode:
- Overwrites
.claude/agents/,.claude/commands/,.claude/skills/,.claude/scripts/from source - Preserves
.claude/memory-bank/(your project context is never touched) - Reads
.claude/active-skills.txt(saved by/init) and automatically re-enables your previous skill set - If
active-skills.txtis missing, all skills are disabled and a prompt to run/initis shown
Skills are managed by .claude/scripts/configure-skills.sh. You normally never call it directly β it runs automatically during bash install.sh and after /init. But you can run it manually:
# Re-configure skills after changing your stack
bash .claude/scripts/configure-skills.sh react typescript postgresql docker
# Reset to universal-only (disable all stack skills)
bash .claude/scripts/configure-skills.shHow it works:
- Disables ALL 114 skills (inserts
disable-model-invocation: trueinto frontmatter) - Re-enables 14 universal skills (always on: TDD, security, memory, research, etc.)
- Re-enables keyword-matched skills for your stack (45 keywords β 84 skills covered)
Supported keywords: python, django, fastapi, flask, react, nextjs, vue, svelte, typescript, postgresql, mysql, mongodb, sqlite, golang/go, rust, kotlin, ktor, android, java, springboot, laravel, php, perl, swift/swiftui/ios, cpp, docker, node, express, vercel, aws, railway, bun, mcp, ai, llm, agents, exa, scraping, clickhouse, compose
| Command | What it does |
|---|---|
/init |
Initialize project memory and configure stack-relevant skills (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 |
Reconcile memory-bank with current code, prune stale entries |
/new-adr |
Create a new Architecture Decision Record |
/learn |
Extract patterns from a session to create a new skill |
/model |
Switch the active model |
β οΈ Permissions Warning: This kit enables broad permissions (Read(**),Write(**),Bash(*)) so agents can fully operate on your project. Review.claude/settings.jsonbefore use. Run in a safe environment (not on production machines), and never use it on repositories containing secrets you can't risk overwriting.
π‘ Tip: Try your first run on an empty demo repo. Commit frequently with git so you can quickly rollback if needed.
- Never commit API keys. Your OpenRouter key lives only in
~/.claude-code-router/config.json(your home directory, outside any repo). - The
install.shscript adds.claude-code-router/config.jsonto.gitignoreautomatically. - The
.env.examplefile contains only placeholder keys β never real ones. - All agents obey the rule: "NEVER write secrets to any file" (enforced in
CLAUDE.md).
| Problem | Solution |
|---|---|
claude: command not found |
Run npm install -g @anthropic-ai/claude-code. Ensure Node.js 18+ is installed. |
ccr: command not found |
Run npm install -g @musistudio/claude-code-router. |
| npm permission errors | Use sudo npm install -g ... on Linux/Mac, or fix npm permissions: npm docs. |
config.json not found |
Run bash install.sh β it creates ~/.claude-code-router/config.json from the example template. |
| Model errors / "model not found" | Ensure you use OpenRouter model IDs (e.g. deepseek/deepseek-chat), not Claude Code aliases (e.g. claude-sonnet-4-6). |
| Too many skills / high token usage | Run /init first β it disables 80+ irrelevant skills automatically. If still hitting limits, run bash .claude/scripts/configure-skills.sh with only your actual stack keywords. |
| Tool loop / agent stuck | Never use ccr code in interactive mode. Always use ccr code -p "..." with a specific task. |
| Config changes not applied | Run ccr restart after editing ~/.claude-code-router/config.json. |
| Windows issues | Use WSL (Windows Subsystem for Linux). Native PowerShell has limited compatibility with Claude Code. |
| Skills reset after update | bash install.sh --update restores your skills from .claude/active-skills.txt. If missing, re-run /init. |
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
MIT License