claude-code - 💡(How to fix) Fix [BUG] Bash task/monitor in Sandbox mode creates empty .dotfiles [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56055Fetched 2026-05-05 05:59:23
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×4renamed ×2commented ×1

Error Message

Error Messages/Logs

Code Example

❯ monitor it

Bash(docker logs -f 40a6a39708b4 2>&1)
  ⎿  Running in the background (↓ to manage)

Monitor(<...>)
  ⎿  Monitor started · task bvxim3ba5 · persistent
Monitor armed. Streaming via beb8xmnni.

---

❯ 
────────────────────────────────────────────────────────────────────────────────────────────
  1 shell, 1 monitor · ↓ to manage

---

$ git status
On branch <>
Your branch is ahead of 'origin/<>' by 1 commit.
  (use "git push" to publish your local commits)

<...>

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	.bash_profile
	.bashrc
	.gitconfig
	.idea
	.mcp.json
	.profile
	.ripgreprc
	.vscode
	.zprofile
	.zshrc

no changes added to commit (use "git add" and/or "git commit -a")

---
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

For some reason Claude Code is generating empty dotfiles, I believe when executing Bash tasks and monitoring them, according to previous, locked bug reports:

My claude conversation from a state of no dotfiles in the repo:

❯ monitor it

● Bash(docker logs -f 40a6a39708b4 2>&1)
  ⎿  Running in the background (↓ to manage)

● Monitor(<...>)
  ⎿  Monitor started · task bvxim3ba5 · persistent
● Monitor armed. Streaming via beb8xmnni.

And then I see at the bottom:

❯ 
────────────────────────────────────────────────────────────────────────────────────────────
  1 shell, 1 monitor · ↓ to manage

And looking in the repo again

$ git status
On branch <>
Your branch is ahead of 'origin/<>' by 1 commit.
  (use "git push" to publish your local commits)

<...>

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	.bash_profile
	.bashrc
	.gitconfig
	.idea
	.mcp.json
	.profile
	.ripgreprc
	.vscode
	.zprofile
	.zshrc

no changes added to commit (use "git add" and/or "git commit -a")

This happens consistently. I have not tried it outside of sandbox mode.

What Should Happen?

As Claude itself said:

The dotfiles in the working tree are untracked and unrelated.

🙂

Error Messages/Logs

Steps to Reproduce

  1. Get claude to run a bash task
  2. Observe dotfiles in your repository (ls -a or git status)

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.126 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

iTerm2

Additional Information

This is over SSH.

extent analysis

TL;DR

The issue can be mitigated by investigating the Bash task execution and monitoring process in Claude Code, potentially related to the generation of empty dotfiles.

Guidance

  • Review the Bash task configuration and execution logs to understand how the dotfiles are being generated.
  • Check the Claude Code documentation and previous issues (e.g., #17087 and #17258) for any known issues or workarounds related to Bash task execution and dotfile generation.
  • Verify that the issue persists outside of sandbox mode to determine if it's an environment-specific problem.
  • Investigate the monitor command and its interaction with the Bash task to see if it's contributing to the generation of empty dotfiles.

Example

No code snippet is provided as the issue is more related to the configuration and execution of Claude Code rather than a specific code problem.

Notes

The issue seems to be a regression, as it worked in a previous version, and the exact cause is not immediately clear. Further investigation into the Bash task execution and monitoring process is needed to determine the root cause.

Recommendation

Apply workaround: Investigate and potentially modify the Bash task configuration and execution process to prevent the generation of empty dotfiles, as the root cause is not immediately clear and a direct fix is not available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING