Skip to main content
Glama
Claude Code × OpenCode

Claude Code × OpenCode

by AXLdev123

Manage a session

oc_session

Perform session actions such as diff, fork, rename, archive, set model or agent, run shell commands, load skills, revert changes, inspect context, or export. Use session_id plus action to manage a coding sub-agent session.

Instructions

Actions on a session: info, diff (files changed), fork, compact, rename, archive, delete, set_model, set_agent, shell (run a shell command in the session), load_skill, revert (undo changes from a message on), context (context/tokens), export.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "session_id": "<session_id>",
      "action": "<action>"
    },
    "name": "oc_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
valueNoTitle (rename), model (set_model), agent (set_agent), command (shell), skill id (load_skill), message id (revert / fork before that message).
actionYes
session_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are supplied, so the description carries the full behavioral burden. It hints at a few semantics (diff = files changed, revert = undo changes from a message on, shell = run a command in the session) but says nothing about which actions are destructive or irreversible, what delete/archive actually destroy, whether confirmation or permissions are required, or what any action returns.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence that names the resource first and then lists actions compactly, with parenthetical clarifications only where the action name is opaque. No filler, though the long comma-separated run is dense to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 16-value action multiplexer with no annotations and no output schema, this one-liner is thin: it never says which action needs which value, what each action returns, or how destructive operations behave, and it omits two enum values entirely. Dispatch across variants is the core complexity of this tool and it is largely undocumented.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 33%, and the only described parameter (value) is already fully mapped in the schema, so the description adds nothing there. It does add meaning for the action enum on a handful of values (diff, revert, context, shell) and the dispatcher pattern itself, but two enum values (unarchive, revert_clear) never appear in the description at all.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific resource (a session) and enumerates the operations it performs, so an agent knows this is a session-operation multiplexer rather than a list or messaging tool. It stops short of contrasting itself with siblings such as oc_sessions or oc_send, but the verb+resource pairing is clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The action list implies what each action is for, but there is no explicit when-to-use guidance, no prerequisites, and no statement of when to reach for a sibling tool instead (e.g., oc_sessions to enumerate sessions, oc_send to message one). An agent must infer routing from the action names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.