Restores the entire .claude/ infrastructure that was accidentally deleted
in commit 1df208d ('feat(timeline): add pulse animation for in-flight drag
mutations'). Recovered via git checkout 1df208d^.
Restored:
- .claude/commands/ (gitlooper, sparc/, github/, automation/, monitoring/,
optimization/, hooks/, plan, implement, research, review, perf, visualaudit)
- .claude/agents/ (core/, github/, sparc/, v3/, swarm/, templates/, ...)
- .claude/helpers/ (41 scripts incl. hook-handler.cjs, statusline.cjs)
- .claude/skills/ (20 skills incl. sparc-methodology, github-*, v3-*)
- .claude/settings.json (hooks configuration)
Also updated all CapaKraken → Nexus references in affected command files.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2.2 KiB
2.2 KiB
hook post-edit
Execute post-edit processing including formatting, validation, and memory updates.
Usage
npx claude-flow hook post-edit [options]
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 file
Examples
Basic post-edit hook
npx claude-flow hook post-edit --file "src/components/Button.jsx"
With memory storage
npx claude-flow hook post-edit -f "api/auth.js" --memory-key "auth/login-implementation"
Format and validate
npx claude-flow hook post-edit -f "config/webpack.js" --auto-format --validate-output
Neural training
npx claude-flow hook post-edit -f "utils/helpers.ts" --train-patterns --memory-key "utils/refactor"
Features
Auto Formatting
- Language-specific formatters
- Prettier for JS/TS/JSON
- Black for Python
- gofmt for Go
- Maintains consistency
Memory Storage
- Saves edit context
- Records decisions made
- Tracks implementation details
- Enables knowledge sharing
Pattern Training
- Learns from successful edits
- Improves future suggestions
- Adapts to coding style
- Enhances coordination
Output Validation
- Checks syntax correctness
- Runs linting rules
- Validates formatting
- Ensures quality
Integration
This hook is automatically called by Claude Code when:
- After Edit tool completes
- Following MultiEdit operations
- During file saves
- After code generation
Manual usage in agents:
# After editing files
npx claude-flow hook post-edit --file "path/to/edited.js" --memory-key "feature/step1"
Output
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
}
}
See Also
hook pre-edit- Pre-edit preparationEdit- File editing toolmemory usage- Memory managementneural train- Pattern training