Verify command execution results before proceeding to ensure successful state transitions and catch errors early.
Verify Command Execution
When executing commands that change system state (like navigation, file creation, or configuration changes), always verify the result before proceeding to the next instruction.
Why This Matters
State transition commands can fail silently or partially. Verification ensures:
You're actually in the state you expect
Errors are caught immediately, not downstream
Your workflow remains accurate and reliable
Steps
Execute the state-changing command (e.g., cd /path, mkdir folder, export VAR=value)
Run a verification command to confirm the state changed as expected
Check the output matches your intention
Only then proceed to the next instruction
Common Verification Examples
Command
Verify With
cd /some/path
pwd
mkdir new-dir
ls -la or test -d new-dir && echo "exists"
export VAR=value
echo $VAR
git checkout branch
git branch --show-current
apt install package
which package or package --version
Pro Tips
Use verification commands that are fast and produce clear output
Don't assume success—always verify
This adds minimal overhead but saves significant debugging time
Works especially well when chaining multiple commands
1---2name: verify-command-execution3description: verify-command-execution4---5# verify-command-execution67Verify command execution results before proceeding to ensure successful state transitions and catch errors early.89# Verify Command Execution1011When executing commands that change system state (like navigation, file creation, or configuration changes), always verify the result before proceeding to the next instruction.1213## Why This Matters1415State transition commands can fail silently or partially. Verification ensures:16- You're actually in the state you expect17- Errors are caught immediately, not downstream18- Your workflow remains accurate and reliable1920## Steps21221. **Execute the state-changing command** (e.g., `cd /path`, `mkdir folder`, `export VAR=value`)232. **Run a verification command** to confirm the state changed as expected243. **Check the output** matches your intention254. **Only then proceed** to the next instruction2627## Common Verification Examples2829| Command | Verify With |30|---------|------------|31| `cd /some/path` | `pwd` |32| `mkdir new-dir` | `ls -la` or `test -d new-dir && echo "exists"` |33| `export VAR=value` | `echo $VAR` |34| `git checkout branch` | `git branch --show-current` |35| `apt install package` | `which package` or `package --version` |3637## Pro Tips3839- Use verification commands that are fast and produce clear output40- Don't assume success—always verify41- This adds minimal overhead but saves significant debugging time42- Works especially well when chaining multiple commands
Run npx skillmds@latest add claudiawong522/verify-command-execution in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
verify-command-execution It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: docs only. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
claudiawong522 (@claudiawong522) published this skill. Their other Agent Skills are listed on their SkillMD profile.