Skip to main content
Glama

RCLM — Data Capture for AI Tools

Every time you use an AI coding assistant, you produce valuable reasoning and code. RCLM (ReclaimLLM) ensures that data belongs to you. It is a lightweight capture layer that records your AI sessions from Claude Code, Codex CLI, Cursor, Antigravity, Gemini CLI, and OpenClaw, shipping them to your ReclaimLLM account for search, analysis, and continuation.

Key Features

  • Native Hooks: One installer for Claude Code, Codex CLI, Cursor, Antigravity, Gemini CLI, and opt-in OpenClaw.

  • Historical Sync: One-command backfill for all your past AI sessions.

  • DLP & Privacy: Automatic redaction of secrets from .env files before they reach the model.

  • Context Compression: Read caching, result dedup, exec-output compaction, and automatic image downscaling cut token usage without losing information — see Context Compression & DLP.

  • Context Conversion: Export any captured session as a Markdown context document to continue work in a different tool.

  • Local Proxy: Experimental LiteLLM-based proxy for OpenAI-compatible tools.


Related MCP server: vibe-hnindex

Quick Start

1. Install

pip install rclm
# Or for proxy support: pip install 'rclm[proxy]'

2. Setup Hooks

# Integrates with Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, and Gemini CLI
rclm-hooks-install

# Install only selected clients
rclm-hooks-install --claude --cursor

# OpenClaw remains opt-in
rclm-hooks-install --openclaw

This will open a browser to reclaimllm.com to link your account. Once linked, every session is automatically captured.

3. Sync History

# Upload sessions that predated the installation
rclm-sync

# Or select one source
rclm-sync --antigravity
rclm-sync --copilot

Copilot CLI history is read from ~/.copilot/session-state/**/events.jsonl.

Failed uploads—including rejected credentials and server errors—are saved after local redaction in ~/.reclaimllm/failed_uploads/. Retry them with rclm-sync --failed. ReclaimLLM-owned config, session sidecars, sync indexes, and failed-upload files use owner-only permissions. Provider-owned transcript files remain under the provider's control and may contain unredacted content.

To remove hooks while preserving unrelated client settings:

rclm-hooks-uninstall                    # all default clients
rclm-hooks-uninstall --cursor           # one client
rclm-hooks-uninstall --antigravity

Each captured session records the coding client separately from the underlying model provider, so a Cursor session using Claude remains attributed to Cursor. The dashboard exposes this as a coding-agent badge and filter.


Session Conversion (New!)

rclm convert-session generates a compact context document for starting a new session in another tool. It does not restore the source tool's private runtime state.

# Export a session for Claude Code
rclm convert-session <session_id> claude -o CLAUDE.md

# Export for Gemini CLI
rclm convert-session <session_id> gemini -o .gemini

# Options
rclm convert-session <session_id> generic --no-diffs          # Omit file diffs
rclm convert-session <session_id> claude  --force-regenerate  # Use LLM for a fresh summary

Supported targets: claude, gemini, codex, generic.


Agent Plugins

RCLM includes local plugin marketplace entries for Codex, Claude, and Cursor. Each plugin exposes ReclaimLLM as persistent memory for AI agents through the bundled rclm-mcp server.

codex plugin marketplace add /path/to/DC-hooks-proxy
codex plugin add reclaimllm@reclaimllm-plugins

For Claude and Cursor, add the matching marketplace file from this repo:

  • DC-hooks-proxy/.claude-plugin/marketplace.json

  • DC-hooks-proxy/.cursor-plugin/marketplace.json

Then authenticate the local MCP server if you have not already:

rclm-hooks-install --with-mcp

Start a new agent thread and confirm the reclaimllm plugin and MCP server are enabled.

MCP Tools

Tool

Description

search_sessions

Hybrid semantic + keyword search across captured sessions by topic, error, file, or date range.

filter_sessions

Authoritative Postgres session listing for metadata/date filters when there is no semantic text query.

search_by_filename

File/folder-scoped session history, e.g. "what changed in auth.tsx".

get_session

Summary metadata and a frontend link for one session ID.

summarize_session

Pull a specific session's summary in as working context, on explicit request.

list_projects

List available project filters.

file_brief

Recent-history brief for a file before making a non-trivial edit to it.

handoff

Generate a continuation document to start a fresh session without losing context.

transfer_session

Stream a complete captured session (messages, tool calls/results, file diffs) as a versioned JSON artifact.

signals

Up to 5 open workflow-efficiency signals (evidence + prescribed fix) for the current project.

replay_eligibility

Cheap, metadata-only check of whether replaying compression mechanisms is worth doing.

replay_session

Reproduce shipped compression mechanisms over one captured session and report the real tool-result token reduction.

replay_corpus

Same as replay_session, aggregated across a filtered window in the caller's authorized scope (team for team leads, organization for admins).

replay_compare

Replay the same corpus under multiple mechanism configurations in one call.

All tools are read-only: none re-execute historical commands, call a model, or modify captured data.

When you need the complete captured session instead of a summary, ask the target agent to call transfer_session with the ReclaimLLM session ID. The tool streams a versioned JSON artifact containing every captured message, tool call/result, file diff, and metadata field into an owner-only temporary file. The target agent reads that file as historical context; recorded tool calls are never re-executed automatically.

SESSION_TRANSFER_MAX_BYTES controls the backend and local download ceiling and defaults to 100 MiB. Transfers are never silently truncated. SESSION_TRANSFER_TTL_SECONDS controls when local artifacts become eligible for bounded opportunistic cleanup and defaults to one hour.

Replay: verifying token savings

replay_eligibility, replay_session, replay_corpus, and replay_compare reproduce RCLM's shipped compression mechanisms (range_cache, shell_compaction, stateful_delta, hash_dedupe) over already-captured sessions and report the real tool-result token reduction, without calling a model or re-running any historical command:

  • "Would compression help on my last 50 sessions?" → replay_eligibility

  • "How much did compression save on session <id>?" → replay_session

  • "What's the aggregate savings across my Codex sessions this month?" → replay_corpus

  • "Compare shell compaction alone vs. combined with range cache" → replay_compare

Every corpus result states its effective scope plus sessions considered vs. eligible vs. excluded; a session or corpus below the turn/tool-call thresholds is refused with the specific failing constraint rather than given an unstable number.


CLI Reference

Command

Description

rclm-hooks-install

Install/configure native hooks for local LLM CLIs.

rclm-sync

Discover and upload historical transcripts.

rclm convert-session

Export a session to Markdown context for tool switching.

rclm recall-result

Recall an exact character range from a locally evicted tool result.

rclm-proxy

Start/setup a LiteLLM proxy for OpenAI-compatible capture.

rclm-update

Check for and apply updates to the rclm package.

Set RCLM_AUTO_UPDATE=false to disable PyPI checks and detached session-end updates, including for air-gapped installs. Device check-in caches the server's approved rclm version when one is configured, and rclm-update installs that exact version instead of advancing past the server compatibility window.


Advanced Usage

Context Compression & DLP

Env-file DLP is enabled on fresh installs and preserves an explicit saved opt-out:

rclm-hooks-install --compress                          # Reduces tool-result tokens in Claude Code, Codex, and Cursor
rclm-hooks-install --dlp                                # Explicitly enable or re-enable DLP
rclm-hooks-install --no-dlp                             # Explicitly disable DLP
rclm-hooks-install --image-lifecycle                    # Downscales oversized screenshots/images before they reach the model
rclm-hooks-install --image-lifecycle --image-max-dim=1280  # Set the max image dimension in pixels (default 1280)

Image downscaling (--image-lifecycle) resizes and re-encodes oversized tool-result images — full-page screenshots, MCP screenshot-tool output — before they enter the model's context, and never upscales. It applies for real on Claude Code sessions; on Codex it currently reports measured before/after savings only, since Codex CLI does not yet apply hook-driven rewrites of MCP tool output. Requires the optional images extra: pip install 'rclm[images]'.

