Index of every page on this site: llms.txt
All skills
tencent avatar

/agent-observability

@5fadefc
by tencenttencent/loopforge5.2k stars
722
Run it yourself

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.

  • 30 files
  • 398.7 KB
  • Updated 3 weeks ago
  • GitHub
Use this Skill: https://skilld.dev/gh/tencent/loopforge/agent-observability

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈67 tokens for metadata: the name and description. ≈365 when used: this file. ≈6.4k more on demand in 4 files.

Description uses 3.4% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈268 characters, or 3.4%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Workflow

  1. Merge templates/settings-hook.json into the user or project settings.json.
  2. Keep hook entries command-only and keep timeouts around 5 to 10 seconds.
  3. Run a normal CodeBuddy session and inspect logs/metrics.ndjson.
  4. Inspect logs/.state.json when usage replay or offsets look wrong.
  5. Keep the runtime generic and verify output from metrics.ndjson and .state.json.

Read Next

  • Read references/quickstart.md for setup and smoke-test steps.
  • Read references/schema-v2.md when you need field definitions or sidecar state shape.

Key Files

  • scripts/main.py: hook entrypoint for session-start, user-prompt-submit, pre, post, and stop
  • scripts/run_hook.sh: stable shell wrapper for CodeBuddy hook commands
  • scripts/core/collector.py: transcript parsing, pre/post pairing, and session usage recording
  • scripts/core/state.py: persisted hook state, offsets, and pending tool events
  • scripts/core/devflow.py: optional devflow-awareness — detects a multi-agents-devflow-* team, reads workflow-state.json, and emits stage_transition events. No-ops entirely on non-devflow projects.
  • templates/settings-hook.json: hook wiring template

Output Contract

  • Always emit event, sid, and ts.
  • Emit tool for per-call latency and usage for transcript-derived token and cost events.
  • Emit stop for end-of-session flush.
  • Never block the main hook flow; hook exits must stay 0.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 5fadefc. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 17 hours ago.

Activeupdated 3 weeks ago

README badge

README badge for tencent/loopforge/agent-observability