Skip to main content
Glama
huaqing0
by huaqing0

Claude Tools Native Gateway

Одной фразой: превратить веб-версию ChatGPT в единственный главный мозг, который управляет реальными нативными сессиями Claude Code на локальной машине для контролируемого чтения, изменения, проверки и восстановления.

Публичный репозиторий содержит только исходный код и тесты, без локальных ключей, конфигурации Tunnel или состояния сессий в state/.

Архитектура

У Gateway теперь только один движок исполнения — Native V2:

当前 ChatGPT Chat(唯一主脑)
  ↔ Claude Tools Native MCP(六个 Session 控制工具)
      ↔ 本地模型回合桥(127.0.0.1)
          ↔ 隔离的 Claude Code 原生 Session
              → 原生 Agent loop
              → 网关自有的受控工具 Executor

Gateway сам выполняет инициализацию MCP, список инструментов и диспетчеризацию вызовов, больше не запуская и не проксируя инструмент-сервер claude mcp serve из V1. Только после создания Native Session запускается процесс Claude Code, принадлежащий этой сессии.

Прежние V1 Agent Session, верхнеуровневые Read/Edit/Write/Bash, локальные инструменты задач, старая делегация DeepSeek и ChatGPT Bridge удалены из точки входа и дерева кода. Сохранены только общие низкоуровневые механизмы, которые по-прежнему нужны V2: атомарная запись состояния, защита путей к учётным данным, проверка подлинности процесса и правила песочницы macOS. Старые файлы состояния V1 не удаляются автоматически, но Native Gateway их не читает и не исполняет.

Related MCP server: localterminal-lite

Плоскость управления MCP

Веб-версия видит только шесть инструментов:

  • native_session_start

  • native_session_continue

  • native_session_recover

  • native_session_reply_and_wait

  • native_session_status

  • native_session_stop

Любые имена инструментов V1, верхнеуровневые файловые инструменты, Bash, старые инструменты DeepSeek или другие методы MCP отклоняются на стороне сервера, а не просто скрываются из списка инструментов.

Возможности сессии Claude Code

У сессии есть три чётких уровня, которые нельзя повысить/понизить или сменить корневой каталог после создания:

  • read_only: Read, FindFiles, SearchText и read-only RunCommand; область чтения — весь компьютер, за исключением защищённых путей состояния/учётных данных и разрешений macOS.

  • direct_write: добавляет Edit, Write, NotebookEdit к чтению по всему компьютеру, изменяя только реальные каталоги, явно выбранные пользователем. Этот уровень следует выбирать только тогда, когда пользователь явно просит изменить реальные файлы.

  • worktree_write: набор инструментов тот же, что и у direct_write, но изменения вносятся в отдельный Git worktree, созданный и сохраняемый Gateway; исходный checkout не меняется.

Это логические инструменты, которые модель может вызывать в нативном цикле агента Claude Code, но исполнитель принадлежит Gateway. Неуправляемые встроенные файловые инструменты и Bash Claude Code по-прежнему отключены, чтобы не обойти авторизацию действий, хеширование, восстановление и реестр аудита.

Чтение и поиск

  • Read может читать любой незащищённый обычный UTF-8 файл на компьютере, больше не ограничен каталогом записи.

  • FindFiles выполняет ограниченное перечисление файлов из любого абсолютного каталога.

  • SearchText выполняет только буквальное сопоставление UTF-8, без регулярных выражений и glob.

  • Поиск не следует по символическим ссылкам, пропускает .git, защищённые пути и внешние жёсткие ссылки.

  • Результаты одного поиска и полные квитанции действий ограничены 64 КиБ.

  • Все уровни могут проверять разные диски и каталоги; working_directory — это лишь место поиска по умолчанию, CWD команд и граница записи для уровней записи. Разрешения macOS TCC/файловые разрешения всё ещё могут отклонять доступ к Desktop, Documents и другим системно защищённым местам.

Изменение файлов и Notebook

  • В direct_write Edit, Write и NotebookEdit изменяют реальный каталог, привязанный к сессии; в worktree_write — только управляемый worktree.

  • Write может по мере необходимости создавать недостающие родительские каталоги внутри авторизованного корневого каталога, а затем атомарно создавать целевой файл; это не позволяет выйти за пределы корневого каталога, символических ссылок, .git или защищённых путей.

  • NotebookEdit поддерживает замену, вставку и удаление ячеек по cell ID, но не исполняет Notebook.

  • Каждое действие записи сохраняет SHA-256 до и после записи и использует подготовку, CAS, атомарную запись на диск и постоянную квитанцию.

  • После сбоя процесса сверяется реальное состояние файла; если определить его нельзя, восстановление останавливается, без слепого повторения записи.

  • В direct_write нет инструмента удаления файлов, и команды проверки только для чтения не записывают файлы; он всё же может перезаписывать или изменять целевые файлы по явной инструкции пользователя.

  • В worktree_write файлы, HEAD, tree, index и состояние рабочей области исходного checkout остаются неизменными; общий каталог Git регистрирует сохраняемый worktree.

Команды проверки

RunCommand принимает установленные системные команды и исполняемые файлы внутри каталога сессии, больше не поддерживая статический белый список команд, который легко задевает обычные инструменты разработки. Аргументы по-прежнему передаются точным argv, Gateway не собирает их автоматически в строку shell:

  • корневая файловая система сессии с точки зрения команды доступна только для чтения;

  • сеть, сигналы процессов, Keychain/XPC и CLI моделей блокируются Seatbelt macOS;

  • sudo, прямое удаление/перемещение, системное управление, find -delete/-exec, rg --pre, CLI моделей и другие точки входа по-прежнему явно отклоняются;

  • символические ссылки, жёсткие ссылки или количество файлов в обычном проекте больше не приводят к отклонению всего репозитория до запуска команды; при реальном доступе действуют Seatbelt, защищённые пути и разрешения macOS;

  • вывод, время выполнения и сбор дочерних групп процессов ограничены;

  • результат сначала попадает в тот же реестр действий, затем передаётся следующему ходу GPT.

Он предназначен для проверки доверенных репозиториев, а не как контейнер против вредоносных процессов того же аккаунта macOS. Во время работы сессии не изменяйте управляемый worktree параллельно из других редакторов или процессов.

Основная модель, веб-поиск и DeepSeek

Основной маршрут жёстко задан как chatgpt-main, параметры model, provider, endpoint, API key или fallback не принимаются. Когда текущий ход ChatGPT останавливается, Claude Code останавливается в состоянии waiting_for_gpt; он не переключается самовольно на Claude, DeepSeek или Codex для продолжения размышлений.

Веб-поиск по-прежнему выполняет веб-версия ChatGPT. WebSearch/WebFetch Claude Code не открыты, поэтому не возникает конфликтов между поиском GPT и собственным поиском Claude или потери контроля над источниками.

По умолчанию subagent_policy: "none", DeepSeek не создаётся. Только когда worktree_write явно выбирает deepseek_explicit, GPT может использовать в основном цикле:

  • deepseek_subagent_start

  • deepseek_subagent_get

  • deepseek_subagent_stop

Делегация сначала должна попасть в постоянный реестр действий основной сессии, и только затем разрешается изолированная подсессия. Во время подзадачи основная сессия не может параллельно выполнять Edit, Write, NotebookEdit, RunCommand или запускать вторую подзадачу. Маршрут жёстко задан: Sonnet/Opus → Flash, Fable → Pro; при сбое нет отката на Claude, Codex, OpenAI или другой уровень DeepSeek.

Контекст навыков

native_session_start может принимать до восьми skill_contexts, явно выбранных ChatGPT. Это не нативная среда выполнения навыков Claude Code:

  • извлекается и замораживается только проверенное тело инструкций;

  • не загружаются скрипты, ресурсы, плагины, Hook, Slash Command или дополнительные инструменты;

  • для каждого разрешённого элемента фиксируются одновременно skill ID и SHA-256 нормализованного полного SKILL.md;

  • первый запуск и последующий resume используют один и тот же постоянный снимок;

  • полный текст появляется только в приватном состоянии 0600 и в контексте модели, необходимом текущему GPT.

Пример разрешённого списка:

CLAUDE_TOOLS_NATIVE_SKILL_ALLOWLIST_JSON='[{"skill_id":"personal:review","content_sha256":"<64位小写SHA-256>"}]' \
npm start

