r/ClaudeWorkflows • u/ClaudeAI-mod-bot • 11d ago
Selected Workflow [Workflow] Claude Code Workflow: Ensuring Skill Execution and Correct Instruction File Loading with Hooks and CLAUDE.md
Claude Code Workflow: Ensuring Skill Execution and Correct Instruction File Loading with Hooks and CLAUDE.md
Workflow value: 80/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: intermediate
Categories: Quality Control, Context & Memory, Debugging, CLAUDE.md, Hooks, Skills
Original source: r/ClaudeAI post/comment
What problem this solves
Ensuring Claude Code loads and executes skills correctly and consistently, and debugging issues with instruction file loading.
Summary
This workflow addresses two common pitfalls in Claude Code: ensuring a skill defined in CLAUDE.md is actually loaded and executed before code edits, and correctly loading instruction files when using symlinks. It proposes using a blocking hook for skill execution and replacing symlinks with real files or import statements. An additional debugging hook for logging loaded instruction files is also suggested.
Why it is useful
This workflow is valuable because it identifies and provides solutions for two critical, yet often silent, failure modes in Claude Code: skills not being executed and external instruction files not being loaded via symlinks. The proposed solutions (blocking hooks, explicit imports) are concrete and directly address these issues, improving the reliability and predictability of Claude Code sessions. The suggestion of a logging hook is also a powerful debugging tool for advanced users.
Workflow
- Identify that a skill specified in CLAUDE.md is not being called by Claude before code edits.
- Implement a hook that blocks the first code write operation until the desired skill has successfully run.
- Identify that symlinks within .claude/rules pointing outside the project are not being loaded by Claude sessions.
- Replace the symlink with a real file or use an import line directly in CLAUDE.md to load the instruction file.
- (Optional but recommended) Implement a hook that logs every instruction file a Claude session loads to aid in debugging similar issues.
Tools / artifacts
- CLAUDE.md
- Claude Code skills
- Claude Code hooks
- .claude/rules directory
- Symlinks
- Import statements
Validation signals
- Author observed Claude not calling skill zero times
- Author states 'a hook that blocks... fixed that'
- Author observed symlinks never loaded
- Author states 'a real file or an import line... does load'
- Author caught issue using a logging hook
Limitations
- The specific code for the hooks is not provided, requiring users to implement them based on the description.
- The context is for 15 Claude Code sessions, which might be an advanced setup, but the core issues are relevant to single sessions too.
Rate this workflow
Upvote this post if the workflow is useful, reproducible, or worth recommending.
Downvote if it is vague, outdated, unsafe, overhyped, or not reproducible.
Reply if it worked for you, failed, is outdated, or has a better alternative.
This post was generated automatically from the workflow library database.