opencode-anthropic-multi-account 0.2.83 → 0.2.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -139,6 +139,9 @@ function removeHostContextSections(systemPrompt) {
139
139
  }
140
140
  return cleanupRemovedSections(removeDynamicGitMetadata(removeDynamicRecentCommits(removeDynamicStatusBlock(keptLines.join("\n")))));
141
141
  }
142
+ function scrubSystemPrompt(systemPrompt) {
143
+ return scrubText(removeHostContextSections(systemPrompt));
144
+ }
142
145
  function parseMarkdownHeading(line) {
143
146
  const trimmedStart = line.trimStart();
144
147
  if (line.length - trimmedStart.length > 3 || !trimmedStart.startsWith("#")) {
@@ -169,14 +172,14 @@ function scrubObjectStrings(value) {
169
172
  return value;
170
173
  }
171
174
  function scrubTemplate(data, options) {
172
- const systemPrompt = scrubText(removeHostContextSections(data.system_prompt));
175
+ const systemPrompt = scrubSystemPrompt(data.system_prompt);
173
176
  const dropMcpTools = options?.dropMcpTools ?? true;
174
177
  const tools = data.tools.filter((tool) => !dropMcpTools || !tool.name.startsWith("mcp__")).map((tool) => scrubObjectStrings(tool));
175
178
  return {
176
179
  ...data,
177
180
  agent_identity: scrubText(data.agent_identity),
178
181
  system_prompt: systemPrompt,
179
- ...typeof data.system_prompt_fable === "string" ? { system_prompt_fable: scrubText(removeHostContextSections(data.system_prompt_fable)) } : {},
182
+ ...typeof data.system_prompt_fable === "string" ? { system_prompt_fable: scrubSystemPrompt(data.system_prompt_fable) } : {},
180
183
  tools,
181
184
  tool_names: tools.map((tool) => tool.name),
182
185
  header_order: data.header_order ? [...data.header_order] : void 0,
@@ -188,7 +191,8 @@ export {
188
191
  scrubText,
189
192
  findUserPathHits,
190
193
  removeHostContextSections,
194
+ scrubSystemPrompt,
191
195
  scrubObjectStrings,
192
196
  scrubTemplate
193
197
  };
194
- //# sourceMappingURL=chunk-UOB6GD7D.js.map
198
+ //# sourceMappingURL=chunk-FQBFDF73.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../providers/claude-code/src/scrub-template.ts"],"sourcesContent":["interface ScrubTemplateOptions {\n dropMcpTools?: boolean;\n}\n\ninterface TemplateToolLike {\n name: string;\n [key: string]: unknown;\n}\n\ninterface TemplateLike {\n agent_identity: string;\n system_prompt: string;\n system_prompt_fable?: string;\n tools: TemplateToolLike[];\n tool_names: string[];\n header_order?: string[];\n header_values?: Record<string, string>;\n}\n\nconst HOST_CONTEXT_SECTION_NAMES = new Set([\n \"environment\",\n \"automemory\",\n \"claudemd\",\n \"useremail\",\n \"currentdate\",\n \"gitstatus\",\n \"language\",\n]);\n\nconst USER_PATH_REPLACEMENTS = [\n {\n pattern: /\\/Users\\/(?!user(?:\\/|$))[A-Za-z0-9._-]+/g,\n replacement: \"/Users/user\",\n },\n {\n pattern: /\\/home\\/(?!user(?:\\/|$))[A-Za-z0-9._-]+/g,\n replacement: \"/home/user\",\n },\n {\n pattern: /([A-Za-z]:\\\\Users\\\\)(?!user(?:\\\\|$))[A-Za-z0-9._-]+/g,\n replacement: \"$1user\",\n },\n {\n pattern: /([A-Za-z])--Users-[^\\s\\\\`'\")\\]]+/g,\n replacement: \"$1--Users-user-project\",\n },\n {\n pattern: /(\\/\\.claude\\/projects\\/)-[A-Za-z0-9._-]+(?=\\/|$)/g,\n replacement: \"$1project\",\n },\n] as const;\n\nconst USER_PATH_HIT_PATTERNS = [\n /\\/Users\\/(?!user(?:\\/|$))[A-Za-z0-9._-]+(?:\\/[^\\s\"'`<>)]*)?/g,\n /\\/home\\/(?!user(?:\\/|$))[A-Za-z0-9._-]+(?:\\/[^\\s\"'`<>)]*)?/g,\n /[A-Za-z]:\\\\Users\\\\(?!user(?:\\\\|$))[A-Za-z0-9._-]+(?:\\\\[^\\s\"'`<>)]*)?/g,\n /[A-Za-z]--Users-(?!user-project\\b)[^\\s\\\\`'\")\\]]+/g,\n /\\/\\.claude\\/projects\\/-[A-Za-z0-9._-]+(?:\\/[^\\s\"'`<>)]*)?/g,\n] as const;\n\nconst GIT_METADATA_REPLACEMENTS = [\n {\n pattern: /^Current branch: .+$/gm,\n replacement: \"Current branch: (dynamic)\",\n },\n {\n pattern: /^Main branch \\(you will usually use this for PRs\\): .+$/gm,\n replacement: \"Main branch (you will usually use this for PRs): (dynamic)\",\n },\n {\n pattern: /^Git user: .+$/gm,\n replacement: \"Git user: (dynamic)\",\n },\n] as const;\n\nfunction normalizeSectionName(value: string): string {\n return value.toLowerCase().replace(/[^a-z0-9]+/g, \"\");\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n\nfunction cleanupRemovedSections(text: string): string {\n const lines = text.split(\"\\n\");\n const cleaned: string[] = [];\n let previousBlank = true;\n\n for (const line of lines) {\n const blank = line.trim().length === 0;\n if (blank && previousBlank) continue;\n cleaned.push(line);\n previousBlank = blank;\n }\n\n while (cleaned.length > 0 && cleaned[cleaned.length - 1]!.trim().length === 0) {\n cleaned.pop();\n }\n\n return cleaned.join(\"\\n\");\n}\n\nfunction removeDynamicStatusBlock(text: string): string {\n const statusStart = \"\\n\\nStatus:\\n\";\n const recentStart = \"\\n\\nRecent commits:\\n\";\n let scrubbed = text;\n let searchFrom = 0;\n\n while (true) {\n const start = scrubbed.indexOf(statusStart, searchFrom);\n if (start === -1) return scrubbed;\n\n const contentStart = start + statusStart.length;\n const end = scrubbed.indexOf(recentStart, contentStart);\n if (end === -1) return scrubbed;\n\n scrubbed = `${scrubbed.slice(0, contentStart)}(dynamic)${scrubbed.slice(end)}`;\n searchFrom = contentStart + \"(dynamic)\".length + recentStart.length;\n }\n}\n\nfunction removeDynamicRecentCommits(text: string): string {\n return text.replace(\n /(\\n\\nRecent commits:\\n)(?:[0-9a-f]{7,}\\s.*\\n?)+/g,\n \"$1(dynamic)\\n\",\n );\n}\n\nfunction removeDynamicGitMetadata(text: string): string {\n let scrubbed = text;\n\n for (const { pattern, replacement } of GIT_METADATA_REPLACEMENTS) {\n scrubbed = scrubbed.replace(pattern, replacement);\n }\n\n return scrubbed;\n}\n\nexport function scrubText(text: string): string {\n let scrubbed = text;\n\n for (const { pattern, replacement } of USER_PATH_REPLACEMENTS) {\n scrubbed = scrubbed.replace(pattern, replacement);\n }\n\n return removeDynamicGitMetadata(scrubbed);\n}\n\nexport function findUserPathHits(text: string): string[] {\n const hits = USER_PATH_HIT_PATTERNS.flatMap((pattern) => text.match(pattern) ?? []);\n return [...new Set(hits)];\n}\n\nexport function removeHostContextSections(systemPrompt: string): string {\n const lines = systemPrompt.split(\"\\n\");\n const keptLines: string[] = [];\n let skippedHeadingDepth: number | null = null;\n\n for (const line of lines) {\n const headingMatch = parseMarkdownHeading(line);\n\n if (headingMatch) {\n const headingDepth = headingMatch.depth;\n const sectionName = normalizeSectionName(headingMatch.title);\n const startsSkippedSection = HOST_CONTEXT_SECTION_NAMES.has(sectionName);\n\n if (startsSkippedSection) {\n skippedHeadingDepth = headingDepth;\n continue;\n }\n\n if (skippedHeadingDepth !== null && headingDepth > skippedHeadingDepth) {\n continue;\n }\n\n skippedHeadingDepth = null;\n keptLines.push(line);\n continue;\n }\n\n if (skippedHeadingDepth !== null) {\n continue;\n }\n\n keptLines.push(line);\n }\n\n return cleanupRemovedSections(removeDynamicGitMetadata(removeDynamicRecentCommits(removeDynamicStatusBlock(keptLines.join(\"\\n\")))));\n}\n\nexport function scrubSystemPrompt(systemPrompt: string): string {\n return scrubText(removeHostContextSections(systemPrompt));\n}\n\nfunction parseMarkdownHeading(line: string): { depth: number; title: string } | null {\n const trimmedStart = line.trimStart();\n if (line.length - trimmedStart.length > 3 || !trimmedStart.startsWith(\"#\")) {\n return null;\n }\n\n let depth = 0;\n while (depth < trimmedStart.length && trimmedStart[depth] === \"#\") {\n depth += 1;\n }\n\n if (depth < 1 || depth > 6 || trimmedStart[depth] !== \" \") {\n return null;\n }\n\n const title = trimmedStart.slice(depth + 1).trim();\n return title ? { depth, title } : null;\n}\n\nexport function scrubObjectStrings(value: unknown): unknown {\n if (typeof value === \"string\") {\n return scrubText(value);\n }\n\n if (Array.isArray(value)) {\n return value.map((entry) => scrubObjectStrings(entry));\n }\n\n if (isRecord(value)) {\n return Object.fromEntries(\n Object.entries(value).map(([key, entry]) => [key, scrubObjectStrings(entry)]),\n );\n }\n\n return value;\n}\n\nexport function scrubTemplate<T extends TemplateLike>(data: T, options?: ScrubTemplateOptions): T {\n const systemPrompt = scrubSystemPrompt(data.system_prompt);\n const dropMcpTools = options?.dropMcpTools ?? true;\n const tools = data.tools\n .filter((tool) => !dropMcpTools || !tool.name.startsWith(\"mcp__\"))\n .map((tool) => scrubObjectStrings(tool) as T[\"tools\"][number]);\n\n return {\n ...data,\n agent_identity: scrubText(data.agent_identity),\n system_prompt: systemPrompt,\n ...(typeof data.system_prompt_fable === \"string\"\n ? { system_prompt_fable: scrubSystemPrompt(data.system_prompt_fable) }\n : {}),\n tools,\n tool_names: tools.map((tool) => tool.name),\n header_order: data.header_order ? [...data.header_order] : undefined,\n header_values: data.header_values\n ? scrubObjectStrings(data.header_values) as Record<string, string>\n : undefined,\n } as T;\n}\n"],"mappings":";AAmBA,IAAM,6BAA6B,oBAAI,IAAI;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,IAAM,yBAAyB;AAAA,EAC7B;AAAA,IACE,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AACF;AAEA,IAAM,yBAAyB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,4BAA4B;AAAA,EAChC;AAAA,IACE,SAA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AmB,EAAE,IACnE,CAAC;AAAA,IACL;AAAA,IACA,YAAY,MAAM,IAAI,CAAC,SAAS,KAAK,IAAI;AAAA,IACzC,cAAc,KAAK,eAAe,CAAC,GAAG,KAAK,YAAY,IAAI;AAAA,IAC3D,eAAe,KAAK,gBAChB,mBAAmB,KAAK,aAAa,IACrC;AAAA,EACN;AACF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  scrubTemplate
3
- } from "./chunk-UOB6GD7D.js";
3
+ } from "./chunk-FQBFDF73.js";
4
4
 
5
5
  // ../providers/claude-code/src/fingerprint-capture.ts
6
6
  import { spawn } from "child_process";
@@ -21,7 +21,7 @@ import {
21
21
  var data_default = {
22
22
  _version: 1,
23
23
  _schemaVersion: 1,
24
- _captured: "2026-07-09T20:19:44.182Z",
24
+ _captured: "2026-07-10T00:54:00.702Z",
25
25
  _source: "bundled",
26
26
  agent_identity: "You are a Claude agent, built on Anthropic's Claude Agent SDK.",
27
27
  system_prompt: `You are an interactive agent that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
@@ -105,6 +105,8 @@ Current branch: (dynamic)
105
105
 
106
106
  Main branch (you will usually use this for PRs): (dynamic)
107
107
 
108
+ Git user: (dynamic)
109
+
108
110
  Status:
109
111
  (dynamic)
110
112
 
@@ -352,7 +354,7 @@ Reserve this for decisions where the user's answer changes what you do next \u20
352
354
  },
353
355
  {
354
356
  name: "Bash",
355
- description: 'Executes a given bash command and returns its output.\n\nThe working directory persists between commands, but shell state does not. The shell environment is initialized from the user\'s profile (bash or zsh).\n\nIMPORTANT: Avoid using this tool to run `cat`, `head`, `tail`, `sed`, `awk`, or `echo` commands, unless explicitly instructed or after you have verified that a dedicated tool cannot accomplish your task. Instead, use the appropriate dedicated tool as this will provide a much better experience for the user:\n\n - Read files: Use Read (NOT cat/head/tail)\n - Edit files: Use Edit (NOT sed/awk)\n - Write files: Use Write (NOT echo >/cat <<EOF)\n - Communication: Output text directly (NOT echo/printf)\nWhile the Bash tool can do similar things, it\u2019s better to use the built-in tools as they provide a better user experience and make it easier to review tool calls and give permission.\n\n# Instructions\n - If your command will create new directories or files, first use this tool to run `ls` to verify the parent directory exists and is the correct location.\n - Always quote file paths that contain spaces with double quotes in your command (e.g., cd "path with spaces/file.txt")\n - 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. In particular, never prepend `cd <current-directory>` to a `git` command \u2014 `git` already operates on the current working tree, and the compound triggers a permission prompt.\n - You may specify an optional timeout in milliseconds (up to 600000ms / 10 minutes). By default, your command will timeout after 120000ms (2 minutes).\n - 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.\n - For git commands:\n - Prefer to create a new commit rather than amending an existing commit.\n - Before running destructive operations (e.g., git reset --hard, git push --force, git checkout --), consider whether there is a safer alternative that achieves the same goal. Only use destructive operations when they are truly the best approach.\n - Never skip hooks (--no-verify) or bypass signing (--no-gpg-sign, -c commit.gpgsign=false) unless the user has explicitly asked for it. If a hook fails, investigate and fix the underlying issue.\n - Avoid unnecessary `sleep` commands:\n - Do not sleep between commands that can run immediately \u2014 just run them.\n - Use the Monitor tool to stream events from a background process (each stdout line is a notification). For one-shot "wait until done," use Bash with run_in_background instead.\n - If your command is long running and you would like to be notified when it finishes \u2014 use `run_in_background`. No sleep needed.\n - Do not retry failing commands in a sleep loop \u2014 diagnose the root cause.\n - If waiting for a background task you started with `run_in_background`, you will be notified when it completes \u2014 do not poll.\n - Long leading `sleep` commands are blocked. To poll until a condition is met, use Monitor with an until-loop (e.g. `until <check>; do sleep 2; done`) \u2014 you get a notification when the loop exits. Do not chain shorter sleeps to work around the block.\n - When running `find`, search from `.` (or a specific path), not `/` \u2014 scanning the full filesystem can exhaust system resources on large trees.\n - When using `find -regex` with alternation, put the longest alternative first. Example: use `\'.*\\.\\(tsx\\|ts\\)\'` not `\'.*\\.\\(ts\\|tsx\\)\'` \u2014 the second form silently skips `.tsx` files.\n\n\n# Committing changes with git\n\nOnly 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:\n\nYou 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. The numbered steps below indicate which commands should be batched in parallel.\n\nGit Safety Protocol:\n- NEVER update the git config\n- NEVER run destructive git commands (push --force, reset --hard, checkout ., restore ., clean -f, branch -D) unless the user explicitly requests these actions. Taking unauthorized destructive actions is unhelpful and can result in lost work, so it\'s best to ONLY run these commands when given direct instructions \n- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it\n- NEVER run force push to main/master, warn the user if they request it\n- CRITICAL: Always create NEW commits rather than amending, unless the user explicitly requests a git amend. When a pre-commit hook fails, the commit did NOT happen \u2014 so --amend would modify the PREVIOUS commit, which may result in destroying work or losing previous changes. Instead, after hook failure, fix the issue, re-stage, and create a NEW commit\n- When staging files, prefer adding specific files by name rather than using "git add -A" or "git add .", which can accidentally include sensitive files (.env, credentials) or large binaries\n- 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\n\n1. Run the following bash commands in parallel, each using the Bash tool:\n - 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.\n - Run a git diff command to see both staged and unstaged changes that will be committed.\n - Run a git log command to see recent commit messages, so that you can follow this repository\'s commit message style.\n2. Analyze all staged changes (both previously staged and newly added) and draft a commit message:\n - 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.).\n - Do not commit files that likely contain secrets (.env, credentials.json, etc). Warn the user if they specifically request to commit those files\n - Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what"\n - Ensure it accurately reflects the changes and their purpose\n3. Run the following commands in parallel:\n - Add relevant untracked files to the staging area.\n - Create the commit with a message ending with:\n Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>\n - Run git status after the commit completes to verify success.\n Note: git status depends on the commit completing, so run it sequentially after the commit.\n4. If the commit fails due to pre-commit hook: fix the issue and create a NEW commit\n\nImportant notes:\n- NEVER run additional commands to read or explore code, besides git bash commands\n- NEVER use the TaskCreate or Agent tools\n- DO NOT push to the remote repository unless the user explicitly asks you to do so\n- 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.\n- IMPORTANT: Do not use --no-edit with git rebase commands, as the --no-edit flag is not a valid option for git rebase.\n- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit\n- In order to ensure good formatting, ALWAYS pass the commit message via a HEREDOC, a la this example:\n<example>\ngit commit -m "$(cat <<\'EOF\'\n Commit message here.\n\n Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>\n EOF\n )"\n</example>\n\n# Creating pull requests\nUse 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.\n\nIMPORTANT: When the user asks you to create a pull request, follow these steps carefully:\n\n1. 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:\n - Run a git status command to see all untracked files (never use -uall flag)\n - Run a git diff command to see both staged and unstaged changes that will be committed\n - 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\n - 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)\n2. 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 title and summary:\n - Keep the PR title short (under 70 characters)\n - Use the description/body for details, not the title\n3. Run the following commands in parallel:\n - Create new branch if needed\n - Push to remote with -u flag if needed\n - Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.\n<example>\ngh pr create --title "the pr title" --body "$(cat <<\'EOF\'\n## Summary\n<1-3 bullet points>\n\n## Test plan\n[Bulleted markdown checklist of TODOs for testing the pull request...]\n\n\u{1F916} Generated with [Claude Code](https://claude.com/claude-code)\nEOF\n)"\n</example>\n\nImportant:\n- DO NOT use the TaskCreate or Agent tools\n- Return the PR URL when you\'re done, so the user can see it\n\n# Other common operations\n- View comments on a Github PR: gh api repos/foo/bar/pulls/123/comments',
357
+ description: "Executes a given bash command and returns its output.\n\nThe working directory persists between commands, but shell state does not. The shell environment is initialized from the user's profile (bash or zsh).\n\nIMPORTANT: Avoid using this tool to run `cat`, `head`, `tail`, `sed`, `awk`, or `echo` commands, unless explicitly instructed or after you have verified that a dedicated tool cannot accomplish your task. Instead, use the appropriate dedicated tool as this will provide a much better experience for the user:\n\n - Read files: Use Read (NOT cat/head/tail)\n - Edit files: Use Edit (NOT sed/awk)\n - Write files: Use Write (NOT echo >/cat <<EOF)\n - Communication: Output text directly (NOT echo/printf)\nWhile the Bash tool can do similar things, it\u2019s better to use the built-in tools as they provide a better user experience and make it easier to review tool calls and give permission.\n\n# Instructions\n - If your command will create new directories or files, first use this tool to run `ls` to verify the parent directory exists and is the correct location.\n - Always quote file paths that contain spaces with double quotes in your command (e.g., cd \"path with spaces/file.txt\")\n - 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. In particular, never prepend `cd <current-directory>` to a `git` command \u2014 `git` already operates on the current working tree, and the compound triggers a permission prompt.\n - You may specify an optional timeout in milliseconds (up to 600000ms / 10 minutes). By default, your command will timeout after 120000ms (2 minutes).\n - 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.\n - For git commands:\n - Prefer to create a new commit rather than amending an existing commit.\n - Before running destructive operations (e.g., git reset --hard, git push --force, git checkout --), consider whether there is a safer alternative that achieves the same goal. Only use destructive operations when they are truly the best approach.\n - Never skip hooks (--no-verify) or bypass signing (--no-gpg-sign, -c commit.gpgsign=false) unless the user has explicitly asked for it. If a hook fails, investigate and fix the underlying issue.\n - Avoid unnecessary `sleep` commands:\n - Do not sleep between commands that can run immediately \u2014 just run them.\n - Use the Monitor tool to stream events from a background process (each stdout line is a notification). For one-shot \"wait until done,\" use Bash with run_in_background instead.\n - If your command is long running and you would like to be notified when it finishes \u2014 use `run_in_background`. No sleep needed.\n - Do not retry failing commands in a sleep loop \u2014 diagnose the root cause.\n - If waiting for a background task you started with `run_in_background`, you will be notified when it completes \u2014 do not poll.\n - Long leading `sleep` commands are blocked. To poll until a condition is met, use Monitor with an until-loop (e.g. `until <check>; do sleep 2; done`) \u2014 you get a notification when the loop exits. Do not chain shorter sleeps to work around the block.\n - When running `find`, search from `.` (or a specific path), not `/` \u2014 scanning the full filesystem can exhaust system resources on large trees.\n - When using `find -regex` with alternation, put the longest alternative first. Example: use `'.*\\.\\(tsx\\|ts\\)'` not `'.*\\.\\(ts\\|tsx\\)'` \u2014 the second form silently skips `.tsx` files.\n\n\n# Git\n- 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.\n- Only commit when the user explicitly asks. When staging, prefer naming specific files over \"git add -A\"/\"git add .\" \u2014 never commit files that likely contain secrets (.env, credentials).\n- End git commit messages with:\nCo-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>\n\n# Creating pull requests\nUse 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.\n\nIMPORTANT: When the user asks you to create a pull request, follow these steps carefully:\n\n1. 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:\n - Run a git status command to see all untracked files (never use -uall flag)\n - Run a git diff command to see both staged and unstaged changes that will be committed\n - 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\n - 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)\n2. 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 title and summary:\n - Keep the PR title short (under 70 characters)\n - Use the description/body for details, not the title\n3. Run the following commands in parallel:\n - Create new branch if needed\n - Push to remote with -u flag if needed\n - Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.\n<example>\ngh pr create --title \"the pr title\" --body \"$(cat <<'EOF'\n## Summary\n<1-3 bullet points>\n\n## Test plan\n[Bulleted markdown checklist of TODOs for testing the pull request...]\n\n\u{1F916} Generated with [Claude Code](https://claude.com/claude-code)\nEOF\n)\"\n</example>\n\nImportant:\n- DO NOT use the TaskCreate or Agent tools\n- Return the PR URL when you're done, so the user can see it\n\n# Other common operations\n- View comments on a Github PR: gh api repos/foo/bar/pulls/123/comments",
356
358
  input_schema: {
357
359
  $schema: "https://json-schema.org/draft/2020-12/schema",
358
360
  type: "object",
@@ -1591,7 +1593,7 @@ IMPORTANT - Use the correct year in search queries:
1591
1593
  "Write"
1592
1594
  ],
1593
1595
  anthropic_beta: "claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,thinking-token-count-2026-05-13,context-management-2025-06-27,prompt-caching-scope-2026-01-05,mid-conversation-system-2026-04-07,advisor-tool-2026-03-01,effort-2025-11-24,extended-cache-ttl-2025-04-11",
1594
- cc_version: "2.1.205",
1596
+ cc_version: "2.1.206",
1595
1597
  header_order: [
1596
1598
  "Accept",
1597
1599
  "Authorization",
@@ -1621,7 +1623,7 @@ IMPORTANT - Use the correct year in search queries:
1621
1623
  "anthropic-dangerous-direct-browser-access": "true",
1622
1624
  "anthropic-version": "2023-06-01",
1623
1625
  "content-type": "application/json",
1624
- "user-agent": "claude-cli/2.1.205 (external, sdk-cli)",
1626
+ "user-agent": "claude-cli/2.1.206 (external, sdk-cli)",
1625
1627
  "x-app": "cli",
1626
1628
  "x-stainless-timeout": "600"
1627
1629
  },
@@ -2311,4 +2313,4 @@ export {
2311
2313
  setFingerprintCaptureTestOverridesForTest,
2312
2314
  resetFingerprintCaptureForTest
2313
2315
  };
2314
- //# sourceMappingURL=chunk-TGDRFB4C.js.map
2316
+ //# sourceMappingURL=chunk-XG67FMBB.js.map