Хеш вычисляется по полному тексту после удаления UTF-8 BOM и приведения CRLF/CR к LF.

Изоляция и восстановление

  • Каждая сессия использует отдельные HOME, каталог конфигурации Claude, рабочий каталог и группу процессов.

  • Claude Code запускается с --bare, пустыми источниками настроек, строгой конфигурацией MCP и точным набором инструментов.

  • Основной процесс Claude может обращаться только к точному локальному loopback-порту Broker/Executor.

  • Каталоги учётных данных, состояние Gateway, .git, символические ссылки и внешние жёсткие ссылки закрыты по принципу fail closed; доступность обычных системных/пользовательских путей определяется корнем сессии, TCC macOS и файловыми разрешениями.

  • Ответ ChatGPT и каждое разрешённое действие сначала атомарно записываются на диск, затем передаются работающему процессу.

  • Истечение аренды останавливает Runner и оставляет проверяемое состояние.

  • Перезапуск Gateway не убивает Runner, всё ещё принадлежащий сессии; native_session_recover проверяет право владения, ротирует аренду и продолжает ту же сессию Claude Code.

  • Если Runner уже не существует, восстановление не имитируется и завершённые действия не повторяются.

В Claude Code 2.1.247 нет проверенного отдельного переключателя «включить только Hooks, продолжая отключать keychain, плагины и автоматическую память», поэтому нативные Hooks, нативные Skill/Slash, Agent, Workflow, Web и сторонние MCP без надзора реестра действий остаются отключёнными.

Запуск

npm start

Native Gateway больше не требует переключателей CLAUDE_TOOLS_NATIVE_V2 или CLAUDE_TOOLS_NATIVE_V2_ONLY; Native-only — единственный режим работы.

Состояние по умолчанию сохраняется в state/, его можно изменить через переменную окружения с абсолютным путём CLAUDE_TOOLS_STATE_DIR. Путь Claude Code по умолчанию — $HOME/.npm-global/bin/claude, его можно переопределить через CLAUDE_BIN.

Долгоживущие Tunnel/Connector требуют перезапуска после обновления исходного кода. ChatGPT может кэшировать схему подключённых инструментов; если в новой сессии не видно шести native_session_*, обновите или переподключите Claude Tools Connector.

Проверка

npm test
npm run test:native:installed
npm run test:native:installed:write
npm run test:native:installed:direct-write
npm run test:native:installed:deepseek
npm run test:native:installed:skills

Автоматические тесты покрывают:

  • прямую инициализацию MCP только в Native-режиме, ровно шесть инструментов, отклонение инструментов V1 и неизвестных методов;

  • реестр ходов и действий, идемпотентность ответов, аренду, право владения процессом, остановку и восстановление;

  • чтение по всему компьютеру через Read/FindFiles/SearchText, защищённые пути, размеры, сортировку, буквальное сопоставление и границы гонок;

  • Edit/Write/NotebookEdit: прямую запись в реальный каталог, изоляцию worktree, CAS, хеши и восстановление после сбоя;

  • RunCommand: свободный вход для команд разработки, локальные исполняемые файлы сессии, файловую систему только для чтения, нулевую сеть, блокировку чувствительных служб и сбор по таймауту;

  • фиксацию ID/хеша тела навыков, согласованность start/resume и границы приватного состояния;

  • явную делегацию DeepSeek: барьер запуска, блокировку записи одной задачи, проверку маршрута, восстановление после перезапуска Gateway и остановку;

  • отсутствие утечки авторизационных ID, токенов Runner, PID, внутренних путей или учётных данных модели в публичных MCP/Session/history.

Установочные тесты используют локальный Claude Code 2.1.247 и скриптовый GPT на localhost, не подключаясь к реальным моделям:

  • test:native:installed: выполнение FindFiles → буквальный SearchText → Read → final с корнем только для чтения /, а также восстановление того же Runner/Claude Session после отключения Gateway.

  • test:native:installed:write: Read → Edit → Write → NotebookEdit → RunCommand → resume → Read.

  • test:native:installed:direct-write: тот же набор реальных ходов Claude Code напрямую изменяет реальный каталог в тестовом фикстуре, затем resume и проверка постоянных результатов.

  • test:native:installed:deepseek: проверка явной делегации, проверки результатов, активной блокировки записи, восстановления после перезапуска и остановки с помощью локального фейкового CLI DeepSeek.

  • test:native:installed:skills: проверка, что два навыка с фиксированным хешем, содержащие только инструкции, используют один и тот же снимок при start/resume.

