Skip to content
Agent Orchestration
Skill

/rlm-context-management

This skill activates when: - Context exceeds complexity threshold (cross-file reasoning, debugging with large output, multi-module tasks) - User explicitly requests RLM mode (`/rlm`) - Task requires verification chains (depth=2 patterns)

BOOST
From plugin
rlm-claude-code
1062 skills1 agent8 commands6 hooks
Install
$ npx -y skills add rand/rlm-claude-code --skill rlm-context-management --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/rlm-context-management

Context preview

The summary Claude sees to decide when to auto-load this skill.

This skill activates when: - Context exceeds complexity threshold (cross-file reasoning, debugging with large output, multi-module tasks) - User explicitly requests RLM mode (`/rlm`) - Task requires verification chains (depth=2 patterns)

SKILL.md

rlm-context-management.SKILL.md

RLM Context Management Skill

When to Activate

This skill activates when:

  • Context exceeds complexity threshold (cross-file reasoning, debugging with large output, multi-module tasks)
  • User explicitly requests RLM mode (`/rlm`)
  • Task requires verification chains (depth=2 patterns)

Capabilities

Context Externalization

  • Conversation history → `conversation` variable
  • Cached files → `files` dict
  • Tool outputs → `tool_outputs` list
  • Session state → `working_memory` dict

REPL Operations

  • `peek(var, start, end)` — View portion of context
  • `search(var, pattern, regex=False)` — Find patterns in context
  • `summarize(var, max_tokens=500)` — Summarize via sub-call
  • `recursive_query(query, context)` — Spawn sub-RLM call

Verification Tools

  • `pydantic` — Schema validation for structured data
  • `hypothesis` — Property-based testing
  • `cpmpy` — Constraint programming (available as `cp`)

Strategy Selection

For Large Context (>80K tokens)

1. Peek first 2K chars to understand structure 2. Search for relevant patterns 3. Partition and map over chunks if needed 4. Recursive queries for semantic understanding

For Debugging Tasks

1. Peek recent tool output for error 2. Search codebase for relevant files 3. Recursive query to analyze each candidate 4. Verify fix won't break other code (depth=2)

For Multi-File Refactoring

1. Identify all affected files via search 2. Recursive query for each file's current state 3. Plan changes with dependency awareness 4. Verify with CPMpy constraint model (depth=2)

Output Protocol

Signal completion with:

  • `FINAL(answer)` — Direct answer
  • `FINAL_VAR(var_name)` — Answer stored in variable

Trajectory

All RLM operations emit trajectory events for visibility:

  • ANALYZE, REPL, REASON, RECURSE, FINAL
  • Streaming output with configurable verbosity
  • JSON export for debugging

Configuration

{
  "rlm": {
    "activation": {"mode": "complexity"},
    "depth": {"default": 2, "max": 3},
    "trajectory": {"verbosity": "normal", "streaming": true}
  }
}

References

  • Spec: rlm-claude-code-spec.md
  • RLM Paper: https://arxiv.org/abs/2512.24601v1
  • CPMpy Docs: https://cpmpy.readthedocs.io/
Read more
Ships withrlm-claude-code

Transform Claude Code into a Recursive Language Model (RLM) agent with intelligent orchestration, unbounded context handling, persistent memory, and REPL-based decomposition.

Get the whole plugin

Other skills on rlm-claude-code.