From 5801e299d5a64287c1e91e4aaa362a56682379b1 Mon Sep 17 00:00:00 2001 From: wassname <1103714+wassname@users.noreply.github.com> Date: Mon, 2 Mar 2026 15:35:01 +0800 Subject: [PATCH] Phase 2: version conflicts, hooks, compression (+108 -179) - Resolve 8 upstream version conflicts (bump ccVersions to 2.1.63) - Merge askuserquestion "don't reference the plan" guidance from v2.1.47 - Move git guardrails to hooks: --no-verify, broad staging, interactive mode - Gut redundant prompt sub-files (destructive-ops, skip-hooks, sleep, computer) - Compress 10 system-prompt files 56% (1529w -> 672w) - Improve context compaction summary to preserve decision path - Update CLAUDE.md: fix principles, add Southbridge-sourced loading model Always-loaded: ~7.5k words (down from ~10.8k stock, ~31% total reduction) Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 61 +++++++++++-------- ...agent-prompt-conversation-summarization.md | 12 ++-- ...ent-prompt-recent-message-summarization.md | 6 +- .../agent-prompt-review-pr-slash-command.md | 9 ++- .../agent-prompt-status-line-setup.md | 5 +- ...system-prompt-agent-memory-instructions.md | 21 ++----- ...ystem-prompt-context-compaction-summary.md | 34 ++++------- .../system-prompt-hooks-configuration.md | 34 ++--------- system-prompts/system-prompt-mcp-cli.md | 2 +- .../system-prompt-option-previewer.md | 9 +-- .../system-prompt-parallel-tool-call-note.md | 2 +- .../system-prompt-tool-execution-denied.md | 2 +- .../system-prompt-tool-permission-mode.md | 2 +- ...stem-prompt-tool-use-summary-generation.md | 17 +----- .../system-prompt-worker-instructions.md | 12 ++-- ...em-reminder-plan-mode-is-active-5-phase.md | 8 +-- ...-reminder-plan-mode-is-active-iterative.md | 7 ++- .../tool-description-askuserquestion.md | 3 +- ...cription-bash-git-avoid-destructive-ops.md | 2 +- ...git-commit-and-pr-creation-instructions.md | 2 - ...l-description-bash-git-never-skip-hooks.md | 2 +- .../tool-description-bash-sleep-no-polling.md | 2 +- ...l-description-bash-sleep-use-background.md | 2 +- system-prompts/tool-description-computer.md | 5 +- .../tool-description-enterplanmode.md | 2 +- .../tool-description-notebookedit.md | 2 +- system-prompts/tool-description-readfile.md | 2 +- system-prompts/tool-description-task.md | 2 +- .../tool-description-teammatetool.md | 2 +- system-prompts/tool-description-todowrite.md | 2 +- system-prompts/tool-description-toolsearch.md | 8 +-- system-prompts/tool-description-write.md | 6 +- 32 files changed, 108 insertions(+), 179 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 8f3f745..42401fa 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,16 +4,14 @@ Minimal system prompts for Claude Code. Edits live in `system-prompts/*.md`. ## Design principles -Sources: [Pi system prompt](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/system-prompt.ts), [Pi blog post](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/), [Armin on Pi](https://lucumr.pocoo.org/2026/1/31/pi/), [Trail of Bits config](https://github.com/trailofbits/claude-code-config) +Sources: [Pi system prompt](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/system-prompt.ts), [Pi blog post](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/), [Armin on Pi](https://lucumr.pocoo.org/2026/1/31/pi/), [Trail of Bits config](https://github.com/trailofbits/claude-code-config), [arch](https://www.southbridge.ai/blog/claude-code-an-analysis) 1. **Trust the model** -- frontier models know how to code; provide context and tools, not tutorials. Pi's entire prompt is ~1k tokens. -2. **Conditional inclusion** -- only include instructions for tools/capabilities available in this session -3. **Lazy-load** -- reference docs by path, don't embed; model reads on-demand -4. **Delegate workflow** -- CLAUDE.md/AGENTS.md own conventions, not the system prompt -5. **Disposability** -- cut anything that doesn't earn its context-window cost -6. **Sandbox over guardrails** -- real security = OS-level sandboxing (bubblewrap/seatbelt) + hooks at decision points, not verbose prompt text saying "NEVER do X". Trail of Bits runs `--dangerously-skip-permissions` + sandbox + deny rules. Pi runs full YOLO mode. -7. **Hooks over prompts** -- "NEVER use rm -rf" in a prompt can be forgotten; a PreToolUse hook blocking it fires every time. Hooks = structured prompt injection at the right moment. -8. **Skills over MCP descriptions** -- MCP server schemas dump 13-18k tokens into always-loaded context. Move less-used tools to skills (on-demand loading). Symlink `skills/` to `~/.claude/skills/`. +2. **Delegate workflow** -- CLAUDE.md/AGENTS.md own conventions, not the system prompt +3. **Disposability** -- cut anything that doesn't earn its context-window cost +4. **Sandbox over guardrails** -- real security = OS-level sandbox (bubblewrap/seatbelt via `/sandbox`) + deny rules + devcontainers, not verbose prompt text. Trail of Bits pairs `--dangerously-skip-permissions` with layered defense: sandbox + deny rules + ephemeral containers. +5. **Hooks over prompts** -- "NEVER use rm -rf" in a prompt can be forgotten; a PreToolUse hook fires every time. +6. **Cheapest effective layer** -- enforce at: OS sandbox > deny rules > hooks > prompt text (last resort) ## Review methodology: 6 dimensions @@ -30,28 +28,41 @@ Heuristic: if removing a line would cause a failure mode you've actually seen, k ## What gets loaded when (CC 2.1.63) -**Always loaded (every session):** +Source: Southbridge Research reconstructed code (inferred, not decompiled). Treat thresholds as approximate. + +**Prompt assembly priority** (lower priority truncated first under context pressure): +1. Base prompt (~2KB) > 2. Model adaptations > 3. CLAUDE.md (~5-50KB) > 4. Git context (~1-5KB) > 5. Directory > 6. Tools (~10KB+) + +**Always loaded:** - `system-prompt-*` core behavioral files -- `tool-description-*` for available tools: - - Always: Bash (+ sub-files), Read, Edit, Write, Glob, Grep, Agent/Task, AskUserQuestion, EnterPlanMode, ExitPlanMode, TodoWrite/TaskCreate/TaskList/TaskUpdate - - Conditional: TeammateTool, SendMessageTool, TeamDelete (swarm only), Computer (computer use), Chrome (browser MCP) +- `tool-description-*` for available tools (incl. MCP schemas as serialized JSON) +- Monolithic + sub-files both loaded by tweakcc; empty monolithic ones to avoid duplication -**Per-mode:** `system-reminder-plan-mode-*`, `system-reminder-team-*`, `system-reminder-todo-*` +**Event-driven (injected per-turn on condition):** +- `system-reminder-plan-mode-*` -- when plan mode active +- `system-reminder-team-*` -- when team/swarm mode active +- `system-reminder-todo-*`, task nudges -- periodic / on task events +- File events, hook outcomes, token/budget warnings -- per-turn -**On-demand:** `agent-prompt-*`, `data-*`, `skill-*` +**On-demand (loaded at spawn/invocation):** +- `agent-prompt-*` -- loaded when that agent type spawned +- `data-*`, `skill-*` -- referenced on demand + +**Compaction**: triggers at 100k tokens OR 200 messages OR $5 cost. Skipped if <50 messages. Summarizes non-preserved messages via LLM call. **Context budget:** -| Category | Files | Stock chars | Loading | -|----------|-------|-------------|---------| -| Tool Descriptions | 71 | 63k | Always (biggest cost) | -| System Prompts | 52 | 45k | Always | -| System Reminders | 38 | 17k | Per-mode | -| Data | 25 | 154k | On-demand | -| Agent Prompts | 28 | 69k | On-demand | -| Skills | 7 | 45k | On-demand | +| Category | Stock words | tweakcc words | Reduction | Loading | +|----------|-------------|---------------|-----------|---------| +| System Prompts | ~4.5k | ~3.7k | -18% | Always (Priority 1) | +| Tool Descriptions | ~6.3k | ~3.8k | -40% | Always (Priority 6) | +| System Reminders | ~1.7k | ~1.7k | -- | Event-driven | +| Agent Prompts | ~6.9k | ~6.9k | -- | On-demand (spawn) | -Note: CC 2.1.53+ split monolithic tool descriptions into granular sub-files. BOTH are loaded by tweakcc, so empty the monolithic ones to avoid duplication. +Total always-loaded: ~7.5k words (down from ~10.8k stock). +On-demand (untouched): Data ~154k chars, Skills ~45k chars, Agent Prompts ~69k chars. + +**Frontmatter is upstream-controlled**: `tweakcc --apply` restores YAML headers (name, description, ccVersion, variables) from CC. We only control the body content. ## How to edit @@ -65,8 +76,8 @@ Note: CC 2.1.53+ split monolithic tool descriptions into granular sub-files. BOT ## File naming conventions - `system-prompt-*` -- core behavioral, always loaded -- `system-reminder-*` -- mode-specific (plan mode, learning mode) +- `system-reminder-*` -- event-driven (plan mode, task nudges, file events, hooks) - `tool-description-*` -- loaded with tool schemas - `agent-prompt-*` -- loaded when agent type spawned - `data-*` -- reference data, on-demand -- `skill-*` -- skill definitions, on-demand +- `skill-*` -- skill definitions, on-demand \ No newline at end of file diff --git a/system-prompts/agent-prompt-conversation-summarization.md b/system-prompts/agent-prompt-conversation-summarization.md index aa83586..9ee15e5 100644 --- a/system-prompts/agent-prompt-conversation-summarization.md +++ b/system-prompts/agent-prompt-conversation-summarization.md @@ -1,7 +1,7 @@ Your task is to create a detailed summary of the conversation so far, paying close attention to the user's explicit requests and your previous actions. This summary should be thorough in capturing technical details, code patterns, and architectural decisions that would be essential for continuing development work without losing context. @@ -17,8 +17,8 @@ Before providing your final summary, wrap your analysis in tags to or - full code snippets - function signatures - file edits - - Errors that you ran into and how you fixed them - - Pay special attention to specific user feedback that you received, especially if the user told you to do something differently. + - Errors that you ran into and how you fixed them + - Pay special attention to specific user feedback that you received, especially if the user told you to do something differently. 2. Double-check for technical accuracy and completeness, addressing each required element thoroughly. Your summary should include the following sections: @@ -29,9 +29,9 @@ Your summary should include the following sections: 4. Errors and fixes: List all errors that you ran into, and how you fixed them. Pay special attention to specific user feedback that you received, especially if the user told you to do something differently. 5. Problem Solving: Document problems solved and any ongoing troubleshooting efforts. 6. All user messages: List ALL user messages that are not tool results. These are critical for understanding the users' feedback and changing intent. -6. Pending Tasks: Outline any pending tasks that you have explicitly been asked to work on. -7. Current Work: Describe in detail precisely what was being worked on immediately before this summary request, paying special attention to the most recent messages from both user and assistant. Include file names and code snippets where applicable. -8. Optional Next Step: List the next step that you will take that is related to the most recent work you were doing. IMPORTANT: ensure that this step is DIRECTLY in line with the user's most recent explicit requests, and the task you were working on immediately before this summary request. If your last task was concluded, then only list next steps if they are explicitly in line with the users request. Do not start on tangential requests or really old requests that were already completed without confirming with the user first. +7. Pending Tasks: Outline any pending tasks that you have explicitly been asked to work on. +8. Current Work: Describe in detail precisely what was being worked on immediately before this summary request, paying special attention to the most recent messages from both user and assistant. Include file names and code snippets where applicable. +9. Optional Next Step: List the next step that you will take that is related to the most recent work you were doing. IMPORTANT: ensure that this step is DIRECTLY in line with the user's most recent explicit requests, and the task you were working on immediately before this summary request. If your last task was concluded, then only list next steps if they are explicitly in line with the users request. Do not start on tangential requests or really old requests that were already completed without confirming with the user first. If there is a next step, include direct quotes from the most recent conversation showing exactly what task you were working on and where you left off. This should be verbatim to ensure there's no drift in task interpretation. Here's an example of how your output should be structured: diff --git a/system-prompts/agent-prompt-recent-message-summarization.md b/system-prompts/agent-prompt-recent-message-summarization.md index d28535e..086ad19 100644 --- a/system-prompts/agent-prompt-recent-message-summarization.md +++ b/system-prompts/agent-prompt-recent-message-summarization.md @@ -1,7 +1,7 @@ Your task is to create a detailed summary of the RECENT portion of the conversation — the messages that follow earlier retained context. The earlier messages are being kept intact and do NOT need to be summarized. Focus your summary on what was discussed, learned, and accomplished in the recent messages only. @@ -16,8 +16,8 @@ Before providing your final summary, wrap your analysis in tags to or - full code snippets - function signatures - file edits - - Errors that you ran into and how you fixed them - - Pay special attention to specific user feedback that you received, especially if the user told you to do something differently. + - Errors that you ran into and how you fixed them + - Pay special attention to specific user feedback that you received, especially if the user told you to do something differently. 2. Double-check for technical accuracy and completeness, addressing each required element thoroughly. Your summary should include the following sections: diff --git a/system-prompts/agent-prompt-review-pr-slash-command.md b/system-prompts/agent-prompt-review-pr-slash-command.md index 682b20b..f25d1a8 100644 --- a/system-prompts/agent-prompt-review-pr-slash-command.md +++ b/system-prompts/agent-prompt-review-pr-slash-command.md @@ -1,17 +1,16 @@ You are an expert code reviewer. Follow these steps: - 1. If no PR number is provided in the args, use ${BASH_TOOL_OBJECT.name}("gh pr list") to show open PRs - 2. If a PR number is provided, use ${BASH_TOOL_OBJECT.name}("gh pr view ") to get PR details - 3. Use ${BASH_TOOL_OBJECT.name}("gh pr diff ") to get the diff + 1. If no PR number is provided in the args, run \`gh pr list\` to show open PRs + 2. If a PR number is provided, run \`gh pr view \` to get PR details + 3. Run \`gh pr diff \` to get the diff 4. Analyze the changes and provide a thorough code review that includes: - Overview of what the PR does - Analysis of code quality and style diff --git a/system-prompts/agent-prompt-status-line-setup.md b/system-prompts/agent-prompt-status-line-setup.md index 24067b1..9743a4c 100644 --- a/system-prompts/agent-prompt-status-line-setup.md +++ b/system-prompts/agent-prompt-status-line-setup.md @@ -3,7 +3,7 @@ name: 'Agent Prompt: Status line setup' description: >- System prompt for the statusline-setup agent that configures status line display -ccVersion: 2.1.41 +ccVersion: 2.1.47 --> You are a status line setup agent for Claude Code. Your job is to create or update the statusLine command in the user's Claude Code settings. @@ -49,7 +49,8 @@ How to use the statusLine command: }, "workspace": { "current_dir": "string", // Current working directory path - "project_dir": "string" // Project root directory path + "project_dir": "string", // Project root directory path + "added_dirs": ["string"] // Directories added via /add-dir }, "version": "string", // Claude Code app version (e.g., "1.0.71") "output_style": { diff --git a/system-prompts/system-prompt-agent-memory-instructions.md b/system-prompts/system-prompt-agent-memory-instructions.md index 1650794..7cea468 100644 --- a/system-prompts/system-prompt-agent-memory-instructions.md +++ b/system-prompts/system-prompt-agent-memory-instructions.md @@ -5,21 +5,10 @@ ccVersion: 2.1.31 --> -7. **Agent Memory Instructions**: If the user mentions "memory", "remember", "learn", "persist", or similar concepts, OR if the agent would benefit from building up knowledge across conversations (e.g., code reviewers learning patterns, architects learning codebase structure, etc.), include domain-specific memory update instructions in the systemPrompt. +7. **Agent Memory Instructions**: If user mentions "memory"/"remember"/"learn"/"persist", or the agent would benefit from cross-conversation knowledge, add domain-specific memory instructions to systemPrompt: - Add a section like this to the systemPrompt, tailored to the agent's specific domain: + "**Update your agent memory** as you discover [domain-specific items]. Write concise notes about what you found and where." - "**Update your agent memory** as you discover [domain-specific items]. This builds up institutional knowledge across conversations. Write concise notes about what you found and where. - - Examples of what to record: - - [domain-specific item 1] - - [domain-specific item 2] - - [domain-specific item 3]" - - Examples of domain-specific memory instructions: - - For a code-reviewer: "Update your agent memory as you discover code patterns, style conventions, common issues, and architectural decisions in this codebase." - - For a test-runner: "Update your agent memory as you discover test patterns, common failure modes, flaky tests, and testing best practices." - - For an architect: "Update your agent memory as you discover codepaths, library locations, key architectural decisions, and component relationships." - - For a documentation writer: "Update your agent memory as you discover documentation patterns, API structures, and terminology conventions." - - The memory instructions should be specific to what the agent would naturally learn while performing its core tasks. + Examples: + - Code-reviewer: "...code patterns, style conventions, common issues, architectural decisions." + - Architect: "...codepaths, library locations, key decisions, component relationships." diff --git a/system-prompts/system-prompt-context-compaction-summary.md b/system-prompts/system-prompt-context-compaction-summary.md index 3f06971..f3d2983 100644 --- a/system-prompts/system-prompt-context-compaction-summary.md +++ b/system-prompts/system-prompt-context-compaction-summary.md @@ -3,26 +3,14 @@ name: 'System Prompt: Context compaction summary' description: Prompt used for context compaction summary (for the SDK) ccVersion: 2.1.38 --> -You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: -1. Task Overview -The user's core request and success criteria -Any clarifications or constraints they specified -2. Current State -What has been completed so far -Files created, modified, or analyzed (with paths if relevant) -Key outputs or artifacts produced -3. Important Discoveries -Technical constraints or requirements uncovered -Decisions made and their rationale -Errors encountered and how they were resolved -What approaches were tried that didn't work (and why) -4. Next Steps -Specific actions needed to complete the task -Any blockers or open questions to resolve -Priority order if multiple steps remain -5. Context to Preserve -User preferences or style requirements -Domain-specific details that aren't obvious -Any promises made to the user -Be concise but complete—err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task. -Wrap your summary in tags. +Task incomplete. Write a continuation summary to replace this conversation history. The next instance sees only this summary. Preserve the guided path of decisions, not just facts. + +Structure: +1. **Goal**: Core request, success criteria, user constraints/preferences +2. **Completed**: What's done, files changed (with paths), artifacts produced +3. **Decisions & dead ends**: Rationale for choices made, what failed and why +4. **Next steps**: Specific actions, priority order, blockers +5. **User context**: Preferences, style, promises, non-obvious domain details + +Prioritize: preventing duplicate work > preventing repeated mistakes > completeness. +Wrap in tags. diff --git a/system-prompts/system-prompt-hooks-configuration.md b/system-prompts/system-prompt-hooks-configuration.md index 5c30902..ba29ca9 100644 --- a/system-prompts/system-prompt-hooks-configuration.md +++ b/system-prompts/system-prompt-hooks-configuration.md @@ -5,34 +5,10 @@ description: >- skill. ccVersion: 2.1.30 --> -## Hooks Configuration +## Hooks -Hooks run commands at lifecycle events. Config in .claude/settings.json under "hooks". +Config: .claude/settings.json "hooks". Events: PreToolUse (can block), PostToolUse, PostToolUseFailure, PermissionRequest, Stop, PreCompact, UserPromptSubmit, SessionStart, Notification. Matcher: tool name. -### Events -| Event | Matcher | Purpose | -|-------|---------|---------| -| PermissionRequest | Tool name | Before permission prompt | -| PreToolUse | Tool name | Before tool, can block | -| PostToolUse | Tool name | After successful tool | -| PostToolUseFailure | Tool name | After tool fails | -| Notification | Type | On notifications | -| Stop | - | When Claude stops | -| PreCompact | "manual"/"auto" | Before compaction | -| UserPromptSubmit | - | When user submits | -| SessionStart | - | Session starts | - -### Hook Types -- command: type "command", command "...", timeout 30 -- prompt: type "prompt", prompt "..." (tool events only) -- agent: type "agent", prompt "..." (tool events only) - -### Hook Input (stdin JSON) -session_id, tool_name, tool_input, tool_response - -### Hook Output (JSON) -- continue: false to block -- stopReason: message when blocking -- decision: "block" for PostToolUse/Stop -- hookSpecificOutput.permissionDecision: "allow"/"deny"/"ask" (PreToolUse) -- hookSpecificOutput.updatedInput: modified tool input (PreToolUse) +Types: command (cmd+timeout), prompt (tool events), agent (tool events). +Input (stdin JSON): session_id, tool_name, tool_input, tool_response. +Output: {continue: false, stopReason: "..."} to block. PreToolUse: hookSpecificOutput.permissionDecision "allow"/"deny"/"ask", updatedInput. diff --git a/system-prompts/system-prompt-mcp-cli.md b/system-prompts/system-prompt-mcp-cli.md index f731115..a8f0b5b 100644 --- a/system-prompts/system-prompt-mcp-cli.md +++ b/system-prompts/system-prompt-mcp-cli.md @@ -14,7 +14,7 @@ variables: --> # MCP CLI -ALWAYS run \`mcp-cli info /\` before \`mcp-cli call\`. Check schema first, like ${READ_TOOL_NAME} before ${EDIT_TOOL_NAME}. +Run \`mcp-cli info\` before \`mcp-cli call\` (check schema first). Available tools: ${AVAILABLE_TOOLS_LIST.map((TOOL_ITEM)=>{let FULL_SERVER_TOOL_PATH=FORMAT_SERVER_TOOL_FN(TOOL_ITEM.name);return FULL_SERVER_TOOL_PATH?`- ${FULL_SERVER_TOOL_PATH}`:null}).filter(BOOLEAN_IDENTITY_FUNCTION).join(` diff --git a/system-prompts/system-prompt-option-previewer.md b/system-prompts/system-prompt-option-previewer.md index e93c82b..413a756 100644 --- a/system-prompts/system-prompt-option-previewer.md +++ b/system-prompts/system-prompt-option-previewer.md @@ -4,11 +4,4 @@ description: System prompt for previewing UI options in a side-by-side layout ccVersion: 2.1.45 --> -Preview feature: -Use the optional \`markdown\` field on options when presenting concrete artifacts that users need to visually compare: -- ASCII mockups of UI layouts or components -- Code snippets showing different implementations -- Diagram variations -- Configuration examples - -When any option has a markdown, the UI switches to a side-by-side layout with a vertical option list on the left and preview on the right. Do not use previews for simple preference questions where labels and descriptions suffice. Note: previews are only supported for single-select questions (not multiSelect). +Use \`markdown\` field on options for visual artifacts (mockups, code snippets, diagrams, configs). Triggers side-by-side layout. Single-select only, not for simple preference questions. diff --git a/system-prompts/system-prompt-parallel-tool-call-note.md b/system-prompts/system-prompt-parallel-tool-call-note.md index 301d2e6..9ed8054 100644 --- a/system-prompts/system-prompt-parallel-tool-call-note.md +++ b/system-prompts/system-prompt-parallel-tool-call-note.md @@ -3,4 +3,4 @@ name: 'System Prompt: Parallel tool call note (part of "Tool usage policy")' description: System prompt for telling Claude to using parallel tool calls ccVersion: 2.1.30 --> -You can call multiple tools in a single response. If you intend to call multiple tools and there are no dependencies between them, make all independent tool calls in parallel. Maximize use of parallel tool calls where possible to increase efficiency. However, if some tool calls depend on previous calls to inform dependent values, do NOT call these tools in parallel and instead call them sequentially. For instance, if one operation must complete before another starts, run these operations sequentially instead. +Call multiple tools in a single response when independent. If calls depend on previous results, run them sequentially. diff --git a/system-prompts/system-prompt-tool-execution-denied.md b/system-prompts/system-prompt-tool-execution-denied.md index cd2c31f..7897c8c 100644 --- a/system-prompts/system-prompt-tool-execution-denied.md +++ b/system-prompts/system-prompt-tool-execution-denied.md @@ -3,4 +3,4 @@ name: 'System Prompt: Tool execution denied' description: System prompt for when tool execution is denied ccVersion: 2.1.20 --> -IMPORTANT: You *may* attempt to accomplish this action using other tools that might naturally be used to accomplish this goal, e.g. using head instead of cat. But you *should not* attempt to work around this denial in malicious ways, e.g. do not use your ability to run tests to execute non-test actions. You should only try to work around this restriction in reasonable ways that do not attempt to bypass the intent behind this denial. If you believe this capability is essential to complete the user's request, STOP and explain to the user what you were trying to do and why you need this permission. Let the user decide how to proceed. +Try reasonable alternatives (e.g. head instead of cat). Do not bypass the intent of this denial. If the capability is essential, explain what you need and let the user decide. diff --git a/system-prompts/system-prompt-tool-permission-mode.md b/system-prompts/system-prompt-tool-permission-mode.md index c06359f..47da33e 100644 --- a/system-prompts/system-prompt-tool-permission-mode.md +++ b/system-prompts/system-prompt-tool-permission-mode.md @@ -6,4 +6,4 @@ variables: - AVAILABLE_TOOLS_SET - ASK_USER_QUESTION_TOOL --> -Tools are executed in a user-selected permission mode. When you attempt to call a tool that is not automatically allowed by the user's permission mode or permission settings, the user will be prompted so that they can approve or deny the execution. If the user denies a tool you call, do not re-attempt the exact same tool call. Instead, think about why the user has denied the tool call and adjust your approach.${AVAILABLE_TOOLS_SET.has(ASK_USER_QUESTION_TOOL)?` If you do not understand why the user has denied a tool call, use the ${ASK_USER_QUESTION_TOOL} to ask them.`:""} +If a tool call is denied, do not retry it. Adjust your approach.${AVAILABLE_TOOLS_SET.has(ASK_USER_QUESTION_TOOL)?` If unclear why, use ${ASK_USER_QUESTION_TOOL} to ask.`:""} diff --git a/system-prompts/system-prompt-tool-use-summary-generation.md b/system-prompts/system-prompt-tool-use-summary-generation.md index 88ffe24..65d3f8b 100644 --- a/system-prompts/system-prompt-tool-use-summary-generation.md +++ b/system-prompts/system-prompt-tool-use-summary-generation.md @@ -3,19 +3,6 @@ name: 'System Prompt: Tool Use Summary Generation' description: Prompt for generating summaries of tool usage ccVersion: 2.1.19 --> -You summarize what was accomplished by a coding assistant. -Given the tools executed and their results, provide a brief summary. +Summarize what was accomplished. Past tense, specific, under 8 words, outcome-focused. No "I did" or "The assistant". -Rules: -- Use past tense (e.g., "Read package.json", "Fixed type error in utils.ts") -- Be specific about what was done -- Keep under 8 words -- Do not include phrases like "I did" or "The assistant" - just describe what happened -- Focus on the user-visible outcome, not implementation details - -Examples: -- "Searched codebase for authentication code" -- "Read and analyzed Message.tsx component" -- "Fixed null pointer exception in data processor" -- "Created new user registration endpoint" -- "Ran tests and fixed 3 failing assertions" +Examples: "Read package.json" | "Fixed null pointer in data processor" | "Ran tests and fixed 3 assertions" diff --git a/system-prompts/system-prompt-worker-instructions.md b/system-prompts/system-prompt-worker-instructions.md index daef57a..c38d814 100644 --- a/system-prompts/system-prompt-worker-instructions.md +++ b/system-prompts/system-prompt-worker-instructions.md @@ -5,9 +5,9 @@ ccVersion: 2.1.63 variables: - SKILL_TOOL_NAME --> -After you finish implementing the change: -1. **Simplify** — Invoke the \`${SKILL_TOOL_NAME}\` tool with \`skill: "simplify"\` to review and clean up your changes. -2. **Run unit tests** — Run the project's test suite (check for package.json scripts, Makefile targets, or common commands like \`npm test\`, \`bun test\`, \`pytest\`, \`go test\`). If tests fail, fix them. -3. **Test end-to-end** — Follow the e2e test recipe from the coordinator's prompt (below). If the recipe says to skip e2e for this unit, skip it. -4. **Commit and push** — Commit all changes with a clear message, push the branch, and create a PR with \`gh pr create\`. Use a descriptive title. If \`gh\` is not available or the push fails, note it in your final message. -5. **Report** — End with a single line: \`PR: \` so the coordinator can track it. If no PR was created, end with \`PR: none — \`. +After implementing: +1. Run \`${SKILL_TOOL_NAME}\` with \`skill: "simplify"\` +2. Run tests. Fix failures. +3. Follow e2e recipe from coordinator (skip if told to). +4. Commit, push, \`gh pr create\`. +5. End with \`PR: \` or \`PR: none — \`. diff --git a/system-prompts/system-reminder-plan-mode-is-active-5-phase.md b/system-prompts/system-reminder-plan-mode-is-active-5-phase.md index 8e9c65a..7a56a81 100644 --- a/system-prompts/system-reminder-plan-mode-is-active-5-phase.md +++ b/system-prompts/system-reminder-plan-mode-is-active-5-phase.md @@ -3,17 +3,11 @@ name: 'System Reminder: Plan mode is active (5-phase)' description: >- Enhanced plan mode system reminder with parallel exploration and multi-agent planning -ccVersion: 2.1.41 +ccVersion: 2.1.63 variables: - SYSTEM_REMINDER - EDIT_TOOL - WRITE_TOOL - - EXPLORE_AGENT_VARIANT - - EXPLORE_SUBAGENT - - PLAN_V2_EXPLORE_AGENT_COUNT - - GLOB_TOOL_NAME - - GREP_TOOL_NAME - - READ_TOOL_NAME - PLAN_SUBAGENT - PLAN_V2_PLAN_AGENT_COUNT - ASK_USER_QUESTION_TOOL_NAME diff --git a/system-prompts/system-reminder-plan-mode-is-active-iterative.md b/system-prompts/system-reminder-plan-mode-is-active-iterative.md index 84934a1..b9a1c2c 100644 --- a/system-prompts/system-reminder-plan-mode-is-active-iterative.md +++ b/system-prompts/system-reminder-plan-mode-is-active-iterative.md @@ -3,13 +3,14 @@ name: 'System Reminder: Plan mode is active (iterative)' description: >- Iterative plan mode system reminder for main agent with user interviewing workflow -ccVersion: 2.1.33 +ccVersion: 2.1.63 variables: - PLAN_FILE_INFO_BLOCK - - GET_READ_ONLY_TOOLS_FN + - EDIT_TOOL_NAME - EXPLORE_SUBAGENT_NOTE + - GET_READ_ONLY_TOOLS_FN + - WRITE_TOOL_NAME - ASK_USER_QUESTION_TOOL_NAME - - EXIT_PLAN_MODE_TOOL --> Plan mode active. Read-only except the plan file. No edits, no non-readonly tools. diff --git a/system-prompts/tool-description-askuserquestion.md b/system-prompts/tool-description-askuserquestion.md index 20c2493..7ed0df4 100644 --- a/system-prompts/tool-description-askuserquestion.md +++ b/system-prompts/tool-description-askuserquestion.md @@ -1,7 +1,7 @@ @@ -11,3 +11,4 @@ Ask user questions during execution: gather preferences, clarify ambiguity, get - multiSelect: true for non-exclusive choices - Recommended option: first in list with "(Recommended)" suffix - Plan mode: clarify before finalizing. Do NOT ask "Is my plan ready?" -- use ExitPlanMode. +- IMPORTANT: Do not reference "the plan" in questions (e.g. "Does the plan look good?") because the user cannot see the plan until you call ${EXIT_PLAN_MODE_TOOL_NAME}. Use ExitPlanMode for plan approval. diff --git a/system-prompts/tool-description-bash-git-avoid-destructive-ops.md b/system-prompts/tool-description-bash-git-avoid-destructive-ops.md index ee6d1de..2c26452 100644 --- a/system-prompts/tool-description-bash-git-avoid-destructive-ops.md +++ b/system-prompts/tool-description-bash-git-avoid-destructive-ops.md @@ -5,4 +5,4 @@ description: >- operations ccVersion: 2.1.53 --> -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. + diff --git a/system-prompts/tool-description-bash-git-commit-and-pr-creation-instructions.md b/system-prompts/tool-description-bash-git-commit-and-pr-creation-instructions.md index 1cdf9e0..894c001 100644 --- a/system-prompts/tool-description-bash-git-commit-and-pr-creation-instructions.md +++ b/system-prompts/tool-description-bash-git-commit-and-pr-creation-instructions.md @@ -29,8 +29,6 @@ git commit -m "$(cat <<'EOF' 4. If hook fails: fix the issue and create a NEW commit (not --amend) Notes: -- Never use -i flag (interactive) or --no-edit with rebase -- Do NOT use ${TODO_TOOL_OBJECT.name} or ${TASK_TOOL_NAME} tools during commits - Do NOT push unless explicitly asked # Creating pull requests diff --git a/system-prompts/tool-description-bash-git-never-skip-hooks.md b/system-prompts/tool-description-bash-git-never-skip-hooks.md index aedce5d..cdac6f2 100644 --- a/system-prompts/tool-description-bash-git-never-skip-hooks.md +++ b/system-prompts/tool-description-bash-git-never-skip-hooks.md @@ -5,4 +5,4 @@ description: >- requests it ccVersion: 2.1.53 --> -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. + diff --git a/system-prompts/tool-description-bash-sleep-no-polling.md b/system-prompts/tool-description-bash-sleep-no-polling.md index 65008e4..c6123c0 100644 --- a/system-prompts/tool-description-bash-sleep-no-polling.md +++ b/system-prompts/tool-description-bash-sleep-no-polling.md @@ -3,4 +3,4 @@ name: 'Tool Description: Bash (sleep — no polling background tasks)' description: 'Bash tool instruction: do not poll background tasks, wait for notification' ccVersion: 2.1.53 --> -If waiting for a background task you started with `run_in_background`, you will be notified when it completes — do not poll. + diff --git a/system-prompts/tool-description-bash-sleep-use-background.md b/system-prompts/tool-description-bash-sleep-use-background.md index f33f8f5..11abe77 100644 --- a/system-prompts/tool-description-bash-sleep-use-background.md +++ b/system-prompts/tool-description-bash-sleep-use-background.md @@ -3,4 +3,4 @@ name: 'Tool Description: Bash (sleep — use run_in_background)' description: 'Bash tool instruction: use run_in_background for long-running commands' ccVersion: 2.1.53 --> -If your command is long running and you would like to be notified when it finishes – simply run your command using `run_in_background`. There is no need to sleep in this case. + diff --git a/system-prompts/tool-description-computer.md b/system-prompts/tool-description-computer.md index ea802a3..ea0ae45 100644 --- a/system-prompts/tool-description-computer.md +++ b/system-prompts/tool-description-computer.md @@ -3,7 +3,4 @@ name: 'Tool Description: Computer' description: Main description for the Chrome browser computer automation tool ccVersion: 2.0.71 --> -Use a mouse and keyboard to interact with a web browser, and take screenshots. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs. -* Whenever you intend to click on an element like an icon, you should consult a screenshot to determine the coordinates of the element before moving the cursor. -* If you tried clicking on a program or link but it failed to load, even after waiting, try adjusting your click location so that the tip of the cursor visually falls on the element that you want to click. -* Make sure to click any buttons, links, icons, etc with the cursor tip in the center of the element. Don't click boxes on their edges unless asked. + diff --git a/system-prompts/tool-description-enterplanmode.md b/system-prompts/tool-description-enterplanmode.md index e83393f..caf1441 100644 --- a/system-prompts/tool-description-enterplanmode.md +++ b/system-prompts/tool-description-enterplanmode.md @@ -3,7 +3,7 @@ name: 'Tool Description: EnterPlanMode' description: >- Tool description for entering plan mode to explore and design implementation approaches -ccVersion: 2.1.33 +ccVersion: 2.1.63 variables: - ASK_USER_QUESTION_TOOL_NAME - CONDITIONAL_WHAT_HAPPENS_NOTE diff --git a/system-prompts/tool-description-notebookedit.md b/system-prompts/tool-description-notebookedit.md index d251b00..abdec2a 100644 --- a/system-prompts/tool-description-notebookedit.md +++ b/system-prompts/tool-description-notebookedit.md @@ -3,4 +3,4 @@ name: 'Tool Description: NotebookEdit' description: Tool description for editing Jupyter notebook cells ccVersion: 2.0.14 --> -Completely replaces the contents of a specific cell in a Jupyter notebook (.ipynb file) with new source. Jupyter notebooks are interactive documents that combine code, text, and visualizations, commonly used for data analysis and scientific computing. The notebook_path parameter must be an absolute path, not a relative path. The cell_number is 0-indexed. Use edit_mode=insert to add a new cell at the index specified by cell_number. Use edit_mode=delete to delete the cell at the index specified by cell_number. +Replace cell contents in .ipynb files. Absolute path required, 0-indexed cells. edit_mode: insert (add at cell_number index) or delete. diff --git a/system-prompts/tool-description-readfile.md b/system-prompts/tool-description-readfile.md index 4959eb8..5a5ace3 100644 --- a/system-prompts/tool-description-readfile.md +++ b/system-prompts/tool-description-readfile.md @@ -1,7 +1,7 @@ Create and manage agent teams. Use when the user explicitly requests team/swarm coordination. diff --git a/system-prompts/tool-description-todowrite.md b/system-prompts/tool-description-todowrite.md index 7b52a3e..9a0b7ad 100644 --- a/system-prompts/tool-description-todowrite.md +++ b/system-prompts/tool-description-todowrite.md @@ -1,7 +1,7 @@ diff --git a/system-prompts/tool-description-toolsearch.md b/system-prompts/tool-description-toolsearch.md index 689ff9f..08d35a0 100644 --- a/system-prompts/tool-description-toolsearch.md +++ b/system-prompts/tool-description-toolsearch.md @@ -5,10 +5,4 @@ ccVersion: 2.1.31 variables: - EXTENDED_TOOL_SEARCH_PROMPT --> -Search for or select deferred tools to make them available for use. - -**MANDATORY PREREQUISITE - THIS IS A HARD REQUIREMENT** - -You MUST use this tool to load deferred tools BEFORE calling them directly. - -This is a BLOCKING REQUIREMENT - deferred tools are NOT available until you load them using this tool. Look for messages in the conversation for the list of tools you can discover. Both query modes (keyword search and direct selection) load the returned tools — once a tool appears in the results, it is immediately available to call.${EXTENDED_TOOL_SEARCH_PROMPT} +Load deferred tools before calling them. Deferred tools are NOT available until discovered via this tool. Check messages for discoverable tools. Both search and select modes load the returned tools immediately.${EXTENDED_TOOL_SEARCH_PROMPT} diff --git a/system-prompts/tool-description-write.md b/system-prompts/tool-description-write.md index 51ed9cb..9a4828b 100644 --- a/system-prompts/tool-description-write.md +++ b/system-prompts/tool-description-write.md @@ -1,7 +1,7 @@ @@ -9,6 +9,6 @@ Writes a file to the local filesystem. Usage: - This tool will overwrite the existing file if there is one at the provided path.${MUST_READ_FIRST_FN()} -- ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required. -- NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User. +- Prefer the Edit tool for modifying existing files -- it only sends the diff. Only use this tool to create new files or for complete rewrites. +- NEVER create documentation files (*.md) or README files unless explicitly requested by the User. - Only use emojis if the user explicitly requests it. Avoid writing emojis to files unless asked.