Эти локальные скриптовые тесты не расходуют квоты реальных моделей ChatGPT, Claude или DeepSeek. Минимальный смоук-тест с реальным DeepSeek по-прежнему требует отдельного разрешения пользователя.

Available Tools

6 tools
native_session_continueA
Idempotent

Continue the same durable native Claude Code session without changing its immutable capability profile or filesystem root. ChatGPT remains the sole main model. A direct_write Session continues to address the same real directory; a worktree_write Session continues in its retained managed worktree. A Session created with deepseek_explicit may inspect or stop its explicitly started DeepSeek subagent; the subagent never takes over the main loop.

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesNew user prompt to continue the same native session.
lease_idYesCurrent lease id for the native session.
wait_secondsNoSeconds to wait for the next pending turn, from 0 to 50. Defaults to 30.
idempotency_keyYesStable retry id. Reusing it with different input is rejected.
native_session_idYesNative session id returned by native_session_start.

Output Schema

ParametersJSON Schema
NameRequiredDescription
routeYes
replayYes
statusYes
fallbackYes
lease_idYes
revisionYes
terminalNo
workspaceYes
current_runYes
last_resultNo
launch_errorNo
pending_turnYes
stop_requestNo
session_labelYes
deepseek_routeYes
recovery_tokenNo
skill_snapshotYes
subagent_policyYes
lease_expires_atYes
network_boundaryYes
runtime_attachedYes
source_directoryYes
claude_session_idYes
native_session_idYes
recovery_requiredYes
working_directoryYes
capability_profileYes
deepseek_subsessionsYes
active_deepseek_subsession_idYes

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already mark this as idempotent and non-destructive, and the description adds meaningful behavioral invariants: the capability profile and filesystem root stay unchanged, ChatGPT remains the sole main model, worktree behavior depends on session type, and a DeepSeek subagent cannot take over the main loop. These details go beyond what annotations or schema convey.

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?

The description is compact and front-loaded with the core purpose, then adds behavior details about session types and the DeepSeek subagent. Each sentence contributes useful information, though the session-type sentences could be seen as elaborating what the first sentence already implies.

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

Completeness4/5

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

Given the 100% schema coverage, the presence of an output schema, and annotations covering idempotency and safety, the description supplies enough behavioral context for an agent to invoke the tool correctly. The only notable gap is the lack of explicit routing guidance against sibling continuation-related tools.

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 description coverage is 100%, so the schema already documents all five parameters thoroughly. The description adds high-level session context but does not add parameter-specific semantics beyond what is already present in the input schema.

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?

Clearly states the action: continue the same durable native session while preserving its capability profile, filesystem root, and main model. This distinguishes it from starting a new session, though it does not explicitly differentiate it from siblings like native_session_recover or native_session_reply_and_wait.

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

Usage Guidelines3/5

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

The description implies this tool is for resuming an existing durable session rather than starting a new one, but it never explicitly names alternatives or states when to prefer this over native_session_recover or native_session_reply_and_wait. The guidance is contextual but not directive.

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

native_session_recoverB
Idempotent

Reconnect ChatGPT to a durable native Claude Code session and rotate its lease. ChatGPT remains the sole main model. Any DeepSeek access remains limited to the Session's original explicit subagent policy; a write session is accepted only after its original direct directory or retained managed worktree binding is verified.

ParametersJSON Schema
NameRequiredDescriptionDefault
recovery_idYesStable retry id for this recovery and lease rotation.
wait_secondsNoSeconds to wait for the recovered state or pending turn, from 0 to 50. Defaults to 0.
recovery_tokenYesOpaque recovery token returned when the native session was created.
native_session_idYesNative session id to recover.

Output Schema

