OB

observe-before-editing

A safety pattern to verify logs and file outputs before modifying code.

Install

mkdir -p .claude/skills/observe-before-editing && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2359" && unzip -o skill.zip -d .claude/skills/observe-before-editing && rm skill.zip

Installs to .claude/skills/observe-before-editing

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Observe Before Editing
22 charsno explicit “when” trigger
Beginner

Key capabilities

  • Validates system state before code modification
  • Checks directory and file existence in cache
  • Inspects logs for runtime errors
  • Executes failing commands to confirm behavior

How it works

It enforces a mandatory observation phase where logs and output files are checked to confirm the actual system state before any edits.

Inputs & outputs

You give it
System logs and file paths
You get back
Verification of system state and error confirmation

When to use observe-before-editing

  • Verifying if a bug is fixed
  • Checking log output for specific errors
  • Confirming file existence in cache
  • Validating system output against expectations

About this skill

Observe Before Editing

Before editing code to fix a bug, confirm what the system actually produced.

Pattern

Outputs don't lie. Code might. Check outputs first.

DO

  1. Check if expected directories exist: ls -la .claude/cache/
  2. Check if expected files were created: ls -la .claude/cache/learnings/
  3. Check logs for errors: tail .claude/cache/*.log
  4. Run the failing command manually to see actual error
  5. Only then edit code

DON'T

  • Assume "hook didn't run" without checking outputs
  • Edit code based on what you think should happen
  • Confuse global vs project paths (check both: .claude/ and ~/.claude/)

Source Sessions

  • a541f08a: Token limit error was invisible until manual run revealed it
  • 6a9f2d7a: Looked in wrong cache path (~/.claude/ vs .claude/), assumed hook failure
  • a8bd5cea: Confirmed hook worked by finding output files in project cache
  • 1c21e6c8: Verified Artifact Index indexing by checking DB file exists

When not to use it

  • When the system state is already verified
  • When no code changes are planned

Limitations

  • Requires manual verification of paths
  • Limited to checking existing logs and cache

How it compares

It prevents faulty edits by prioritizing empirical evidence from logs over assumptions about code behavior.

Compared to similar skills

observe-before-editing side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
observe-before-editing (this skill)27moNo flagsBeginner
python-testing-patterns772moReviewIntermediate
error-handling-patterns352moNo flagsIntermediate
codex-claude-loop139moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

Search skills

Search the agent skills registry