Skip to content

refactor: Tighten initial instructions; exact + backend-aware CC tool table; list supported file types#1567

Open
paul-basanets wants to merge 1 commit into
oraios:mainfrom
paul-basanets:instructions-updated
Open

refactor: Tighten initial instructions; exact + backend-aware CC tool table; list supported file types#1567
paul-basanets wants to merge 1 commit into
oraios:mainfrom
paul-basanets:instructions-updated

Conversation

@paul-basanets

@paul-basanets paul-basanets commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Refines the instruction texts coding agents receive from Serena, applying Anthropic's current Opus 4.x prompting guidance (cut redundancy, drop over-emphasis like CRITICAL/FORBIDDEN/ALWAYS, prefer positive framing), and enriches the project activation message.

Changes

  • Laconic promptssystem_prompt, the claude-code context, and the editing mode are made shorter (~37% / 53% / 59%) while preserving all load-bearing behavior. All Jinja conditionals and tool/config blocks are unchanged.
  • Exact, backend-aware CC tool tablecc_system_prompt_override's tool-mapping table now uses the real callable tool names, and gains a JetBrains-backend section (jet_brains_* navigation/refactoring tools) that renders only when the configured language backend is JetBrains.
  • Backend wiring — regenerated the prompt factory for the new jetbrains_backend variable, added a SerenaPromptFactory override, and resolve the effective backend in serena prompts print-cc-system-prompt-override (global config, with an optional --project override).
  • Supported file types — the project activation message now lists the supported file types (e.g. .py, .pyi, .ts, ...), derived from each language's source filename matcher via new Language.get_source_file_extensions() / FilenameMatcher.file_extensions.

Conclusion

Now initial instructions are significantly shorter (~1k tokens reduction).
My subjective impression is Claude Code works better with Serena now and calls its tools more ofter.
I hope you'll find those changes useful.

@paul-basanets paul-basanets force-pushed the instructions-updated branch 2 times, most recently from 12a6daf to c7f78d3 Compare June 12, 2026 09:28
@MischaPanch

Copy link
Copy Markdown
Member

Thank you! We have been running a dedicated effort to improve the instructions by building an in-house benchmark. I will take your proposal in consideration and soon merge the best of the formulations to commit the improved instructions.

Since the changes we already have will have conflicts with the changes here, merging the PR as is makes no sense. But I will keep it as reference until improved instructions are on main, then close it, ok?

@paul-basanets

Copy link
Copy Markdown
Contributor Author

@MischaPanch , of course, feel free to extract anything useful and close the PR when it's fine.
I just noticed the the instructions are too long and partially contradicts Anthropic guidelines. However i didn't tested it with other model families/vendors.
Maybe it makes sense to have different intructions for different models (contexts) but it needs some extra research.

…e CC tool table; list supported file types

Apply Anthropic's current Opus 4.x prompting guidance to the instruction
texts coding agents receive: cut redundancy, drop over-emphasis
(CRITICAL/FORBIDDEN/ALWAYS), and prefer positive framing.

- Make system_prompt, the claude-code context, and the editing mode laconic
  (~37/53/59% smaller) while preserving all load-bearing behavior.
- cc_system_prompt_override: tool-mapping table now uses exact tool names and
  gains a JetBrains-backend section (jet_brains_* navigation/refactoring
  tools) gated on the configured language backend. Regenerate the prompt
  factory for the new `jetbrains_backend` var, add a SerenaPromptFactory
  override, and resolve the effective backend in
  `prompts print-cc-system-prompt-override` (global config + optional
  --project override).
- Project activation message now lists supported file types, derived from
  each language's source filename matcher (new
  Language.get_source_file_extensions / FilenameMatcher.file_extensions).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@paul-basanets paul-basanets force-pushed the instructions-updated branch from c7f78d3 to 9f2ad32 Compare June 18, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants