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

Abierto
#162 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@dhruv1220 ya está trabajando en esto.

Desde el 7/11/2026.

  • #163 de @dhruv1220 — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
5.6k
Forks
344
Merge medio
14 h 41 min
PR fusionados (30 d)
54

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/TokenEconomizer

Todos los issues de microsoft/TokenEconomizer

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.