corral

A read-only command-line tool for searching and inspecting past coding-agent sessions stored on your computer. It can work with histories from Claude Code, Codex CLI, OpenCode, Kimi Code CLI, Cursor Agent CLI, and Pi.

In plain words
What is it for?
Use it to list recent sessions, search by topic, inspect a session, export a transcript with tool calls and reasoning, or prepare context for continuing interrupted work.
Why use it?
It helps recover context from earlier work without opening each tool or changing the stored conversation history.

Skill for Claude CodeCodex

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 skills/x0c/corral/docs
Any agent
npx skills add x0c/corral --skill docs
Clone the repo
git clone --depth 1 https://github.com/x0c/corral

Made for: Claude Code, Codex.

Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,107 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 $0.00080 $0.06107
Opus 5 $0.00040 $0.03053
Sonnet 5 $0.00016 $0.01221
Haiku 4.5 $0.00008 $0.00611

Measured yesterday against content hash d6b93bfebd37, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

corral 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 yesterday.

The scan reads SKILL.md. This mod also ships 1 executable file (screenshots/capture.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

docs/SKILL.md · 267 lines

How it starts

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

corral:本地编程会话数据接口

corral 扫描本机 ~/.claude/projects/~/.codex/sessions/~/.kimi-code/sessions/~/.cursor/chats/ 和 OpenCode 的 SQLite 数据库(~/.local/share/opencode/opencode.db,只读打开)下的会话历史,为大模型 Agent 提供结构化查询命令。这些命令只读、无副作用:不会拉起新会话、不会自动接续任务、不会修改 任何历史文件。拿到数据之后要做什么(继续任务、汇总给用户、转发给另一个 Agent)由调用方决定。

所有命令输出统一 JSON envelope,写到 stdout:

{"ok": true, "data": {...}, "error": null, "meta": {"version": 1}}

失败时 okfalsedatanullerror 包含:

  • code:程序可判断的错误分类(usage_error / not_found / ambiguous / history_unavailable
  • message:人类可读的错误说明
  • hint:建议的排查方向
  • next_commands:可以直接执行的后续命令列表

退出码:0 成功、1 一般失败、2 用法错误(参数不对)、3 会话不存在、5 会话标识有歧义。 不要只看 stdout 是否有内容来判断成功,检查退出码或 ok 字段。

命令

corral describe 获取全部命令的机器可读参数说明(与实现同源,不会漂移); corral describe <command> 看单个命令的完整参数和输出字段。

命令 用途
corral list [--runtime R] [--limit N] [--top N] [--compact] [--status S] [--cwd 子串] [--live] [--fields a,b] 结构化列出会话
corral search <关键词...> [--deep] [--runtime R] [--limit N] [--top N] [--compact] [--live] [--fields a,b] 按主题找会话
corral show <会话> [--messages N | --full] [--compact] [--out 路径] [--fields a,b] 会话详情 + 对话内容
corral share <会话> [--out 路径] [--compact] 导出含 thinking / 工具调用的统一 transcript,给其他 Agent 做元认知
corral export [--since T] [--until T] [--runtime R] [--status S] [--cwd 子串] [--limit N] [--out 路径] [--compact] 导出某时间范围内所有会话的完整对话,合并为一个 JSON
corral context <会话> 生成接续该会话所需的上下文数据包
corral plan continue <会话> --instruction <文本> 生成带新指令的非交互式原生续接计划;只返回数据,不执行
corral describe [command] 查看命令 / 参数 / 输出字段说明
corral diagnose 只读诊断:events.log / embed-error.log / last_error / 截图目录 / tmux / 配色自检 / 安装路径package_fileinstall_channelstale_source_warning);不启动 TUI

会话标识(<会话> 参数)

支持完整会话 ID、ID 前缀(如 8892cd3d)、或带运行时限定的 runtime:id(如 claude:8892cd3dopencode:ses_0ae26219kimi:session_ef8275b0cursor:<chat-uuid>)。 前缀在多个运行时之间重复时会返回退出码 5(ambiguous),error.next_commands 里给出具体候选 的 corral show runtime:id 命令,照着执行即可消歧。

Read the full file on GitHub · 267 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. yesterday First seen · 267 lines · 80 tokens per session scan A d6b93bfebd37

Subscribe to this mod's changes

corral is a skill published in the GitHub repository x0c/corral (2 stars, last pushed 2d ago), licensed MIT. It adds 80 tokens to every session and 6,107 once invoked, about $0.0004 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-31.

Related

Other skills, from other repositories

write-documentation

Write and format Rust documentation correctly. Apply proactively when writing code with rustdoc comments (//! or ///). Covers voice & tone, prose style (opening lines, explicit subjects, verb tense), structure (inverted pyramid), intra-doc links (crate:: paths, reference-style), constant conventions (binary/byte…

r3bl-org/r3bl-open-core · 102 tokens

organize-modules

Apply private modules with public re-exports (barrel export) pattern for clean API design. Includes conditional visibility for docs and tests. Use when creating modules, organizing mod.rs files, or before creating commits.

r3bl-org/r3bl-open-core · 47 tokens

check-bounds-safety

Apply type-safe bounds checking patterns using VPIndex/VPLength types instead of usize. Use when working with arrays, buffers, cursors, viewports, or any code that handles indices and lengths.

r3bl-org/r3bl-open-core · 46 tokens

check-code-quality

Run comprehensive Rust code quality checks including compilation, linting, documentation, and tests. Use after completing code changes and before creating commits.

r3bl-org/r3bl-open-core · 31 tokens

analyze-performance

Establish performance baselines and detect regressions using flamegraph analysis. Use when optimizing performance-critical code, investigating performance issues, or before creating commits with performance-sensitive changes.

r3bl-org/r3bl-open-core · 38 tokens

run-clippy

Run clippy linting, enforce comment punctuation rules, format code with cargo fmt, and verify module organization patterns. Use after code changes and before creating commits.

r3bl-org/r3bl-open-core · 36 tokens