Relax: Agent for Claude Code

.opencode/agents/ray-expert.md

ray-expert is an agent for Claude Code, OpenCode from redai-infra/Relax. It costs 56 tokens per session (3,843 once invoked), scanned A, original, Apache-2.0.

An expert assistant for Ray, a framework for running Python tasks, actors, and services across multiple machines or processes.

In plain words
What is it for?
Use it when working with Ray tasks and actors, object references, placement groups, Ray Serve deployments, job submission, runtime environments, or cluster commands such as ray status.
Why use it?
It helps diagnose Ray-specific configuration, scheduling, communication, serialization, and cluster problems.

Agent for Claude CodeOpenCode

Written for OpenCode and Claude Code: installed under .opencode/, but also a Claude Code subagent (agents/*.md). Also seen: mentions subagents; positional $N argument.

This is redai-infra/Relax's own configuration. It tells Claude Code and OpenCode how to work on Relax itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Relax configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is -- python3 relax/entrypoints/train.py \.

Reuse

Borrowing it

Nothing to install: this file belongs to redai-infra/Relax. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/redai-infra/Relax/main/.opencode/agents/ray-expert.md
Clone the repo
git clone --depth 1 https://github.com/redai-infra/Relax

Made for: Claude Code, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ray-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/redai-infra/relax/ray-expert.svg)](https://agentmods.dev/agents/redai-infra/relax/ray-expert)
Your own site
<a href="https://agentmods.dev/agents/redai-infra/relax/ray-expert"><img src="https://agentmods.dev/badge/agents/redai-infra/relax/ray-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,843 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00056 $0.03843
Opus 5 $0.00028 $0.01921
Sonnet 5 $0.00011 $0.00769
Haiku 4.5 $0.00006 $0.00384

Measured 7d ago against content hash ccb8283a8dbc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

ray-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.opencode/agents/ray-expert.md · 456 lines

How it starts

The opening of the file, as written. The whole thing — 456 lines — stays where its author put it; the contents beside it link to each section on GitHub.


Ray Expert

You are an expert in the Ray framework as used within the Relax distributed RL training system. Your role is to guide correct usage of Ray Core (tasks, actors, object refs), Ray Serve (deployments, handles), placement groups, scheduling strategies, job submission, runtime environments, and Ray cluster operations.

When to Activate

Use this agent when:

  • Writing or debugging ray.remote actors and tasks
  • Working with ray.get, ray.wait, ray.put, or object ref lifecycle
  • Configuring placement groups and scheduling strategies (PACK, SPREAD, STRICT_PACK, STRICT_SPREAD, NodeAffinitySchedulingStrategy)
  • Deploying or managing Ray Serve services (serve.run, serve.deployment, handles)
  • Submitting jobs via ray job submit with --runtime-env-json or --working-dir
  • Troubleshooting serialization errors, object store issues, GCS failures, or scheduling failures
  • Configuring ray.init() and runtime environments
  • Working with Ray cluster lifecycle (ray start, ray stop, ray status)
  • Debugging actor/task state via ray list actors, ray list tasks

Not for: Megatron internals (use megatron-expert), FSDP internals (use fsdp-expert), RL algorithm logic (use algorithm-expert), or high-level orchestration design (use launcher-expert).

Ray in Relax: Overview

Relax uses Ray as the distributed runtime for all components. The stack relies on three Ray subsystems:

Subsystem Usage in Relax
Ray Core Remote actors for training, inference, data transfer, locks
Ray Serve HTTP-based service deployments (Actor, Rollout, Critic, etc.)
Ray Jobs Job submission to remote clusters via ray job submit

Architecture

ray job submit
  → relax/entrypoints/train.py
    → ray.init(runtime_env=...)
    → serve.start(...)
    → Controller.__init__()
      → create placement groups (ray.util.placement_group)
      → deploy Ray Serve services (serve.run)
      → inside each service:
        → spawn ray.remote actors (TrainRayActor, RolloutManager, etc.)
        → actors use dist.init_process_group for PyTorch DDP/FSDP/Megatron

Read the full file on GitHub · 456 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 456 lines · 56 tokens per session scan A ccb8283a8dbc

Subscribe to this mod's changes

ray-expert is an agent published in the GitHub repository redai-infra/Relax (580 stars, last pushed 9d ago), licensed Apache-2.0. It adds 56 tokens to every session and 3,843 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

product-owner

The first agent in the pipeline — runs BEFORE architect. Turns a raw idea or problem statement into a validated product brief. Frames the problem, brainstorms options, runs a multi-LLM idea debate (4 personas on 4 models), and synthesizes a recommendation the CTO approves at gate:product (the one human gate — WHAT…

avelikiy/great_cto · 89 tokens

mlops-reviewer

MLOps / model lifecycle pre-implementation reviewer. Outputs threat model TM-{slug}.md and signs off training-pipeline + serving-strategy decisions before senior-dev claims tasks.

avelikiy/great_cto · 41 tokens

geo-routing-engineer

Geospatial and routing specialist for Product-Builder products with maps, scheduling-by-location, or vehicle routing (route-optimization in logistics, dispatch in home services, field-booking). Owns the routing contract — geocoding, the VRP/routing model (constraints, objective), maps/distance-matrix provider…

avelikiy/great_cto · 112 tokens

prompt-architect

Designs new prompts from blank using CoT / ToT / ReAct / Constitutional / Self-Consistency / Atom-of-Thoughts patterns. Composes lab specialist for final pass. Auto-invokes when @prompt-conductor dispatches flow-design / flow-knowledge-base, or when Frank says "design a prompt for X", "build me a system prompt for Y"…

frankxai/agentic-creator-os · 131 tokens

prompt-claude-specialist

Anthropic / Claude prompting doctrine specialist. Owns XML-tag structure, prefill technique, extended-thinking signature integrity, system-as-role placement, constitution-style virtue prompting, and Console Prompt Improver 4-step (example identification → XML draft → CoT refinement → example enhancement). Auto-invokes…

frankxai/agentic-creator-os · 138 tokens

prompt-conductor

Top-level Opus composer for the Prompt Hub. Routes every prompt-engineering ask to the right 2-5 specialists from the 12-agent team. Auto-invokes when Frank says "design a prompt for X", "optimize this prompt", "evaluate my system prompt", "harvest prompts from Fabric", "build a knowledge-base prompt set", "IFS…

frankxai/agentic-creator-os · 152 tokens