ParametersJSON Schema
NameRequiredDescription
routeYes
replayYes
statusYes
fallbackYes
lease_idYes
revisionYes
terminalNo
workspaceYes
current_runYes
last_resultNo
launch_errorNo
pending_turnYes
stop_requestNo
session_labelYes
deepseek_routeYes
recovery_tokenNo
skill_snapshotYes
subagent_policyYes
lease_expires_atYes
network_boundaryYes
runtime_attachedYes
source_directoryYes
claude_session_idYes
native_session_idYes
recovery_requiredYes
working_directoryYes
capability_profileYes
deepseek_subsessionsYes
active_deepseek_subsession_idYes

TDQS

B3.4/5.0
Behavior4/5

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

Annotations already convey idempotency and non-destructiveness; the description adds meaningful context by stating that ChatGPT remains the sole main model, that DeepSeek access is limited by the original subagent policy, and that a write session requires verification of its directory or worktree binding. This goes beyond the annotations and helps an agent understand important constraints.

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?

The description is reasonably concise and front-loaded with the primary action. The second and third sentences add important behavioral constraints, though the third sentence is dense and slightly harder to parse. Overall, no sentence feels purely redundant.

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

Completeness3/5

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

The description covers the core purpose and key constraints, and the output schema likely handles return-value expectations. However, it lacks explicit usage guidance, does not differentiate from sibling tools, and does not state what happens when verification fails or the lease cannot be rotated. These are meaningful gaps for a recovery operation.

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 description coverage is 100%, so the schema already documents all four parameters. The description does not add parameter-level meaning beyond the schema, such as the relationship between wait_seconds and lease rotation or the origin of the recovery token. Per baseline for high schema coverage, a 3 is appropriate.

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?

The description opens with a specific verb and resource: 'Reconnect ChatGPT to a durable native Claude Code session and rotate its lease.' This clearly conveys the core action. It does not explicitly name or contrast sibling tools, so it stops short of fully distinguishing itself from tools like native_session_continue.

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?

There is no explicit guidance on when to use this tool versus siblings such as native_session_continue, native_session_status, or native_session_reply_and_wait. The word 'Reconnect' loosely implies a recovery scenario, but no conditions, alternatives, or exclusions are stated.

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

native_session_reply_and_waitA
DestructiveIdempotent

Submit ChatGPT's response for one exact pending native turn. ChatGPT is always the sole main model. Every profile permits bounded whole-computer Read, FindFiles, literal SearchText, and a network-blocked, filesystem-read-only RunCommand except on protected credential/state paths. direct_write permits gateway-authorized Edit, Write, and NotebookEdit only inside the selected real write root. worktree_write permits the same mutations only inside its retained managed worktree. A Session created with deepseek_explicit may additionally start, inspect, or stop one explicit DeepSeek subagent; start must be the only call in that response.

ParametersJSON Schema
NameRequiredDescriptionDefault
textNoOptional assistant text for this turn.
turn_idYesPending turn id being answered.
lease_idYesLease id returned by native_session_start.
reply_idYesStable idempotency id for this reply.
tool_callsNoOptional gateway-authorized calls. The Session profile and fixed subagent policy decide which calls are accepted. DeepSeek start must be the sole call. Text plus all calls must stay within a 768 KiB aggregate reply budget.
native_session_idYesNative session id returned by native_session_start.

Output Schema

ParametersJSON Schema
NameRequiredDescription
routeYes
replayYes
statusYes
fallbackYes
lease_idYes
revisionYes
terminalNo
workspaceYes
current_runYes
last_resultNo
launch_errorNo
pending_turnYes
stop_requestNo
session_labelYes
deepseek_routeYes
recovery_tokenNo
skill_snapshotYes
subagent_policyYes
lease_expires_atYes
network_boundaryYes
runtime_attachedYes
source_directoryYes
claude_session_idYes
native_session_idYes
recovery_requiredYes
working_directoryYes
capability_profileYes
deepseek_subsessionsYes
active_deepseek_subsession_idYes

TDQS

A3.9/5.0
Behavior4/5

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

Annotations mark the call as destructive and idempotent; the description adds substantial behavioral context by enumerating per-profile permissions (network-blocked read-only RunCommand, direct_write vs worktree_write roots) and the deepseek_explicit subagent exception. It does not explicitly describe the waiting/blocking behavior implied by the name, but the policy detail goes well beyond the annotations.

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?

