remote_claude CLAUDE.md

remote_claude CLAUDE.md is an instructions file for Claude Code from yyzybb537/remote_claude. It costs 12,732 tokens per session, scanned C, original, MIT.

A project instruction file describing how agents should work in the Remote Claude repository, including language rules, architecture, and important files. Remote Claude connects terminal clients and chat clients to shared Claude or Codex sessions.

In plain words
What is it for?
Use it to guide work on the Remote Claude server, terminal client, chat bridge, session handling, parsers, shared state, and message protocol.
Why use it?
It gives coding agents repository-specific context and constraints before they inspect or change the code.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions AGENTS.md.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/yyzybb537/remote_claude/claude-md
Clone the repo
git clone --depth 1 https://github.com/yyzybb537/remote_claude

Made for: Claude Code.

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 remote_claude CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/yyzybb537/remote_claude/claude-md.svg)](https://agentmods.dev/instructions/yyzybb537/remote_claude/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/yyzybb537/remote_claude/claude-md"><img src="https://agentmods.dev/badge/instructions/yyzybb537/remote_claude/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 12,732 This file is loaded in full into every session.
When invoked 12,732 The same file — it is already loaded in full.
Security scan C 1 finding. 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.12732 $0.12732
Opus 5 $0.06366 $0.06366
Sonnet 5 $0.02546 $0.02546
Haiku 4.5 $0.01273 $0.01273

Measured 6d ago against content hash 94d76ea5607b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade C, and why

remote_claude CLAUDE.md scanned grade C with 1 finding 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 6d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

"content": "rm -rf /tmp/test",
CLAUDE.md · 769 lines

How it starts

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

CLAUDE.md/AGENTS.md

This file provides guidance to Claude-Code/Codex when working with code in this repository.

关键语言要求

你必须完全使用 简体中文 进行交互、思考和汇报。

项目概述

Remote Claude 是一个双端共享 Claude/Codex CLI 工具。通过 PTY + Unix Socket 架构,支持多个终端客户端和飞书客户端并发连接同一个 Claude 或 Codex 会话,实现协作式 AI 对话。

架构

Claude/Codex CLI (PTY)
      │
  server.py         ← PTY 代理,管理进程/控制权/历史缓存
      │
  Unix Socket (/tmp/remote-claude/<name>.sock)
      │
  ┌───┴────┐
  │        │
client.py  SessionBridge (lark_client/)
(终端)     (飞书机器人)

核心模块:

  • remote_claude.py — CLI 入口,子命令:start / attach / list / kill / lark
  • server/server.py — PTY 代理服务器,pty.fork() 启动 Claude/Codex,asyncio Unix Socket 广播输出
  • server/parsers/claude_parser.py — Claude CLI 终端输出解析(区域切分、Block 分类、执行状态判断)
  • server/parsers/codex_parser.py — Codex CLI 终端输出解析(无分割线、 提示符、背景色区域检测)
  • server/component_parser.py — 向后兼容 shim(实际实现在 server/parsers/
  • server/shared_state.py — 共享内存写入(.mq 文件)
  • client/client.py — 终端客户端,raw mode 输入转发
  • utils/protocol.py — 消息协议(JSON + \n 分隔,二进制数据 base64 编码)。7 种消息类型:INPUT / OUTPUT / CONTROL / STATUS / HISTORY / ERROR / RESIZE
  • utils/session.py — socket 路径管理、会话生命周期
  • utils/components.py — 控制权状态机,SHARED(默认,所有人可输入)和 EXCLUSIVE(独占)两种模式

飞书客户端 (lark_client/):

  • main.py — WebSocket 入口,事件分发
  • lark_handler.py — 命令路由,以 chat_id 为 key 统一管理群聊/私聊的 bridge 和绑定
  • session_bridge.py — 连接 Unix Socket,仅负责输入发送(send_input/send_key)和连接管理
  • shared_memory_poller.py流式滚动卡片轮询器:每秒轮询 .mq 共享内存,通过 hash diff 驱动 CardSlice/StreamTracker 就地更新或冻结+开新卡
  • card_builder.pybuild_stream_card(blocks, status_line, bottom_bar, is_frozen, agent_panel, option_block, session_name, disconnected):四层结构卡片构建(内容区/状态区/交互区/菜单)+ 辅助卡片(session_list/menu/help/dir 等)
  • card_service.py — 飞书卡片 API 服务(create/update/send)
  • rich_text_renderer.py — 持久化 pyte Screen 封装(server 端实时喂入)

Server 端数据流(全量快照架构):

PTY data → self._renderer.feed(data) → HistoryScreen(220×100, history=5000) 持久化实时更新
                                            ↓ SU/SD 正确执行(ESC[nS/ESC[nT)
                                            ↓ 滚出行 → history.top(最多 5000 行)
                                            ↓(flush 触发)
                            (开启 --debug-screen)_write_screen_debug(原始 screen) → _screen.log
                                            ↓
                                    VirtualScreen(history.top + screen.buffer)
                                            ↓
                                    ScreenParser.parse(vscreen)
                                            ↓
                                    raw components 列表
                                            ↓
                                    分拣:visible_blocks / status_line / bottom_bar
                                            ↓
                                 ┌── 时序窗口平滑 ──┐
                                 │ _FrameObs 记录原始值 │
                                 │ 平滑 status_line     │
                                 │ 平滑 block blink     │
                                 └────────┬──────────┘
                                          ↓
                                    all_blocks = visible_blocks
                                          ↓
                                    ClaudeWindow 快照
                                          ↓
                                ├→ _messages.log (debug)
                                └→ .mq 共享内存 (全量覆写)

Read the full file on GitHub · 769 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. 6d ago First seen · 769 lines · 12,732 tokens per session scan C 94d76ea5607b

Subscribe to this mod's changes

remote_claude CLAUDE.md is an instructions file published in the GitHub repository yyzybb537/remote_claude (104 stars, last pushed 3mo ago), licensed MIT. It adds 12,732 tokens to every session, about $0.0637 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens