Skip to content
Back to skills

Exclude Wiki Claude Md From Harness Line Limit Hook

ASecurity

Fix false-positive pre-commit failures where workspace-hub's AGENTS.md line-limit hook blocks edits to auto-generated wiki schema files under knowledge/wikis/.

  • 17 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
ai-agentsbashgit

Security analysis

A100/100

Scanned September 24, 2026

npx -y skills add vamseeachanta/workspace-hub --skill exclude-wiki-claude-md-from-harness-line-limit-hook --agent claude-code

Installs 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 with every re-scan.

Security grade badge for Exclude Wiki Claude Md From Harness Line Limit Hook
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vamseeachanta-exclude-wiki-claude-md-from-harness-line-limit-hoo/badge)](https://www.skillsdirectory.com/skills/vamseeachanta-exclude-wiki-claude-md-from-harness-line-limit-hoo)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: exclude-wiki-claude-md-from-harness-line-limit-hook
description: Fix false-positive pre-commit failures where workspace-hub's AGENTS.md line-limit hook blocks edits to auto-generated wiki schema files under knowledge/wikis/.
version: 1.0.0
author: Hermes Agent
---

# Exclude wiki AGENTS.md files from harness line-limit hook

Use this when a commit is blocked by `.Codex/hooks/check-Codex-md-limits.sh` after editing wiki-domain `AGENTS.md` files under `knowledge/wikis/`.

## Problem

Workspace-hub has a hook intended to enforce short harness adapter docs (`AGENTS.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>/AGENTS.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/**/AGENTS.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 `AGENTS.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 `AGENTS.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 `AGENTS.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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.