The description is roughly 130 words and opens with the core action in the first sentence. Each following sentence covers a distinct policy area without significant redundancy, making it dense but not bloated.

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

Completeness4/5

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

For a tool this complex, the description covers the essential constraints: exact turn targeting, sole main-model ownership, per-profile permissions, and subagent limitations. The wait behavior is only hinted at by the tool name, and the description does not state what happens after submission, though an output schema exists to fill return-value gaps.

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 100%, so the baseline is 3. The description adds a useful summary of which tool_calls are permitted and restates the sole-call rule for DeepSeek start, but it does not individually explain native_session_id, lease_id, turn_id, or reply_id beyond what the schema already documents.

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

Purpose5/5

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

The first sentence states a specific action: 'Submit ChatGPT's response for one exact pending native turn.' It identifies the verb, the resource, and the exactness constraint, which clearly separates it from the session lifecycle siblings. The 'ChatGPT is always the sole main model' line further clarifies its role in the session.

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

Usage Guidelines3/5

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

The description implies the required condition—'one exact pending native turn'—and gives operational rules for tool_calls, such as 'DeepSeek start must be the only call.' However, it never explicitly contrasts this tool with siblings like native_session_continue or states when not to use it.

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

native_session_startA
Idempotent

Start an isolated native Claude Code session with the current ChatGPT conversation as the sole main model. subagent_policy defaults to none. All profiles may use Read, FindFiles, literal SearchText, and a network-blocked, filesystem-read-only RunCommand across the computer except protected credential/state paths. working_directory remains the command CWD and, for write profiles, the only write root. read_only never writes. When the user explicitly asks to modify the actual files in working_directory, choose direct_write; it works for Git and non-Git directories. Choose worktree_write only for an isolated copy of a clean Git repository. deepseek_explicit remains available only with worktree_write; DeepSeek never becomes the main model.

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesTask to start in the native session.
wait_secondsNoSeconds to wait for the first pending turn, from 0 to 50. Defaults to 30.
session_labelNoOptional short label for the owning ChatGPT conversation.
skill_contextsNoOptional explicit, allowlisted SKILL.md contexts selected by ChatGPT for this immutable Session. They add instructions only and cannot grant tools or change providers.
idempotency_keyYesStable retry id. Reusing it with different input is rejected.
subagent_policyNoOptional subagent boundary. Defaults to none. deepseek_explicit requires worktree_write; ChatGPT remains the sole main model.
working_directoryYesAbsolute command CWD and write root. Read, FindFiles, and SearchText may inspect other absolute paths across the computer except protected state/credential paths. direct_write modifies this directory in place and does not require Git. worktree_write requires the clean top level of a Git repository.
capability_profileNoExecution boundary. Defaults to read_only. If the user explicitly requested in-place changes to actual files, use direct_write, including for non-Git directories. Use worktree_write only when an isolated retained copy of a clean Git repository is desired.

Output Schema

ParametersJSON Schema
NameRequiredDescription
routeYes
replayYes
statusYes
fallbackYes
lease_idYes
revisionYes
terminalNo
workspaceYes
current_runYes
last_resultNo
launch_errorNo
pending_turnYes
stop_requestNo
session_labelYes
deepseek_routeYes
recovery_tokenNo
skill_snapshotYes
subagent_policyYes
lease_expires_atYes
network_boundaryYes
runtime_attachedYes
source_directoryYes
claude_session_idYes
native_session_idYes
recovery_requiredYes
working_directoryYes
capability_profileYes
deepseek_subsessionsYes
active_deepseek_subsession_idYes

TDQS

A4.6/5.0
Behavior5/5

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

With annotations already marking idempotentHint=true and destructiveHint=false, the description adds rich behavioral context: isolated session, subagent_policy default, restricted tool capabilities (network-blocked, filesystem-read-only RunCommand), protected credential/state paths, working_directory as the only write root for write profiles, and read_only never writes. This gives the agent a clear model of side effects and boundaries.

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?

The description is front-loaded with the core purpose in the first sentence and every subsequent sentence carries meaningful constraint information. It is a dense paragraph rather than structured bullets, and a couple of details (subagent_policy defaults to none) duplicate the schema, but it is appropriately concise for a tool with this many behavior-affecting choices.

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

Completeness5/5

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

Given the rich input schema, output schema, and annotations, the description covers all invocation-critical decisions: profile selection, subagent policy, working directory semantics, tool restrictions, and write behavior. Nothing needed to call the tool correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds useful decision semantics on top: capability_profile selection guidance (read_only never writes, direct_write works for Git/non-Git, worktree_write only for clean Git), the write-root constraint, and the deepseek_explicit-worktree coupling. Some of this duplicates schema text, but 'only write root' and 'read_only never writes' add meaning beyond the param descriptions.

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

Purpose5/5

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

The opening sentence states the exact action: start an isolated native Claude Code session with the current ChatGPT conversation as sole main model. This is a specific verb + resource and distinguishes native_session_start from the continue/recover/reply_and_wait/status/stop siblings by the 'start' action.

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

Usage Guidelines4/5

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

The description clearly tells when to choose direct_write (explicit user request to modify actual files, Git or non-Git) and worktree_write (isolated copy of a clean Git repo), and ties deepseek_explicit to worktree_write. It does not explicitly name sibling tools or state when to use start over continue/recover, so it falls short of full alternative routing.

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

native_session_statusA
Read-onlyIdempotent

Read native-session state without advancing it or invoking a model. ChatGPT remains the sole main model. Safe summaries of any explicitly enabled DeepSeek subagent and the retained managed-worktree location are returned when present.

ParametersJSON Schema
NameRequiredDescriptionDefault
lease_idYesLease id returned by native_session_start.
wait_secondsNoSeconds to wait for a state change, from 0 to 50. Defaults to 0.
native_session_idYesNative session id returned by native_session_start.

Output Schema

ParametersJSON Schema
NameRequiredDescription
routeYes
replayYes
statusYes
fallbackYes
lease_idYes
revisionYes
terminalNo
workspaceYes
current_runYes
last_resultNo
launch_errorNo
pending_turnYes
stop_requestNo
session_labelYes
deepseek_routeYes
recovery_tokenNo
skill_snapshotYes
subagent_policyYes
lease_expires_atYes
network_boundaryYes
runtime_attachedYes
source_directoryYes
claude_session_idYes
native_session_idYes
recovery_requiredYes
working_directoryYes
capability_profileYes
deepseek_subsessionsYes
active_deepseek_subsession_idYes

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnly, idempotent, and non-destructive behavior, and the description adds meaningful context beyond those flags: it explicitly states no session advancement and no model invocation, and clarifies that only safe summaries of enabled DeepSeek subagents and the managed-worktree location are returned. This substantially helps an agent predict side effects.

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

Conciseness5/5

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

The description is two sentences with no filler. The most decision-relevant facts—reading state, not advancing, not invoking a model—are front-loaded, and the second sentence adds precise return-value context without unnecessary length.

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

Completeness5/5

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

Given the output schema, 100% parameter coverage, and annotations that already define safety characteristics, the description supplies the remaining context an agent needs: the tool is side-effect-free, returns safe summaries when present, and preserves ChatGPT as the sole main model. Nothing essential is missing for correct invocation.

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 description coverage is 100%, so the input schema already documents all parameter meanings. The description does not add significant parameter-level detail beyond what the schema provides, so the baseline score of 3 is appropriate.

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

Purpose5/5

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

The description uses a specific verb ('Read') with a clear resource ('native-session state') and adds a key distinguisher: the operation does not advance the session or invoke a model. It also names exactly what information is returned, making the tool's purpose unmistakable relative to its siblings.

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

Usage Guidelines4/5

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

The phrase 'without advancing it or invoking a model' clearly establishes this as a non-mutating status-check tool, implying use when state is needed without side effects. It does not explicitly name alternatives like native_session_continue, so there is some room for inference, but the intended context is clear.

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

native_session_stopA
DestructiveIdempotent

Stop the isolated native-session process and preserve durable state and any managed worktree for inspection. ChatGPT remains the sole main model. Any active Session-owned DeepSeek subagent must be safely stopped and durably observed before the Session can finalize.

