Claude Code side calls: use --safe-mode so the judge and proposer don't load the user's customizations

オープン
#162 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@dhruv1220 がすでに取り組んでいます。

2026年11月7日 から。

  • #163 @dhruv1220 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python

調査の方向性

Read sidecall.claude_call and the existing claude_flags() detection for --no-session-persistence. Add the conditional --safe-mode flag to side-call invocations, keeping the measure and refresh-catalog probes unchanged. Check the side-call tests and verify behavior with and without the flag in claude --help; done when only supported Claude Code versions receive the flag and both probes still load customizations.

索引モデルが issue の本文から書いたものです。

説明

Context

Since #89, sidecall.claude_call runs claude -p --output-format json --max-turns 1 --tools "" --model haiku
with --strict-mcp-config and an empty MCP config, which removed the MCP cost. The call still loads everything
else from the user's setup: CLAUDE.md files, installed plugins and their SessionStart / UserPromptSubmit
hooks, skills, output styles.

On a setup with a shared team config (rtk, caveman, ponytail, a few plugins, a UserPromptSubmit classifier
hook), te toolprune measure reports a lean prompt of ~26k tokens for an empty Claude Code session (Claude Code
2.1.319, Linux). Each judge or proposer call pays that context, and the user's hooks run inside it: a
SessionStart hook that starts background updates, or plugins that inject style instructions into the reply,
can change both the cost and the shape of the JSON answer the plugin parses.

Proposal

Add --safe-mode to the Claude Code side-call flags when claude --help lists it, the same way
claude_flags() already detects --no-session-persistence. claude --help describes it as "Start with all
customizations (CLAUDE.md, skills, installed plugins, hooks, MCP servers, custom commands and agents, output
styles, workflows, …) disabled". TE_SIDECALL=1 would still be useful for older Claude Code versions without the
flag.

The measure and refresh-catalog probes should keep loading the user's setup: they measure the real session.

Environment

TokenEconomizer 0aa2aca, Claude Code 2.1.319, Linux, Python 3.14.

主要言語
Python
スター
5.6k
フォーク
344
平均マージ
14時間 41分
マージ済み PR(30日)
54

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/TokenEconomizer のほかの issue

microsoft/TokenEconomizer の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。