Module files

ps_module_file

Write · preview + approveBlock 4 · Modules (service connector, off by default)Paid version onlyService connector onlyBlock off after install

Reads a module's files and, when there's no other way, changes them with a backup first; such changes disappear when the module is updated.

Free TellMyShop Audit: No. This tool is only in the paid version of TellMyShop. The free TellMyShop Audit has only tools that read your store.

Ask Claude

„The xyzshipping module keeps logging "Undefined index id_carrier". Find the line and fix it.”

Example preview

File module:xyzshipping/classes/Rates.php, 18,240 -> 18,262 bytes. Backup before saving. PHP syntax: OK.
- $carrier = $params['id_carrier'];
+ $carrier = $params['id_carrier'] ?? 0;
Note: this change will be lost on the next update of xyzshipping.

Technical details

Files of an installed module: action=list (folder, optional path), read (path, from_line), edit (path + search/replace, or content). WARNING: changes to module files are LOST when the module is updated. Change a module's look with ps_override_module_template (template copy in the theme); edit module files only when it's the only way (for example a PHP bug fix), and tell the user. PHP files are syntax-checked before saving and every write is backed up. Restore: ps_restore_file_backup.

Parameters

NameTypeRequiredDescription
actionenum: list | read | edityeslist | read | edit.
modulestringyesTechnical module name.
pathstringwhen: action=read or editPath relative to the module folder (list: optional subfolder). Max 300 characters.
from_lineintegernoread: start line (400 lines per call).
searchstringnoedit: exact fragment to replace (must appear exactly once). Max 100,000 characters.
replacestringnoedit: the new fragment. Max 100,000 characters.
contentstringnoedit: whole new content (instead of search/replace). Max 500,000 characters.
confirmbooleannofalse (default) returns a preview and saves nothing. true executes, only after the user approved the preview, together with change_token.
change_tokenstringwhen: confirm=trueToken from the preview. Required with confirm=true. Valid 30 minutes, single use, bound to the previewed arguments and data state.

Limits

read: 400 lines per call, files up to 1 MB. edit: text files only (php, tpl, twig, css, js, json, yml, xml, txt, md, html, htaccess, scss, svg); fragment must appear exactly once. 20 file writes per hour, shared by all file tools (adjustable in the Settings: security, alerts, limits card). The connector's own module is off limits. Block 4, service connector only.

What you see before anything is saved

Claude first calls the tool without confirming it. The module returns a preview (current and new values) and a single-use token valid for 30 minutes. Claude shows you the preview and saves the change only after your yes.

Related tools

Use cases with this tool

Last updated: 2026-10-05