Skip to content
Back to skills

Setup Observability

ASecurity

Enable tool call logging for harness optimization. Installs observe.py hook writing tool metadata to .claude/logs/. Tier 3 opt-in. Trigger phrases: "setup observability", "enable tool logging", "track tool usage", "observe tool calls".

  • 10 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added August 31, 2026
developmentpythonshellbashgit

Works with

  • terminal

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned August 31, 2026

npx -y skills add ShipWithAI/shipwithai-plugins --skill setup-observability --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Setup Observability?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Setup Observability
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/shipwithai-setup-observability/badge)](https://www.skillsdirectory.com/skills/shipwithai-setup-observability)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: setup-observability
description: >
  Enable tool call logging for harness optimization. Installs observe.py hook
  writing tool metadata to .claude/logs/. Tier 3 opt-in.
  Trigger phrases: "setup observability", "enable tool logging", "track tool usage",
  "observe tool calls".
argument-hint: "[--disable]"
---

# /setup-observability

Installs a lightweight logging hook that records tool call metadata.
Logs feed future harness analysis tooling (coming in a later phase).

## What gets logged

Only metadata — never content:

| Tool  | Logged                        | NOT logged                        |
|-------|-------------------------------|-----------------------------------|
| Edit  | Relative file path            | File content, old/new string      |
| Write | Relative file path            | File content                      |
| Bash  | Command name (argv[0] only)   | Arguments, output, exit code      |

One line per call: `.claude/logs/YYYY-MM-DD.jsonl`

Opt-out anytime: `export DISABLE_OBSERVE=1` in terminal or shell profile.

## Mode Detection

```
--disable flag    → reverse setup (see --disable Flow below)
No args           → run setup flow
```

## Setup Steps

1. Copy `observe.py` from plugin assets to `.claude/hooks/observe.py`
2. Merge PostToolUse hook into `.claude/settings.json` — matcher `Edit|Write|Bash`
3. Merge Stop hook (log rotation) into `.claude/settings.json`
4. Add `.claude/logs/` to `.gitignore` (skip if already present)
5. Check `git ls-files .claude/logs` — warn user if currently tracked
6. Update `starter-context.json` → `observability.enabled: true`

## Output Format

Preview before writing:

```
Observability setup:
  .claude/hooks/observe.py         CREATE
  .claude/settings.json (hook)     UPDATE — add PostToolUse + Stop entries
  .gitignore                       UPDATE — add .claude/logs/

Logs will be written to: .claude/logs/YYYY-MM-DD.jsonl
Opt-out: export DISABLE_OBSERVE=1

Proceed?
```

After writing:
```
✅ Observability enabled.
Logs: .claude/logs/ (excluded from git)
Disable anytime: export DISABLE_OBSERVE=1
Logs will feed harness analysis tooling (coming in a future phase).
```

## settings.json Hook Entries

PostToolUse entry to add:
```json
{
  "matcher": "Edit|Write|Bash",
  "hooks": [{"type": "command", "command": "python3 .claude/hooks/observe.py"}]
}
```

Stop entry to add:
```json
{
  "hooks": [{"type": "command", "command": "find .claude/logs -name '*.jsonl' -mtime +30 -delete 2>/dev/null || true"}]
}
```

## Write Rules

- Read `settings.json` before writing — merge into existing structure, never overwrite
- Check `hooks.PostToolUse` for matcher `Edit|Write|Bash` — skip if already present (idempotent)
- Check `hooks.Stop` for rotation command — skip if already present (idempotent)
- Check `.gitignore` for `.claude/logs/` — skip line if already present
- Never proceed without user confirmation of the preview

## --disable Flow

1. Remove PostToolUse hook entry with matcher `Edit|Write|Bash` from `settings.json`
2. Remove Stop hook rotation entry from `settings.json`
3. Delete `.claude/hooks/observe.py`
4. Update `starter-context.json` → `observability.enabled: false`
5. Report: "Observability disabled. Existing logs at `.claude/logs/` preserved — delete manually if not needed."

Files in this skill

  • SKILL.md3.2 KB
  • evals.json1.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.