← Back to Blog

Give your coding agents memory: L2Cache's MCP server and hooks

November 9, 2026 · 6 min read

Coming in L2Cache 2.0. The MCP server, hooks for Grok Build and GitHub Copilot, and the cost warnings arrive in 2.0, which is coming soon. Version 1.4.6, on the App Store today, records Claude Code and Codex sessions with hooks.

Every coding-agent session starts out knowing nothing about yesterday. It doesn't know the bug you fixed last week, the approach you already ruled out, the error you just copied, or the screenshot of the failing build. You end up explaining all of it again, and the agent re-runs diagnostics it ran before.

L2Cache already keeps that history on your Mac: your clipboard, screenshots, terminal commands and every coding-agent session. It connects that history to your agents in two directions:

Direction 1: agents ask, through MCP

The Model Context Protocol is a standard way for an AI agent to call tools outside itself. L2Cache ships an MCP server with twelve tools. All of them are read-only: they never change your data.

Coding-agent memory

ToolWhat the agent gets back
get_session_summaryWhat an earlier session worked on: the feature, what got done, the next step and the files it touched. The tool agents are told to call first when resuming.
search_agent_historyMatches across earlier sessions in Claude Code, Codex, Copilot, Grok Build and Antigravity, by words, code symbols, file paths or error codes. Filters for project, branch, agent and kind (fix, decision, failed command, prompt and so on).
get_agent_eventOne result in full, with the messages just before and after it.
get_error_resolutionsEarlier fixes: the symptom, root cause, what changed, how it was verified and which files were involved.
get_decisionsDesign decisions and trade-offs from earlier sessions, so the agent doesn't undo one by accident.
get_recovery_pointWhere you left off in a project: the last request and reply, failing commands, recent terminal commands and changed files.

Clipboard, screenshots and files

ToolWhat the agent gets back
get_recent_clipsShort previews of what you copied recently, filtered by type or source app if needed.
search_clipsFull-text search of your clipboard history.
get_clipOne clip in full, including the image if it's a screenshot.
search_screenshotsScreenshots found by the text inside them, read with on-device OCR.
search_memory_foldersText inside the files, PDFs and images in folders you've connected to L2Cache.
get_folder_itemOne of those files in full, or a downscaled image the agent can look at.

So "what was that error in the screenshot I took this morning?" or "we fixed this crash before, how?" become questions the agent can answer itself, without you digging through history.

Built to stay small

Everything an MCP tool returns lands in the agent's context, so the results are kept short: a handful of results by default, short excerpts rather than whole conversations, and fields the agent already knows left out. The agent fetches the full item only when it needs it. The tool list never changes while the server runs, so it doesn't break the agent's prompt cache.

Which agents can use it

Settings › MCP has a ready-to-copy setup line for Claude Code, Claude Desktop, Codex, Cursor and Google Antigravity. You can also paste a prompt into the agent and let it add the server itself.

Direction 2: L2Cache briefs the agent, through hooks

MCP only helps when the agent thinks to ask. Hooks cover the rest. They're small shell commands that coding agents run at fixed moments: when a session starts, when you send a prompt, after the agent edits a file or runs a command, and when it stops. L2Cache uses them for two jobs: recording what happens, and adding a little context at the right moment.

What gets recorded

What gets added

Which agents get which hooks

Hook featureClaude CodeCodexGrok BuildGitHub Copilot
Live capture (edits, commands, sessions)YesYesYesYes
Handoff when a session startsYesYesYesNo
Recent clipboard with your promptYesYesYesNo
Work summariesYesYesNoNo
Cost warnings and cold resume guardYesYesNoNo

You connect each agent in Settings › Coding agents, and each feature has its own switch. Hooks and agent history over MCP are part of Developer Pro, which the free trial includes.

Why both

The two halves cover each other's gaps. A hook can add context before the first prompt, but it has to stay short, because whatever it adds is carried in every request after that. MCP can go deep, but only when the agent decides to look. So L2Cache uses hooks for the few lines every session needs, and gives the agent tools to fetch everything else on demand. A handoff ends by pointing the new session at get_session_summary and the old session's ID, so the deep detail is one call away.

Privacy and safety

The short version

Give your agents a memory

L2Cache connects your clipboard, screenshots and coding-agent history to Claude Code, Codex and more, all on your Mac.

Download L2Cache for Mac