Self-hosted workflows for coding-agent delivery. Orchestrate CodeBuddy, Codex and Claude Code with scripts and human approval gates. Includes Local workflows for coding assistants.
JavaScript agent-orchestrationagentic-workflowai-agentsai-codingclaude-codecode-reviewcodebuddycodexcoding-agentscursordeveloper-toolshuman-on-the-loopllmmcpmulti-agentsdlcself-hostedsopworkflow-automationworkflow-engine
name: agent-observability description: Add or maintain CodeBuddy hook observability for projects that need local metrics for tool latency, transcript token usage, session cost, and multi-agent trace attribution. Use when wiring hook-based telemetry, and debugging missing usage events.
Workflow
- Merge
templates/settings-hook.jsoninto the user or projectsettings.json. - Keep hook entries command-only and keep timeouts around 5 to 10 seconds.
- Run a normal CodeBuddy session and inspect
logs/metrics.ndjson. - Inspect
logs/.state.jsonwhen usage replay or offsets look wrong. - Keep the runtime generic and verify output from
metrics.ndjsonand.state.json.
Read Next
- Read
references/quickstart.mdfor setup and smoke-test steps. - Read
references/schema-v2.mdwhen you need field definitions or sidecar state shape.
Key Files
scripts/main.py: hook entrypoint forsession-start,user-prompt-submit,pre,post, andstopscripts/run_hook.sh: stable shell wrapper for CodeBuddy hook commandsscripts/core/collector.py: transcript parsing, pre/post pairing, and session usage recordingscripts/core/state.py: persisted hook state, offsets, and pending tool eventsscripts/core/devflow.py: optional devflow-awareness — detects amulti-agents-devflow-*team, readsworkflow-state.json, and emitsstage_transitionevents. No-ops entirely on non-devflow projects.templates/settings-hook.json: hook wiring template
Output Contract
- Always emit
event,sid, andts. - Emit
toolfor per-call latency andusagefor transcript-derived token and cost events. - Emit
stopfor end-of-session flush. - Never block the main hook flow; hook exits must stay
0.