Skip to content

read before write rules are broken #1005

@SandorDobi

Description

@SandorDobi

Hi,

ClaudeCode, OpenCode have a strict read before write policy. That policy is broken when Read tool is rewritten by RTK to rtk read. The agent sees the file and the optimized content wants to edit the file but there is no rtk edit command so the agent calls the native tool. But there is no native read tool calls before the edit and the edit fails.

The agent needs to issue an another read to make able the edit the file. It means the agent loosing time and tokens when rereads the file. But there is a catch if the rewrite hooks work then the agent even cannot issue a native read command because it will be rewritten again.

I disabled the read command in the rtk config and instruct the agent to use rtk cat for explore, but disabling the read disabled the cat too. So now rtk read and rtk cat returns the raw file content. At least the Edit works.
This is suboptimal and I think it would be optimal solution if RTK implements Edit and Write too, which is bypassing the read before write policy or better tracking the reads can enforce the policy on its own.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2-importantDevrait être fixé bientôteffort-largePlusieurs jours, nouveau moduleenhancementNew feature or requestfilter-qualityFilter produces incorrect/truncated signal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions