anthropics / anthropics/claude-code
Expose whether a shell command was user-typed (`!`) vs agent-initiated
- Linguagem predominante
- Python
- Estrelas
- 145k
- Forks
- 23.1k
- Métricas de merge de PRs
- Métricas de PR pendentes
Descrição
Commands the user types via the `!` prefix run in the same environment as agent-initiated Bash tool calls: identical env (`CLAUDECODE=1`, `AI_AGENT=…`) and no TTY. Child processes cannot tell a human typed the command.
This breaks CLIs that adapt behavior to agent environments. Concrete case: `pulumi login` detects `CLAUDECODE` and mints an ephemeral agent account instead of running its interactive browser login — even when the human typed `! pulumi login` themselves, silently creating throwaway accounts.
**Request:** set a variable like `CLAUDE_CODE_USER_INITIATED=1` (or omit `CLAUDECODE`) for `!` bash-input commands, so tools can distinguish "human typed this" from "agent ran this".
Related: #531 (request to expose `CLAUDECODE` itself).
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
No files or tests are named. Start by locating the handler for `!`-prefixed commands and the environment setup shared with Bash tool calls; compare both execution paths. Done means child processes can reliably distinguish human-entered `!` commands from agent-initiated commands without breaking the existing environment behavior.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- bash
- Domínio
- cli, developer-experience
- Tipo de issue
- Funcionalidade
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Ativa
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 62/100