From 7caff5f0320ae4c241a101933d583d50510ab043 Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Wed, 22 Apr 2026 23:52:07 +0200 Subject: [PATCH] Adjust claude-code context * Keep the replace_content tool enabled * Instruct the agent to use Serena's editing tools, especially when editing code that was read through Serena This is in reaction to Claude Code's editing tool denying edits without corresponding prior reads Resolves #1400 --- src/serena/resources/config/contexts/claude-code.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/serena/resources/config/contexts/claude-code.yml b/src/serena/resources/config/contexts/claude-code.yml index b6d632a7..fe63878b 100644 --- a/src/serena/resources/config/contexts/claude-code.yml +++ b/src/serena/resources/config/contexts/claude-code.yml @@ -7,16 +7,15 @@ prompt: | **IMPORTANT**: If you haven't seen Serena's tools yet, you should use the tool search tool to load all of them right now. For exploring and reading code in a token-efficient manner, use Serena's code-centric overview and symbolic search tools. - For edits, where it makes sense, use Serena's editing tools since they are more token efficient. - Use your own editing tools only if Serena's editing tools would be suboptimal. - **IMPORTANT**: Never use a tool before reading its schema via the tool-search tool! + For edits, prefer Serena's editing tools since they are more token efficient. + Especially when editing code you have read through Serena, ALWAYS use Serena's tools for editing, because your built-in tools will deny such edits (they will assume you haven't read the content). + **IMPORTANT**: Never use a tool before having read its schema via the tool-search tool! excluded_tools: - create_text_file - read_file - execute_shell_command - - replace_content - find_file - list_dir - search_for_pattern