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.zipInstalls 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 EditingKey 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
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
- Check if expected directories exist:
ls -la .claude/cache/ - Check if expected files were created:
ls -la .claude/cache/learnings/ - Check logs for errors:
tail .claude/cache/*.log - Run the failing command manually to see actual error
- 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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| observe-before-editing (this skill) | 2 | 7mo | No flags | Beginner |
| python-testing-patterns | 77 | 2mo | Review | Intermediate |
| error-handling-patterns | 35 | 2mo | No flags | Intermediate |
| codex-claude-loop | 13 | 9mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by parcadei
View all by parcadei →You might also like
python-testing-patterns
wshobson
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.
error-handling-patterns
wshobson
Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.
codex-claude-loop
bear2u
Orchestrates a dual-AI engineering loop where Claude Code plans and implements, while Codex validates and reviews, with continuous feedback for optimal code quality
serena
massgen
This skill provides symbol-level code understanding and navigation using Language Server Protocol (LSP). Enables IDE-like capabilities for finding symbols, tracking references, and making precise code edits at the symbol level.
javascript-mastery
davila7
Comprehensive JavaScript reference covering 33+ essential concepts every developer should know. From fundamentals like primitives and closures to advanced patterns like async/await and functional programming. Use when explaining JS concepts, debugging JavaScript issues, or teaching JavaScript fundamentals.
find-bugs
davila7
Find bugs, security vulnerabilities, and code quality issues in local branch changes. Use when asked to review changes, find bugs, security review, or audit code on the current branch.