ParametersJSON Schema
NameRequiredDescriptionDefault
reasonNoOptional concise reason for stopping the session.
lease_idYesLease id returned by native_session_start.
request_idYesStable retry id for this stop request.
native_session_idYesNative session id returned by native_session_start.

Output Schema

ParametersJSON Schema
NameRequiredDescription
routeYes
replayYes
statusYes
fallbackYes
lease_idYes
revisionYes
terminalNo
workspaceYes
current_runYes
last_resultNo
launch_errorNo
pending_turnYes
stop_requestNo
session_labelYes
deepseek_routeYes
recovery_tokenNo
skill_snapshotYes
subagent_policyYes
lease_expires_atYes
network_boundaryYes
runtime_attachedYes
source_directoryYes
claude_session_idYes
native_session_idYes
recovery_requiredYes
working_directoryYes
capability_profileYes
deepseek_subsessionsYes
active_deepseek_subsession_idYes

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare destructiveHint and idempotentHint, but the description adds valuable context: durable state and worktree are preserved for inspection, the main ChatGPT model is untouched, and Session-owned DeepSeek subagents must be safely stopped. No contradiction with annotations.

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?

The description is concise and front-loaded with the primary action. The second sentence about ChatGPT remaining the sole main model is slightly tangential but adds context; overall every sentence is short and purposeful.

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

Completeness4/5

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

The description covers the core purpose, a prerequisite, and the side-effect guarantee of preservation. With a full output schema and complete parameter schema, nothing critical is missing; retry semantics are already implied by the idempotentHint annotation.

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 description coverage is 100%, so the baseline of 3 applies. The description itself does not add meaning beyond the schema, but each parameter is already fully documented in the schema with origin, format, and purpose.

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

Purpose5/5

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

The description states a specific verb and resource: it stops the isolated native-session process and preserves durable state and managed worktree for inspection. It also clarifies the tool's relationship to the main model, making the action unambiguous. This clearly distinguishes it from the sibling start/continue/recover/status tools.

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

Usage Guidelines4/5

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

The description implies when the tool should be used by stating that active subagents must be safely stopped and durably observed 'before the Session can finalize.' However, it does not explicitly name alternative tools or give explicit when-not-to-use guidance, so it stops short of a 5.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv0.8.0
    • First observednative_session_continue
    • First observednative_session_recover
    • First observednative_session_reply_and_wait
    • First observednative_session_start
    • First observednative_session_status
    • First observednative_session_stop

TDQS

A4.1/5.0

Scored across 6 tools

Disambiguation4/5

Each tool maps to a distinct lifecycle action such as start, continue, recover, reply, status, or stop. The only mild ambiguity is between continue and recover, since both involve reconnecting to an existing session, though the descriptions differentiate them by lease rotation and capability immutability.

Naming Consistency5/5

All tool names follow the same native_session_ prefix with an imperative verb or verb phrase. The naming pattern is uniform and predictable, making the tool set easy to navigate.

Tool Count5/5

Six tools is well-scoped for a session gateway: creation, continuation, recovery, interaction, status inspection, and shutdown. Each tool has a clear role without redundancy.

Completeness5/5

The tool set covers the full lifecycle of a native session: start it, continue or recover it, send replies, check status, and stop it. Stop preserves durable state rather than losing it, so the workflows do not end in a dead end.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Provides comprehensive session management for Claude Code with automatic initialization/cleanup, quality checkpoints, and local conversation memory with semantic search for capturing learnings across coding sessions.
    6
    452 PyPI
    4
    BSD 3-Clause
  • A
    license
    Not graded
    quality
    B
    maintenance
    Bridges ChatGPT with local computer for controlled file and project management, featuring session-based collaboration and diff tracking.
    4
    Apache 2.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    Bridges Claude Code terminal sessions with Claude Chat by exposing session logs as tools, enabling seamless context transfer and two-way communication via a cooperative inbox and optional Google Drive sync.
    36 npm
    1
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    A secure, local-first MCP coding and computer-use harness for ChatGPT and Codex, enabling guarded file operations, durable terminals, Git review, local skills, and macOS computer control.
    142 npm
    MIT