Fix false-positive pre-commit failures where workspace-hub's CLAUDE.md line-limit hook blocks edits to auto-generated wiki schema files under knowledge/wikis/.
Scanned 9/9/2026
Install to Claude Code
npx -y skills add vamseeachanta/workspace-hub --skill exclude-wiki-claude-md-from-harness-line-limit-hook --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Exclude Wiki Claude Md From Harness Line Limit Hook?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/vamseeachanta-exclude-wiki-claude-md-from-harness-line-limit-hoo-workspace-hub)More formats (shields.io, HTML) on the badges page.
---
name: exclude-wiki-claude-md-from-harness-line-limit-hook
description: Fix false-positive pre-commit failures where workspace-hub's CLAUDE.md line-limit hook blocks edits to auto-generated wiki schema files under knowledge/wikis/.
version: 1.0.0
author: Hermes Agent
---
# Exclude wiki CLAUDE.md files from harness line-limit hook
Use this when a commit is blocked by `.claude/hooks/check-claude-md-limits.sh` after editing wiki-domain `CLAUDE.md` files under `knowledge/wikis/`.
## Problem
Workspace-hub has a hook intended to enforce short harness adapter docs (`CLAUDE.md`, `AGENTS.md`, etc.).
The hook pattern is too broad and also matches wiki schema/config files generated by `llm-wiki init`, which are often ~90+ lines.
Typical symptom:
- a commit touching `knowledge/wikis/<domain>/CLAUDE.md` fails even for a tiny valid edit
- the hook treats those files like top-level harness adapter files with a strict line cap
## Root cause
In `.claude/hooks/check-claude-md-limits.sh`, the staged-file filter matches all `CLAUDE.md` paths:
```bash
HARNESS_PATTERN='(^|/)?(CLAUDE|MEMORY|AGENTS|GEMINI)\.md$'
STAGED=$(git diff --cached --name-only --diff-filter=ACMR 2>/dev/null | grep -E "$HARNESS_PATTERN" || true)
```
That unintentionally includes `knowledge/wikis/**/CLAUDE.md`.
## Minimal safe fix
Exclude wiki-generated CLAUDE files from the staged-file set:
```bash
STAGED=$(git diff --cached --name-only --diff-filter=ACMR 2>/dev/null | grep -E "$HARNESS_PATTERN" | grep -v '^knowledge/wikis/' || true)
```
## When this fix is appropriate
Apply it when:
1. the blocked files are under `knowledge/wikis/`
2. they are wiki schema/config files, not harness adapter files
3. the commit only needs normal wiki-context updates (for example adding architecture context links)
Do NOT apply this as a blanket exemption for unrelated `CLAUDE.md` files elsewhere.
## Recommended workflow
1. Confirm the blocked files are only wiki CLAUDE files.
2. Check what is already staged with `git diff --cached --name-only`.
3. Patch `.claude/hooks/check-claude-md-limits.sh` with the exclusion above.
4. Commit carefully:
- if the wiki files are already staged from the failed attempt, the hook-fix commit may also include those files unless you unstage them first
- if you want two separate commits, run `git restore --staged <wiki-files>` before committing the hook fix
- if a bundled commit is acceptable, document that the hook fix and blocked wiki-file cleanup landed together
5. Re-run or finish the intended commit/push flow as needed.
6. Post a short GitHub follow-up comment if the cleanup was tied to a closed issue.
## Why this is reusable
This is not a one-off content bug; it is a structural mismatch between:
- short harness adapter docs
- long wiki schema/config docs generated under `knowledge/wikis/`
Any future edits to wiki `CLAUDE.md` files can hit the same false positive unless the hook excludes them.
## Example outcome
This fix was used successfully when closing residual work from #2104, where two wiki `CLAUDE.md` files already had the correct architecture-context lines in the working tree but could not be committed because of the false-positive line-limit hook.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!