Claude Code Wraps Commands in eval, Database Passwords Remain Visible in ps Output
V2EX user mysoko reviewed 253 Claude Code session records and found that 16 contained plaintext passwords. Reproduction tests showed that Claude Code wraps commands in a composite structure of source snapshots and eval; the parent shell process retains the full command line throughout execution, even though curl itself has already masked the password in child processes.
V2EX user mysoko searched through Claude Code session records on their own machine: among 253 jsonl files, 16 instances featured patterns such as mysql -p passwords or curl -u user:pass. They then ran a test using Claude Code version 2.1.317 with a fake password in a curl command, while capturing ps output from a separate process, discovering that the exposure surface was broader than initially assumed.
Two processes appeared in the ps output. The lower line represents curl itself, where the password characters have been replaced with spaces—confirming that curl does perform this masking action. The upper line shows the zsh instance launched by Claude Code, which retains the entire command line including the password for as long as curl is running.
This discrepancy stems from differences in execution methods. If you manually type bash -c 'curl ...' to run a single command, bash will directly exec into curl, hiding this intermediate layer. However, Claude Code wraps commands within a composite structure of source snapshot && ... && eval 'your command'; because the shell must remain active until execution completes, the complete command line persists in the process table.
Beyond ps, commands are also written verbatim into jsonl session records located under ~/.claude/projects/. This requires extra attention on servers: under default Linux mount parameters, proc(5) states that 'everybody may access all /proc/pid directories,' meaning other users on the same machine can view your command lines. Environment variables differ in this regard, as reading /proc/pid/environ requires passing ptrace permission checks. Users sharing development machines or jump hosts should note this distinction.