Text compression uses each coding client's native hooks; it does not require proxy or LLM-gateway traffic. Claude Code and Codex support recognized shell-output compaction plus differential output for repeated commands and searches. Successful compacted results are stored locally behind bounded SHA-256 recall handles, and deterministic file/test/error state is retained in a typed task ledger. Antigravity caps view_file requests to 200 lines and wraps supported commands before execution; its PostToolUse contract cannot replace output. Cursor wraps recognized shell commands before execution and limits post-result replacement to structured MCP output. Unknown commands, failures, images, and ambiguous structured results pass through unchanged. Identical-result dedupe remains off by default (--dedupe).

Folder Capture Filters

Limit uploads to specific project folders during installation:

rclm-hooks-install --include-folder=/path/to/project
rclm-hooks-install --include-folder=/work/app --include-folder=/work/infra

Use --exclude-folder=/path/to/private to skip specific folders when no include allowlist is configured.

Proxy Capture (Experimental)

Point your tools at http://localhost:4000 to capture raw API interactions:

rclm-proxy setup
rclm-proxy start

Technical Details

For information on data models, hook internals, and the DLP engine, see architecture.md.

Development

uv sync --extra dev          # Install dev dependencies
uv run pre-commit install    # Setup linting/formatting hooks
uv run pytest rclm/tests     # Run the test suite

License: Apache-2.0

Available Tools

14 tools
file_briefA

Return a distilled brief of prior sessions that touched a file: who, when, and a short highlight of what each session did.

Use before a non-trivial edit to a file you don't already have context on — to see why it looks the way it does or what related work has touched it recently. Do not call this for every file you read; only when prior history is actually likely to change your approach. scope controls whose sessions are searched: "mine", "team", or "org". Omit scope to search the widest scope your organization's sharing settings allow.

Inputs: path (required), limit, scope. Returns: object

filter_sessionsA

List sessions by metadata using authoritative Postgres filters, without semantic search.

Use when the user provides no semantic text query and instead asks for sessions in a date window or matching metadata such as provider, model, project, language, category, minimum turn/tool-call counts, or code changes. Do not invent search text for these requests and do not use this tool when the user asks for sessions similar to a topic; use search_sessions.

Use provider="codex" for Codex sessions whose stored model names are in the GPT family. date_from is inclusive and date_to is exclusive; both are YYYY-MM-DD ingestion dates. scope controls whose sessions are listed: "mine", "team", or "org". Omit it to use the widest scope permitted by the organization's sharing settings. Results are capped at 100.

Inputs: limit, model, scope, date_to, +11 more. Returns: object

get_sessionA

Return summary metadata and a frontend link for a specific ReclaimLLM session ID.

Use only when the user asks to look at a particular session by ID.

Inputs: session_id (required). Returns: object

handoffA

Package the current (or a given) session's state into a compact continuation document for starting a fresh session, without losing decisions/context already established.

Use when the current session has grown long (many turns, large context) and continuing it is getting expensive, or when the user explicitly asks to "hand off", "continue this in a new session", or "start fresh but keep context" — and no different AI coding tool is named. If the user names a specific other tool ("move this to Cursor", "open in Codex"), use transfer_session instead — it preserves full captured history losslessly, where this tool summarizes. If session_id is omitted, resolves the current session from the CLAUDE_SESSION_ID environment variable; if that isn't set, pass session_id explicitly. Returns a markdown document to paste as the first message of a new session — this does not end the current session for you.

Inputs: session_id, include_diffs, max_diff_lines. Returns: object

list_projectsA

List deterministic ReclaimLLM CLI project names.

Use only when the user asks to see available projects.

Inputs: no named parameters. Returns: object

replay_compareA

Replay the same session corpus under multiple mechanism configurations in one call, so bundles stay attributable — e.g. compare shell compaction alone against shell compaction plus range cache. Strictly read-only; fetches each eligible session's blob once and reuses it across every config.

configs is a list of mechanism-name lists, e.g. [["shell_compaction"], ["shell_compaction", "range_cache"]]. Defaults to comparing each mechanism individually plus the full combined set if omitted. days/source/model_family/project/session_category/limit select the corpus, same as replay_corpus.

