Use cases / Coding Agents & IDEs

Memory for coding agents

Coding agents like Claude Code, Cursor, and Codex lose track of context during long tasks. They forget why a change was made, repeat failed fixes, and fill up the prompt with whole files. / ml gives coding agents shared project memory and code search via MCP.

Main Problem Solved Forgetting rules & repeating failed fixes
Integration Built-in MCP server
Token Savings 80% fewer tokens vs full-file dumps
Lookup Speed ~10 ms

What you are building

How it works
1. Coding agent
Claude Code, Cursor, Codex
Past sessions, bug fixes, and PR decisions
2. / ml Memory
Project memory & code search
Remembers past fixes and finds code by what it does
3. Next session
Right context, every run
Follows team rules without repeating dead ends

An autonomous coding assistant or engineering copilot integrated directly into your IDE (Cursor, VS Code) or command line (Claude Code, OpenClaw, Codex CLI). It executes complex software engineering tasks that span hours or days:

  • Executing multi-file architectural refactors without undoing core team invariants.
  • Diagnosing subtle production bugs without retrying dead-end hypotheses that failed three sessions ago.
  • Navigating massive codebases where storing entire directory trees in the context window is impossible.
  • Preserving critical decisions from pull request discussions, code audits, and design documents.

Instead of starting each terminal session as a blank slate or stuffing tens of thousands of tokens of static AGENTS.md rules into every prompt, your agent queries dynamic, accurate memory on demand.

Why memory decides whether it works

Without persistent memory, coding agents fail as soon as tasks span multiple files or sessions:

  • Context bloat: Past 100k tokens, attention drops and agents start forgetting constraints or inventing imports.
  • Regression loops: Agents retry the same failed patch from twenty steps ago because dead ends are never recorded.
  • Bloated rules files: Static CLAUDE.md or .cursorrules files burn 10k+ tokens on every turn regardless of relevance.
  • Lost rationale: Architectural decisions explained in one terminal session vanish the moment you close it.

What / ml provides

One-Command MCP Setup

Connect / ml directly to Claude Code, Cursor, Windsurf, or Codex CLI with built-in tools for saving and searching project memory.

Search Code by What It Does

Find the right files by describing how a feature behaves, and remove outdated patterns so your agent stays aligned with current rules.

Fast ~10 ms Lookup

Memory lookups finish in about 10 ms, so agent tool calls run at full speed without slowing down your coding loop.

Shared Bug History

Save dead-end attempts and verified root causes. When another engineer or session hits a similar bug, it pulls the fix right away.

Cost and token economics

Long coding sessions get expensive fast when agents grep and paste whole files into every turn of the conversation.

Tokens Used Per Coding Turn

Reading & pasting full files: ~18,400 tokens ($0.092 per turn)

/ ml targeted memory lookup: ~1,850 tokens ($0.0092 per turn)

Result: 90% fewer prompt tokens and 5× faster agent steps.

Across a 50-step coding task, / ml cuts model spend from $4.60 per run to under $0.50 while keeping the agent focused on the actual fix.

Getting there

1

Add the MCP server to your editor or CLI

Add the / ml MCP server to Claude Code, Cursor, or your agent config using your API key.

2

Save team conventions and past decisions

Store your repo rules, testing conventions, and architecture choices in your project memory.

3

Check memory at the start of each task

Tell your agent to check project memory before searching files or writing code so it starts with the right context.

4

Save root causes after fixing bugs

When your agent solves a tricky bug, save the cause and fix so future sessions never have to debug it twice.

Code example

Configuring the ml-memory MCP server for Claude Code and Cursor, plus Python SDK invocation:

// 1. Claude Desktop / Cursor MCP Configuration (.mcp.json / claude_desktop_config.json)
// Or run: claude mcp add --scope user ml-memory -e SLASHML_API_KEY="$SLASHML_API_KEY" -- npx -y @slashml/memory
{
  "mcpServers": {
    "ml-memory": {
      "command": "npx",
      "args": ["-y", "@slashml/memory"],
      "env": {
        "SLASHML_API_KEY": "sml_live_..."
      }
    }
  }
}

# 2. Ingesting an architectural decision via Python SDK (pip install slashml-memory)
import os
from slashml import Memory

mem = Memory(api_key=os.environ["SLASHML_API_KEY"])

mem.add(
    "Database schema migration: Moved from autoincrement IDs to UUIDv7 across all customer tables. Never use SERIAL in new Postgres migrations.",
    user_id="core-backend-repo",
    metadata={"scope": "database", "author": "dev-lead", "repo": "backend"}
)

# 3. Recalling architectural decisions and bug fixes
results = mem.search(
    "Foreign key constraint or ID generation rule for new tenant tables",
    user_id="core-backend-repo"
)

for item in results["results"]:
    print(f"Memory: {item['memory']} (score: {item['score']:.3f})")
    print(f"Metadata: {item.get('metadata')}")

Frequently asked questions

Q How is / ml different from standard code search?

Standard code search only matches text in current files. / ml combines code search by behavior with persistent project memory: why a library was replaced, past bug root causes, and team rules that aren't written in code comments.

Q Can our whole engineering team share the same project memory?

Yes. By sharing a project ID across your repo, every developer's IDE or CLI agent reads from and saves to the same shared memory.

Q What happens when we replace an old coding pattern?

You can update or delete outdated rules in milliseconds so your coding agent immediately stops suggesting old patterns.

Q Does our code stay private?

Yes. On / ml Cloud, each API key is isolated in its own private vault and your data is never used to train models. If you need everything inside your own cloud, / ml sovereign runs as a single binary inside your private VPC with no outbound calls.

Supercharge your coding agents

Connect / ml via MCP to Claude Code, Cursor, or your custom agent framework in under 2 minutes.