v2/src/cli/simple-commands/init/templates/commands/hooks/post-edit.md
Execute post-edit processing including formatting, validation, and memory updates.
npx claude-flow hook post-edit [options]
--file, -f <path> - File path that was edited--auto-format - Automatically format code (default: true)--memory-key, -m <key> - Store edit context in memory--train-patterns - Train neural patterns from edit--validate-output - Validate edited filenpx claude-flow hook post-edit --file "src/components/Button.jsx"
npx claude-flow hook post-edit -f "api/auth.js" --memory-key "auth/login-implementation"
npx claude-flow hook post-edit -f "config/webpack.js" --auto-format --validate-output
npx claude-flow hook post-edit -f "utils/helpers.ts" --train-patterns --memory-key "utils/refactor"
This hook is automatically called by Claude Code when:
Manual usage in agents:
# After editing files
npx claude-flow hook post-edit --file "path/to/edited.js" --memory-key "feature/step1"
Returns JSON with:
{
"file": "src/components/Button.jsx",
"formatted": true,
"formatterUsed": "prettier",
"lintPassed": true,
"memorySaved": "component/button-refactor",
"patternsTrained": 3,
"warnings": [],
"stats": {
"linesChanged": 45,
"charactersAdded": 234
}
}
hook pre-edit - Pre-edit preparationEdit - File editing toolmemory usage - Memory managementneural train - Pattern training