v2/src/cli/simple-commands/init/templates/commands/hooks/post-task.md
Execute post-task cleanup, performance analysis, and memory storage.
npx claude-flow hook post-task [options]
--task-id, -t <id> - Task identifier for tracking--analyze-performance - Generate performance metrics (default: true)--store-decisions - Save task decisions to memory--export-learnings - Export neural pattern learnings--generate-report - Create task completion reportnpx claude-flow hook post-task --task-id "auth-implementation"
npx claude-flow hook post-task -t "api-refactor" --analyze-performance --generate-report
npx claude-flow hook post-task -t "bug-fix-123" --store-decisions --export-learnings
npx claude-flow hook post-task -t "minor-update" --analyze-performance false
This hook is automatically called by Claude Code when:
Manual usage in agents:
# In agent coordination
npx claude-flow hook post-task --task-id "your-task-id" --analyze-performance true
Returns JSON with:
{
"taskId": "auth-implementation",
"duration": 1800000,
"tokensUsed": 45000,
"filesModified": 12,
"performanceScore": 0.92,
"learningsExported": true,
"reportPath": "/reports/task-auth-implementation.md"
}
hook pre-task - Pre-task setupperformance report - Detailed metricsmemory usage - Memory managementneural patterns - Pattern analysis