claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] --settings argument is disreguarded

Open Caleb-T-Owens opened this issue 5 months ago • 6 comments

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?

When I run Claude code with the --settings argument, the provided settings are ignored. It's ignored whether it's a JSON string OR a path to a JSON file.

Example: claude --settings=/tmp/gitbutler-claude-settings.json

/tmp/gitbutler-claude-settings.json

{"hooks":{"Stop":[{"hooks":[{"command":"osascript -e 'display notification \"Nailed it\" with title \"Claude Code\" subtitle \"AI assistant\" sound name \"Glass\"'","type":"command"}],"matcher":""}]}}

It seems like this regression was introduced in 1.0.94. The last working version we've found is 1.0.93.

The issue is prevalent when used with our streaming arguments in GitButler as well as passing --settings and using it through the TUI like in the provided example.

What Should Happen?

With this example hook, it should send a notification when claude has finished responding.

Error Messages/Logs


Steps to Reproduce

  1. Write {"hooks":{"Stop":[{"hooks":[{"command":"osascript -e 'display notification \"Nailed it\" with title \"Claude Code\" subtitle \"AI assistant\" sound name \"Glass\"'","type":"command"}],"matcher":""}]}} into /tmp/gitbutler-claude-settings.json
  2. Run claude --settings=/tmp/gitbutler-claude-settings.json

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

1.0.93

Claude Code Version

1.0.109

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

No response

Caleb-T-Owens avatar Sep 09 '25 11:09 Caleb-T-Owens

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/5933
  2. https://github.com/anthropics/claude-code/issues/6087
  3. https://github.com/anthropics/claude-code/issues/5140

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Sep 09 '25 11:09 github-actions[bot]

Issue 1. is talking about the merging behaviour (which is intended). This issue talks about --settings not working at all. 2. and 3. are different topics.

Caleb-T-Owens avatar Sep 09 '25 11:09 Caleb-T-Owens

Update:

After a random last ditch effort before we started merging our config into the main user's config, I typed --settings XXX instead of --settings=XXX, it now works!

It seems like in 1.0.94 specifically the --settings argument stopped supporting having an = after it. The --mcp-config and --output-format and others all work just fine with an = except --settings now.

Caleb-T-Owens avatar Sep 09 '25 11:09 Caleb-T-Owens

I can repro that = doesn't work for --settings specifically due to the way we parse the flag.

dicksontsai avatar Sep 09 '25 18:09 dicksontsai

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 05 '25 10:12 github-actions[bot]

I can repro that = doesn't work for --settings specifically due to the way we parse the flag.

Commenting to keep the issue open. It was the cause of https://github.com/anthropics/claude-code/issues/13468

Any ETA on a fix for this very simple issue?

stbenjam avatar Dec 09 '25 13:12 stbenjam