Skip to content

feat: add Claude Code hooks integration#13

Open
nandanugg wants to merge 6 commits intocortexkit:mainfrom
nandanugg:feat/claude-code-hooks
Open

feat: add Claude Code hooks integration#13
nandanugg wants to merge 6 commits intocortexkit:mainfrom
nandanugg:feat/claude-code-hooks

Conversation

@nandanugg
Copy link
Copy Markdown

Summary

  • Add install/uninstall scripts for Claude Code hooks integration
  • Tool interception routes Read, Grep, Glob through AFT for indexed performance
  • CLI wrapper provides semantic commands (outline, zoom, call_tree, callers, impact, trace_to)
  • Global AFT.md instructions teach Claude to use AFT for 60-90% context savings

Installation

./scripts/install-claude-hooks.sh

Test plan

  • Install script is idempotent (safe to run multiple times)
  • All semantic commands work (outline, zoom, call_tree, callers, impact, trace_to)
  • Hook interception works for Read, Grep, Glob tools
  • Test on fresh system without existing Claude Code config

🤖 Generated with Claude Code

ualtinok and others added 6 commits April 16, 2026 15:39
Add install/uninstall scripts that set up AFT hooks for Claude Code:
- Tool interception for Read, Grep, Glob via PreToolUse hooks
- CLI wrapper for semantic commands (outline, zoom, call_tree, callers, etc.)
- Global AFT.md instructions so Claude learns to use AFT for context savings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add MANDATORY section emphasizing AFT-first approach
- Add Decision Tree for quick command selection
- Rename "Best Practices" to "Rules (NOT suggestions)"
- Add Context Protection section to prevent context exhaustion
- Clarify that AFT applies to all file types, not just code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add prominent "AFT applies to ALL file types" note in MANDATORY section
- Change "Before ANY code exploration" to "Before reading ANY files"
- Add docs/config example to decision tree
- Add new row for docs/configs in "When to Use What" table
- Add rule cortexkit#6: "ALWAYS outline before sampling"

Addresses feedback that code-centric language caused AFT to be skipped
for markdown/documentation files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove Read from hooked tools list (conflicts with Edit validation)
- Add guidance to use `aft read` via Bash for indexed reads
- Add warning: use native Read tool when editing is needed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Subagents don't follow ordering guarantees, so leaving "outline first"
as a mid-step instruction doesn't work. Run outline yourself and
include the output in the subagent prompt.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

2 participants