min_turns/min_tool_calls override the turn-count and tool-call-count floors (default 5/5; PRD §6's documented floors are 10/10) — reported in each config row's provenance.

Inputs: days, limit, source, configs, +5 more. Returns: object

replay_corpusA

Reproduce the shipped compression mechanisms across a filtered corpus of captured sessions and report the aggregate real tool-result token reduction. Strictly read-only.

days is an exact rolling ingestion window over the caller's widest authorized session scope (default 30): team leads include their teams, admins include their organization, and other callers follow org sharing settings. For source="codex", stored model names must start with gpt- or codex-. model_family/project/session_category further narrow the corpus. limit is the target fully eligible session count (max 100); Replay scans up to 4x that many recent session records, capped at 100, and stops when it reaches the target or exhausts the scan. Every result states its effective scope, sessions considered vs eligible, and why the rest were excluded.

min_turns/min_tool_calls override the turn-count and tool-call-count floors (default 5/5; PRD §6's documented floors are 10/10) — reported in the output's provenance.

Inputs: days, limit, source, project, +5 more. Returns: object

replay_eligibilityA

Cheap read-only check of whether replaying compression mechanisms on captured sessions is worth doing — call this before replay_session or replay_corpus. Checks only session metadata (turn count, tool-call count, completion state, model), never fetches the full session blob, so it's fast.

Pass session_id to check one session. Omit it to check a corpus window instead, using the same days/source/model_family/project/ session_category/limit filters as replay_corpus. Always returns the funnel of sessions considered vs excluded and why — a session or corpus with few eligible sessions is itself the finding; do not keep loosening filters to force a number.

min_turns/min_tool_calls override the turn-count and tool-call-count floors (default 5/5; PRD §6's documented floors are 10/10). Lowering them trades evidence quality for sample size — state the values used alongside any result, don't drop them silently.

Inputs: days, limit, source, project, +5 more. Returns: object

replay_sessionA

Reproduce the shipped compression mechanisms over one captured session's tool calls and report the real tool-result token reduction. Strictly read-only: no model calls, no writes, no re-execution of historical commands.

session_id defaults to your most recent complete session. mechanisms defaults to all three (range_cache, shell_compaction, hash_dedupe); pass a subset (e.g. ["shell_compaction"]) to isolate one mechanism's effect. A session below the size/turn thresholds is refused with the specific failing constraint (verdict "insufficient_data") rather than given an unstable number.

min_turns/min_tool_calls override the turn-count and tool-call-count floors (default 5/5; PRD §6's documented floors are 10/10) — reported in the output's provenance.

Inputs: min_turns, mechanisms, session_id, min_tool_calls. Returns: object

search_by_filenameA

Find prior sessions that touched a file or folder path.

Use when the user asks for changes/history for a specific file or folder and does not provide separate semantic search terms, for example "show me all changes in auth.tsx" or "show me changes under /somefolder". If the user includes semantic terms too, such as "show all auth fixes in auth.tsx", use search_sessions with file_path instead. date_from is inclusive and date_to is exclusive. Both filter by ingestion date in YYYY-MM-DD format. scope controls whose sessions are searched: "mine", "team", or "org". Omit scope to search the widest scope your organization's sharing settings allow. Do not automatically call summarize_session after this tool. This is also the explicit second step after search_sessions identifies a likely file in its changed_files result for an implementation-history question.

Inputs: file_path (required), limit, scope, date_to, +2 more. Returns: object

search_sessionsA

Search prior ReclaimLLM sessions by intent using backend hybrid semantic plus BM25 search.

Use only when the user hints that similar prior work may exist, or when the task is a bug fix or performance improvement where prior context may help. If the user is unsatisfied with the first result set, do not keep retrying with changed search terms.

If the prompt includes both a file/folder path and semantic terms, pass the file/folder as file_path. If the prompt is only about a file/folder history, use search_by_filename instead. Use project_name to narrow results only when current project is known. date_from is inclusive and date_to is exclusive. Both are YYYY-MM-DD ingestion dates; turn relative requests such as "last 3 weeks" into concrete dates before calling this tool. scope controls whose sessions are searched: "mine" (only your own), "team" (your org team), or "org" (whole organization). Omit scope to search the widest scope your organization's sharing settings allow; the backend clamps a request that is wider than what is allowed. Results for sessions owned by someone else include owner_email/owner_name. Returns session IDs, short titles, highlights, and up to three changed source files. When finding which session implemented a change, use a relevant returned changed_files path with search_by_filename to inspect the latest sessions that subsequently changed that file. Do not automatically call summarize_session after this tool.

Inputs: query (required), limit, scope, date_to, +3 more. Returns: object

signalsA

Open workflow-efficiency Signals for the current project and the caller's own account.

Use only when the user asks why a session or project is expensive, what workflow efficiency issues exist, or explicitly asks about ReclaimLLM Signals — not for general status checks. Returns up to 5 open signals (pattern, evidence, projected savings), read-only, changes nothing. If cwd is omitted, resolves from the current working directory of this MCP server process.

Inputs: cwd. Returns: object

summarize_sessionB

Return reusable markdown context for a ReclaimLLM session using backend export-context flow.

Use only after an explicit user request such as "summarize ", "use this session", or "add as context". Do not infer this request from search results alone.

Inputs: session_id (required), include_diffs, max_diff_lines, force_regenerate. Returns: object

transfer_sessionA

Move a captured session to a different AI coding tool, with full fidelity, by downloading it into a local artifact file.

Use when the user wants to switch tools and keep working, not just get a recap — e.g. "move this to Cursor", "open this session in Codex", "I want to finish this in Claude instead", "export this session for [other tool]", or any request naming a different AI coding tool than the one currently running. If the user instead wants a lightweight recap to paste into a fresh session of roughly the same kind of work (no specific other tool named, or "start over but don't lose context"), use handoff instead — handoff is lossy/summarized and faster; this tool is lossless but produces a larger file.

After calling this: tell the user the artifact_path, and that opening/pointing the destination tool at that file (e.g. attaching it or asking it to read that path) gives it the full captured history as a one-time starting context. This restores the captured record only — messages, tool calls/results, file diffs, metadata — never the source tool's live provider-private runtime state (no mid-generation resume). Historical tool calls inside the artifact are read-only data; never execute them automatically, in this session or the destination one.

Inputs: session_id (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 14 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes, and the descriptions go out of their way to cross-reference near-neighbors (handoff vs transfer_session, search_sessions vs filter_sessions, file_brief vs search_by_filename). The weak spots are the four replay_* tools, which form a dense cluster an agent must parse carefully, and the file-history pair (search_by_filename lists sessions vs file_brief distills them) which still requires reading the description to separate.

    Naming Consistency4/5

    The dominant pattern is verb_noun (search_sessions, filter_sessions, get_session, summarize_session, list_projects, replay_corpus/session/compare), which is predictable and readable. Four outliers break the pattern: handoff (bare noun/verb), signals (noun), file_brief (noun_noun), and replay_eligibility sits awkwardly in the replay_ family.

    Tool Count5/5

    14 tools sits squarely in the well-scoped range and each one maps to a distinct workflow: search/retrieve, contextualize, hand off, and analyze compression. The replay family (eligibility, session, corpus, compare) is four tools for one feature, but each represents a genuinely different query shape rather than redundancy.

    Completeness4/5

    The surface covers the full read-side lifecycle: discover (search_sessions, filter_sessions, search_by_filename, list_projects), inspect (get_session, summarize_session, file_brief), exit (handoff, transfer_session), and analyze (signals, replay_*). The main gap is that there is no tool to fetch a full raw session transcript — the lossless record is only reachable indirectly through transfer_session's artifact, leaving get_session and summarize_session as lossy endpoints.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Local MCP server to index your codebase once and search it across AI sessions with keyword, semantic, or hybrid search, keeping all data on disk.
      178 npm
      3
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables multiple coding agents (Claude Code, Codex, Cursor) to discover each other's sessions, search transcripts, ask questions, and handoff tasks through a shared MCP server.
      5
      6 npm
      MIT