[Bug] --system-prompt flag fails to instantiate and doesn't override CLAUDE.md

Resolved 💬 2 comments Opened Jan 30, 2026 by Electric-gary Closed Feb 28, 2026
  • Title: --system-prompt flag fails to instantiate and doesn't override CLAUDE.md
  • Type: Bug Report
  • Description: The --system-prompt CLI flag does not properly instantiate the custom system prompt. When users specify a system prompt via this flag and

then query Claude about its system prompt contents, Claude has no awareness of the custom prompt. Additionally, CLAUDE.md files in the directory root
continue to be appended to the context even when --system-prompt is used, when they should be excluded to allow full system prompt customization.

  • User Background: Gary Palmer, Developer at Electric Sheep, building custom agent workflows that require isolated system prompt injection without

project-level CLAUDE.md interference.

  • Steps to Reproduce:

a. Create a CLAUDE.md file in the project root with custom instructions
b. Run Claude Code with --system-prompt "Custom instructions here"
c. Ask Claude about its system prompt or the custom instructions provided

  • Observed Behavior:
  • Claude has no knowledge of the --system-prompt content when queried
  • The CLAUDE.md file is still appended to the context despite using --system-prompt
  • Expected Behavior:
  • The --system-prompt content should be fully instantiated and accessible to Claude
  • When --system-prompt is specified, CLAUDE.md files should be excluded from context injection
  • Severity: High (Blocker for custom agent use cases requiring isolated system prompts)
  • Relevant Timestamps: N/A (User-reported issue)

Thanks!

Environment Info

  • Platform: darwin
  • Terminal: WarpTerminal
  • Version: 2.1.25
  • Feedback ID: 365e01c1-dc04-44f6-bb86-2dd75b948db8

Errors

[{"error":"Error: ENOENT: no such file or directory, scandir '/Library/Application Support/ClaudeCode/.claude/skills'\n    at readdirSync (unknown)\n    at <anonymous> (/$bunfs/root/claude:12:2063)\n    at iW (/$bunfs/root/claude:11:35715)\n    at readdirSync (/$bunfs/root/claude:12:2024)\n    at wQR (/$bunfs/root/claude:1783:380)\n    at wQR (/$bunfs/root/claude:1783:1350)\n    at <anonymous> (/$bunfs/root/claude:1783:4670)\n    at <anonymous> (/$bunfs/root/claude:1783:5401)\n    at A (/$bunfs/root/claude:11:7259)\n    at Ay8 (/$bunfs/root/claude:4793:4342)","timestamp":"2026-01-30T13:51:31.141Z"},{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/gary/.local/share/claude/versions/2.1.25 (expected in multi-process scenarios)\n    at kzR (/$bunfs/root/claude:3940:2098)\n    at JxA (/$bunfs/root/claude:3940:1209)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-01-30T13:51:31.161Z"}]

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