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

[FEATURE] Claude Code: Comprehensive Prompt Improvements (Tested & Working)

Open xdevs23 opened this issue 2 months ago • 4 comments

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

I've been using Claude Code extensively and made several modifications that significantly improve the experience. All changes have been tested and are working well.

Problems Addressed:

  1. Compaction loses critical context - After auto-compaction, Claude forgets user corrections, repeats mistakes, doesn't realize it's resuming
  2. Model acknowledges instructions but doesn't follow them - Rationalizes back to different approaches after understanding user hints
  3. Over-complication - Takes simple hints and pattern-matches to complex solutions
  4. Unwanted flags - Adds --dry-run, --verbose etc. when not requested

Changes Made:

Compaction System (l71 function):

  • Replaced terse resumption message with structured "Auto-Compaction Notice"
  • Clear framing: "You are RESUMING an existing task, not starting a new one"
  • Reminders to check todo list, verify files exist, ask when uncertain

Summarization Prompt (aY0 function):

  • Added section 7: "User Rejections and Corrections (VERBATIM)"
  • Added section 8: "Last 5 Relevant Messages" in terminal format (● Tool, ⎿ output, > user message)
  • Emphasis on preserving corrections verbatim to avoid repeating mistakes
  • Fixed numbering (original had duplicate section 6's) (2.0.76)

New System Prompt Section - "Follow user instructions exactly":

  • Follow instructions EXACTLY without adding unrequested flags/options
  • Don't rationalize back to alternatives after acknowledging user input
  • Try the SIMPLEST interpretation first
  • "If they say 'use X', try literally using X before investigating complex alternatives"
  • User corrections ARE the answer - don't keep suggesting rejected approaches

Tone & Communication Style section:

  • Conversational, collaborative framing
  • "Skilled colleague" rather than "formal assistant"

Other improvements:

  • Removed auto-generated Co-Authored-By in commits (user preference)
  • Updated knowledge cutoff year reference
  • Various wording improvements for clarity
  • Skills are now tracked during summarization and reminded for reload after compaction (addresses #13919)

Didn't publish publicly due to copyright considerations. I can provide the patch file which you can apply directly against 2.0.76 to test. Note that I removed the PR instructions since I don't use CC for PRs and it just unnecessarily clutters the context.

P.S. I would really appreciate if Claude Code were open-sourced. Contributing improvements like these would be much easier through proper pull requests rather than patching minified JavaScript.

Proposed Solution

Change the system prompt, plan mode prompt, compaction prompt and compaction resumption prompt. Can provide patch file if requested.

Alternative Solutions

CLAUDE.md, doesn't help, and system prompt takes precedence, undermining CLAUDE.md efforts.

Priority

Low - Nice to have

Feature Category

API and model interactions

Use Case Example

  1. Literally any scenario

Additional Context

Not posting patch file due to copyright, will add if approved. This is to be interpreted like a pull request that fixes existing issues (see #13919) in addition to what I experienced myself. This is not a bug report in and of itself.

xdevs23 avatar Jan 07 '26 00:01 xdevs23