Skip to content

fix(ape): read the prompt from the hook JSON and inject the spec once per session - #459

Open
chrysa wants to merge 1 commit into
developfrom
fix/ape-hook-json-stdin
Open

chrysa wants to merge 1 commit into
developfrom
fix/ape-hook-json-stdin

Conversation

@chrysa

@chrysa chrysa commented Oct 17, 2026

Copy link
Copy Markdown
Owner

The APE hook read stdin as plain text, but Claude Code sends JSON, so the triage never matched and every prompt, even "ok", got the full spec (~1.2k tokens) injected, which stays in the context. Now: the prompt is read from the JSON, trivial / technical / short follow-up prompts get nothing, the first prompt that needs APE gets the compact block of the spec (~230 tokens) once per session, later ones a one-line reminder. Fail-open kept. Source: claude-config .claude/ape.

@guardrails

guardrails Bot commented Oct 17, 2026

Copy link
Copy Markdown

⚠️ We detected 1 security issue in this pull request:

Insecure Use of Crypto (1)
Severity Details Docs
Low Title: Insecure hash functions
digest = hashlib.sha1(session_id.encode("utf-8")).hexdigest()[:16]
📚

More info on how to fix Insecure Use of Crypto in Python.


👉 Go to the dashboard for detailed results.

📥 Happy? Share your feedback with us.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant