claude-code - 💡(How to fix) Fix [Feature Request] Pre-task gate: enforce skill/context read before coding [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46232Fetched 2026-04-11 06:25:39
View on GitHub
Comments
1
Participants
1
Timeline
6
Reactions
0
Participants
Timeline (top)
labeled ×4closed ×1commented ×1

Follow-up to #45738 (Pattern 2: never uses skills) and #45731.

Claude Code has custom skills (SKILL.md files) that encode exact checklists for specific task types (formal proofs, code review, PR creation, audits). Despite being available, Opus never reads them voluntarily before starting work. When reminded, reads once, then stops.

Root Cause

Over months of daily usage, document-level rules ("read the skill before starting") have 0% voluntary compliance rate. Hook-level enforcement (pre-commit checks) has 100% catch rate. The gap between these two is the core problem described in #45738.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single report
  • I am using the latest version of Claude Code

Summary

Follow-up to #45738 (Pattern 2: never uses skills) and #45731.

Claude Code has custom skills (SKILL.md files) that encode exact checklists for specific task types (formal proofs, code review, PR creation, audits). Despite being available, Opus never reads them voluntarily before starting work. When reminded, reads once, then stops.

Proposed Solution

A pre-task gate mechanism that:

  1. Before any file write/commit, checks if a relevant skill was read in the current session
  2. Creates a verifiable stamp (not just empty touch — content verified)
  3. Pre-commit hook checks stamp exists and is fresh (< 2 hours)
  4. git fetch origin must have run within 60s of stamp creation (prevents stale baseline)

This converts a document-level rule into infrastructure enforcement — the only pattern that works in practice.

Why This Matters

Over months of daily usage, document-level rules ("read the skill before starting") have 0% voluntary compliance rate. Hook-level enforcement (pre-commit checks) has 100% catch rate. The gap between these two is the core problem described in #45738.

Environment

  • Claude Code CLI (latest)
  • Model: Claude Opus (Max plan)
  • macOS

extent analysis

TL;DR

Implement a pre-task gate mechanism with a pre-commit hook to enforce reading of relevant skills before starting work.

Guidance

  • Introduce a pre-commit hook that checks for a verifiable stamp indicating a relevant skill was read in the current session.
  • Ensure the stamp is content-verified and has a limited validity period (e.g., < 2 hours).
  • Modify the pre-commit hook to also verify that git fetch origin has run within a short time frame (e.g., 60s) of stamp creation.
  • Consider integrating the proposed solution into the Claude Code CLI to automate the enforcement of skill reading.

Example

No explicit code example is provided due to the lack of specific implementation details in the issue.

Notes

The proposed solution relies on the effectiveness of hook-level enforcement, which has shown a 100% catch rate in the past. However, the implementation details of the pre-commit hook and verifiable stamp are not specified and may require additional development.

Recommendation

Apply workaround: Implement the proposed pre-task gate mechanism with a pre-commit hook to enforce reading of relevant skills before starting work. This approach has shown to be effective in the past and can help address the core problem described in the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING