# Exclude Wiki Claude Md From Harness Line Limit Hook

> 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/.

- Skill: `vamseeachanta/exclude-wiki-claude-md-from-harness-line-limit-hook` (Agent Skill)
- Install (CLI): `npx skillmds@latest add vamseeachanta/exclude-wiki-claude-md-from-harness-line-limit-hook`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vamseeachanta/exclude-wiki-claude-md-from-harness-line-limit-hook/raw
- Safety review: PASS (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: vamseeachanta (https://skillmd.com/u/vamseeachanta)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/vamseeachanta/exclude-wiki-claude-md-from-harness-line-limit-hook

---


# 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.

