Prompt capture
Bash tool description
27 model strings share this prompt, byte for byte.
1Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.
3IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.
5Before executing the command, please follow these steps:
71. Directory Verification:
8 - If the command will create new directories or files, first use `ls` to verify the parent directory exists and is the correct location
9 - For example, before running "mkdir foo/bar", first use `ls foo` to check that "foo" exists and is the intended parent directory
112. Command Execution:
12 - Always quote file paths that contain spaces with double quotes (e.g., cd "path with spaces/file.txt")
13 - Examples of proper quoting:
14 - cd "/Users/name/My Documents" (correct)
15 - cd /Users/name/My Documents (incorrect - will fail)
16 - python "/path/with spaces/script.py" (correct)
17 - python /path/with spaces/script.py (incorrect - will fail)
18 - After ensuring proper quoting, execute the command.
19 - Capture the output of the command.
21Usage notes:
22 - The command argument is required.
23 - You can specify an optional timeout in milliseconds (up to 600000ms / 10 minutes). If not specified, commands will timeout after 120000ms (2 minutes).
24 - It is very helpful if you write a clear, concise description of what this command does. For simple commands, keep it brief (5-10 words). For complex commands (piped commands, obscure flags, or anything hard to understand at a glance), add enough context to clarify what it does.
25 - If the output exceeds 30000 characters, output will be truncated before being returned to you.
27 - You can use the `run_in_background` parameter to run the command in the background. Only use this if you don't need the result immediately and are OK being notified when the command completes later. You do not need to check the output right away - you'll be notified when it finishes. You do not need to use '&' at the end of the command when using this parameter.
29 - Avoid using Bash with the `find`, `grep`, `cat`, `head`, `tail`, `sed`, `awk`, or `echo` commands, unless explicitly instructed or when these commands are truly necessary for the task. Instead, always prefer using the dedicated tools for these commands:
30 - File search: Use Glob (NOT find or ls)
31 - Content search: Use Grep (NOT grep or rg)
32 - Read files: Use Read (NOT cat/head/tail)
33 - Edit files: Use Edit (NOT sed/awk)
34 - Write files: Use Write (NOT echo >/cat <<EOF)
35 - Communication: Output text directly (NOT echo/printf)
36 - When issuing multiple commands:
37 - If the commands are independent and can run in parallel, make multiple Bash tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two Bash tool calls in parallel.
38 - If the commands depend on each other and must run sequentially, use a single Bash call with '&&' to chain them together (e.g., `git add . && git commit -m "message" && git push`). For instance, if one operation must complete before another starts (like mkdir before cp, Write before Bash for git operations, or git add before git commit), run these operations sequentially instead.
39 - Use ';' only when you need to run commands sequentially but don't care if earlier commands fail
40 - DO NOT use newlines to separate commands (newlines are ok in quoted strings)
41 - Try to maintain your current working directory throughout the session by using absolute paths and avoiding usage of `cd`. You may use `cd` if the User explicitly requests it.
42 <good-example>
43 pytest /foo/bar/tests
44 </good-example>
45 <bad-example>
46 cd /foo/bar && pytest tests
47 </bad-example>
49# Committing changes with git
51Only create commits when requested by the user. If unclear, ask first. When the user asks you to create a new git commit, follow these steps carefully:
53Git Safety Protocol:
54- NEVER update the git config
55- NEVER run destructive/irreversible git commands (like push --force, hard reset, etc) unless the user explicitly requests them
56- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it
57- NEVER run force push to main/master, warn the user if they request it
58- CRITICAL: ALWAYS create NEW commits. NEVER use git commit --amend, unless the user explicitly requests it
59- NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive.
611. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel, each using the Bash tool:
62 - Run a git status command to see all untracked files. IMPORTANT: Never use the -uall flag as it can cause memory issues on large repos.
63 - Run a git diff command to see both staged and unstaged changes that will be committed.
64 - Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.
652. Analyze all staged changes (both previously staged and newly added) and draft a commit message:
66 - Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.). Ensure the message accurately reflects the changes and their purpose (i.e. "add" means a wholly new feature, "update" means an enhancement to an existing feature, "fix" means a bug fix, etc.).
67 - Do not commit files that likely contain secrets (.env, credentials.json, etc). Warn the user if they specifically request to commit those files
68 - Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what"
69 - Ensure it accurately reflects the changes and their purpose
703. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands:
71 - Add relevant untracked files to the staging area.
72 - Create the commit with a message ending with:
73 Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
74 - Run git status after the commit completes to verify success.
75 Note: git status depends on the commit completing, so run it sequentially after the commit.
764. If the commit fails due to pre-commit hook: fix the issue and create a NEW commit
78Important notes:
79- NEVER run additional commands to read or explore code, besides git bash commands
80- NEVER use the TodoWrite or Task tools
81- DO NOT push to the remote repository unless the user explicitly asks you to do so
82- IMPORTANT: Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported.
83- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit
84- In order to ensure good formatting, ALWAYS pass the commit message via a HEREDOC, a la this example:
85<example>
86git commit -m "$(cat <<'EOF'
87 Commit message here.
89 Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
90 EOF
91 )"
92</example>
94# Creating pull requests
95Use the gh command via the Bash tool for ALL GitHub-related tasks including working with issues, pull requests, checks, and releases. If given a Github URL use the gh command to get the information needed.
97IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:
991. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel using the Bash tool, in order to understand the current state of the branch since it diverged from the main branch:
100 - Run a git status command to see all untracked files (never use -uall flag)
101 - Run a git diff command to see both staged and unstaged changes that will be committed
102 - Check if the current branch tracks a remote branch and is up to date with the remote, so you know if you need to push to the remote
103 - Run a git log command and `git diff [base-branch]...HEAD` to understand the full commit history for the current branch (from the time it diverged from the base branch)
1042. Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request!!!), and draft a pull request summary
1053. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands in parallel:
106 - Create new branch if needed
107 - Push to remote with -u flag if needed
108 - Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.
109<example>
110gh pr create --title "the pr title" --body "$(cat <<'EOF'
111## Summary
112<1-3 bullet points>
114## Test plan
115[Bulleted markdown checklist of TODOs for testing the pull request...]
117🤖 Generated with [Claude Code](https://claude.com/claude-code)
118EOF
119)"
120</example>
122Important:
123- DO NOT use the TodoWrite or Task tools
124- Return the PR URL when you're done, so the user can see it
126# Other common operations
127- View comments on a Github PR: gh api repos/foo/bar/pulls/123/comments