# RoutineCode

### The Agentic AI for Developers

Claude Code is powerful. RoutineCode makes it **unstoppable.**

59 MCP tools. 8 specialized agents. A brain that learns from every error you fix.
One install. Zero configuration. Your Claude Code just got an upgrade.

```bash
npm install @routinecrew/routinecode && npx routinecode setup
```

---

## The Problem

You're paying for Claude Code. It's great. But every time it checks a build, searches your codebase, or reads a log file -- that's tokens burned on **work that doesn't need intelligence.**

Your AI is doing janitor work at genius prices.

## The Solution

RoutineCode splits the work:

| | Claude Code Alone | With RoutineCode |
|---|---|---|
| Build check | LLM runs terminal, parses output | MCP returns pass/fail instantly |
| Error diagnosis | LLM reads logs line by line | MCP returns structured errors |
| Code search | LLM runs grep 5 times | MCP does AST-aware search once |
| "Seen this bug before?" | Impossible. No memory. | Domain intelligence auto-suggests fix |
| Agent fails 3 times | Keeps trying the same thing | **Physically blocked.** Escalates to reviewer. |
| Parallel agents | File conflicts, broken code | File lock registry prevents collision |
| **Avg tokens per task** | **~15,000** | **~4,000** |

**Same quality. 70% fewer tokens. That's not optimization -- that's architecture.**

---

## How It Works

RoutineCode is **not a wrapper.** It's a superset.

Your Claude Code stays exactly the same. RoutineCode adds three layers on top:

### Layer 1: 59 MCP Tools (Token Zero)

9 specialized servers handle deterministic work without touching the LLM.

| Server | What It Does |
|--------|-------------|
| **routinecode** | Build verification, project health, 3-strike failure tracking, file locks |
| **project-context** | File structure, code search, dependency graph, git analysis |
| **intelligence** | Error fix history, pattern detection, library quirks, similarity search |
| **plan-manager** | Task planning, parallel waves, progress tracking, learning notepad |
| **log-watcher** | Browser + server log collection, error filtering, real-time watch |
| **dev-tester** | API endpoint testing, UI flow testing |
| **doc-fetcher** | External doc crawling, GitHub issues, release tracking |
| **db-manager** | Schema analysis, comparison, migration generation |
| **html-renderer** | HTML preview rendering |

### Layer 2: 8 Autonomous Agents

Claude Code uses one agent for everything. RoutineCode **classifies your intent** and dispatches the right specialist.

```
"Where's the auth middleware?"     --> Explorer (2-3 fired in parallel)
"Fix this bug"                     --> Implementor (reads patterns first)
"Build the entire payment module"  --> Planner -> Implementor (wave execution)
"Should we split the schema?"      --> Reviewer (architecture advisor)
"What changed in Sequelize v7?"    --> Crawler (external research)
Failed 3 times on same issue       --> Reviewer (auto-escalation, edits blocked)
```

No manual switching. No slash commands. **It just works.**

### Layer 3: Domain Intelligence

Your development knowledge **compounds over time.**

Every error you fix, every pattern you repeat, every library quirk you discover -- RoutineCode records it locally in `~/.routinecode/knowledge/`.

Next time you hit a similar error:

```
[mcp-intelligence] Found similar error (92% match):
  Previous fix: "sequelize@7 belongsToMany requires explicit 'through' model.
  foreignKey alone is not enough — add otherKey + unique constraint."
  Applied 3 days ago in project: auth-backend
```

**Your AI gets smarter the more you use it.** No fine-tuning. No training data. Just JSONL files and trigram similarity.

Enable sync to share intelligence across your team.

---

## Code-Enforced Guardrails

Prompts can be ignored. **Hooks can't.**

RoutineCode uses Claude Code's Hook system to enforce rules at the infrastructure level:

| Hook | Trigger | Action |
|------|---------|--------|
| **PreToolUse(Edit)** | Every edit attempt | Checks `/tmp/routinecode-escalation.json`. If 3 failures recorded, **blocks the edit.** |
| **PostToolUse(build_check)** | Build fails | Forces `get_similar_errors` call before any fix attempt. |
| **SessionStart** | New session | Resets escalation state for fresh start. |

This means: **your AI literally cannot make the same mistake 4 times.** Not because you told it not to. Because the Edit tool stops working.

---

## Get Started

### 1. Sign Up

Create your account at [routinecrew.com](https://routinecrew.com).
Google, Kakao, Naver, or email.

### 2. Get API Key

Go to [routinecrew.com/get-api-key](https://routinecrew.com/get-api-key), select **RoutineCode**, and copy your key.

> Your key is shown once. Save it somewhere safe.

### 3. Install

```bash
npm install @routinecrew/routinecode
npx routinecode setup
```

The setup wizard:
- Registers 9 MCP servers
- Installs 3 Claude Code hooks
- Activates the plugin
- Connects your account for intelligence sync

### 4. Use

Restart Claude Code. **That's it.**

Use Claude Code exactly like before. RoutineCode works in the background -- routing tasks to MCP tools, dispatching agents, recording intelligence, enforcing safety.

You'll notice: faster responses, fewer token burns, and an AI that remembers what you taught it yesterday.

---

## Architecture

```
Developer
    |
    v
Claude Code  ------>  RoutineCode Plugin
    |                     |
    |                     |-- Intent Classifier
    |                     |-- 8 Agent Orchestrator
    |                     |-- 3 Code-Enforced Hooks
    |
    +---> 9 MCP Servers (token 0)
    |       |-- Build, Test, Logs, DB, Docs, Plans
    |       |-- Code Analysis, Search, Git
    |       |-- Domain Intelligence (learns over time)
    |
    +---> Domain Knowledge Store
            |-- ~/.routinecode/knowledge/
            |-- events.jsonl  (error fixes)
            |-- patterns.jsonl (impl patterns)
            |-- quirks.jsonl  (library gotchas)
            |-- Sync to team (optional)
```

---

## Who Is This For

**Solo developers** who want a senior team's capability from one AI.

**Startup teams** who burn through Claude tokens and need 70% cost reduction without losing quality.

**Agencies** managing multiple projects who need AI that remembers patterns across codebases.

**AI-forward teams** who already use Claude Code and want to push it further.

---

## FAQ

**Is this a Claude Code replacement?**
No. It's a superset. Claude Code runs underneath. RoutineCode adds tools, agents, and intelligence on top.

**Does it change my Claude Code settings?**
It adds MCP servers and hooks. Your existing configuration stays untouched.

**Where does my data go?**
Local first. Always. `~/.routinecode/knowledge/` on your machine. Server sync is opt-in with your API key.

**Can my team share intelligence?**
Yes. Same tenant = shared knowledge base. Your team's error fixes and patterns sync automatically.

**How much does it cost?**
Free tier available. Check [routinecrew.com](https://routinecrew.com) for plans.

---

## Links

- [GitHub](https://github.com/routinecrew/routinecode)
- [Website](https://routinecrew.com)
- [Get API Key](https://routinecrew.com/get-api-key)
- [RoutineCode Product Page](https://routinecrew.com/routinecode)

---

MIT License | Built by [RoutineCrew](https://routinecrew.com)

*"Routine tasks cost zero tokens. Intelligence is reserved for what matters."*
