~ / rigs / AlexZahar / claude-code

AlexZahar/claude-code

Setup Claude Code using my workflow

↗ GitHub ★ 4 MIT updated 1.2y ago project Claude Code
share on X
ARCHETYPE
Automator
Hooks on every lifecycle event: format, lint, notify, log.
CONTEXT TAX · EVERY TURN
~11.5k tokens
Heavy · median rig: 2.3k · breakdown
GUARDRAILS
2/5
Pre-tool screening hook · No YOLO mode · details

Copy this rig

# review before running: this installs third-party code
$ npx degit AlexZahar/claude-code/commands ./rig-claude-code/commands
$ npx degit AlexZahar/claude-code/hooks ./rig-claude-code/hooks

MCP servers are added to Claude Code at local scope; env vars are shown as YOUR_… placeholders — we never store values. Files are fetched with degit into a separate folder so you can review before merging.

Merge into .claude/settings.json (project) or ~/.claude/settings.json (user). Hook commands reference scripts in the source repo — copy those too.

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Grep|Search|Glob|Read",
        "hooks": [
          {
            "type": "command",
            "command": "HOOK_TYPE=wrong-tool $HOME/.claude/serena-hooks.sh"
          }
        ]
      },
      {
        "matcher": "Edit|MultiEdit",
        "hooks": [
          {
            "type": "command",
            "command": "HOOK_TYPE=pre-edit $HOME/.claude/gemini-hooks.sh"
          },
          {
            "type": "command",
            "command": "HOOK_TYPE=pre-edit $HOME/.claude/serena-hooks.sh"
          }
        ]
      },
      {
        "matcher": "Write",
        "hooks": [
          {
            "type": "command",
            "command": "HOOK_TYPE=pre-write $HOME/.claude/gemini-hooks.sh"
          }
        ]
      },
      {
        "matcher": "WebSearch|WebFetch",
        "hooks": [
          {
            "type": "command",
            "command": "HOOK_TYPE=pre-websearch $HOME/.claude/documentation-hooks.sh"
          }
        ]
      }
    ]
  }
}

MCP servers (1)

serversourceest. tokens
multi-mcp-proxy local / custom · remote 2.5k

Hooks (15)

eventmatcherruns
SessionStart*$HOME/.claude/boardlens-dev-startup-hook-multi.sh
SessionStart*$HOME/.claude/mcp-session-hook-multi.sh
PreToolUseGrep|Search|Glob|ReadHOOK_TYPE=wrong-tool $HOME/.claude/serena-hooks.sh
PreToolUseEdit|MultiEditHOOK_TYPE=pre-edit $HOME/.claude/gemini-hooks.sh
PreToolUseEdit|MultiEditHOOK_TYPE=pre-edit $HOME/.claude/serena-hooks.sh
PreToolUseWriteHOOK_TYPE=pre-write $HOME/.claude/gemini-hooks.sh
PreToolUseWebSearch|WebFetchHOOK_TYPE=pre-websearch $HOME/.claude/documentation-hooks.sh
PostToolUseEdit|MultiEdit|Writesh -c 'if echo "$TOOL_OUTPUT" | grep -q "successfully"; then HOOK_TYPE=post-edit $HOME/.claude/gemini-hooks.sh; fi'
PostToolUseEdit|MultiEdit|Writesh -c 'FILE=$(echo "$TOOL_INPUT" | jq -r .file_path 2>/dev/null); ACTION="edited"; if echo "$TOOL_NAME" | grep -q "Write"; then ACTION="created"; fi; if [ -n "$FILE" ] && echo "$TOOL_OUTPUT" | grep -q "successfully"; then $HOME/.claude/grap
PostToolUseBashsh -c 'CMD=$(echo "$TOOL_INPUT" | jq -r .command 2>/dev/null); if echo "$CMD" | grep -qE "npm test|jest|vitest|pytest"; then HOOK_TYPE=test-run $HOME/.claude/gemini-hooks.sh; elif echo "$CMD" | grep -qE "git commit"; then HOOK_TYPE=commit $
PostToolUseBashsh -c 'CMD=$(echo "$TOOL_INPUT" | jq -r .command 2>/dev/null); EXIT_CODE=$(echo "$TOOL_OUTPUT" | grep -oE "exit code: [0-9]+" | grep -oE "[0-9]+" || echo "0"); if [ -n "$CMD" ] && ! echo "$CMD" | grep -qE "^(ls|cd|pwd|echo|cat|which|clear)(
Stop*echo "💡 Tip: Use 'gemini -p' for analysis or '~/.claude/graphiti-hook.sh search' for memories!"
Stop*$HOME/.claude/mcp-cleanup-hook-multi.sh cleanup
UserPromptSubmit/compact$HOME/.claude/compact-memory-hook.sh
UserPromptSubmit/mcp-status$HOME/.claude/multi-mcp-service.sh status

Slash commands (14)

/compact/context7-docs/gemini-analyze/gemini-architecture/gemini-deps/gemini-feature/gemini-find/gemini-help/gemini-overview/gemini-performance/gemini-review/gemini-security/recall/remember

Permissions

deny (0)
—
ask (0)
—
allow (1)
*

Similar rigs

copied ✓