anthropics / anthropics/claude-code
Expose whether a shell command was user-typed (`!`) vs agent-initiated
- Lingua principale
- Python
- Stelle
- 145k
- Fork
- 23.1k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
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).
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- bash
- Ambito
- cli, developer-experience
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 62/100