[BUG] /auto-mode-setup fails with "environment contains an entry with a control character" on clean environment
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Running /auto-mode-setup consistently fails with the following error:
Auto-mode setup scan failed: environment contains an entry with a control character; entries must be single-line text.
The error is reproducible every time. Manual inspection of the environment finds no control characters in any of the scanned locations.
Environment:
- OS: Linux (CachyOS 7.2.4-3-cachyos)
- Shell: bash
- Claude Code version: 2.1.270 (Claude Code)
What was checked manually:
- /proc/self/environ — no control characters found
- /home/user/.claude/settings.json - clean (only awaySummaryEnabled and theme)
- All files under /home/user/.claude/session-env/ - clean
- Memory files under /home/user/.claude/projects/ - clean
- os.environ via Python scan (all chars, including ESC/0x1b) - nothing below ASCII 32 found
Actual behaviour: Skill aborts immediately after "Gathering data and drafting your auto-mode setup; back soon".
What Should Happen?
Expected behaviour: Skill completes and outputs an auto-mode settings configuration.
Error Messages/Logs
/auto-mode-setup
⎿ Gathering data and drafting your auto-mode setup; back soon
● Auto-mode setup scan failed: environment contains an entry with a control character; entries must be single-line text.
Steps to Reproduce
Steps to reproduce:
- Open a Claude Code session
- Run /auto-mode-setup
- Observe the error above
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.270
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
Additional context: The skill appears to be scanning something internal to the Claude Code harness that is not directly accessible (possibly transcript entries or an internal env representation), since all externally visible environment data is clean.