agentleFS
quantsquirrelquantsquirrel/claude-forge-smith/hooks/AGENTS.md

claude-forge-smith / hooks

AGENTS.md2 starsChanged 10 months agoMITView on GitHub

Claude Code hook scripts that integrate Forge into the tool lifecycle. Implements lazy detection (only scanning on Write/Edit), session management, and skill usage tracking.

  • Reads credentials

The file

We split this AGENTS.md into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All hooks must output valid JSON: {"continue": true} or {"continue": false}

    line 30
  2. Very specific:

    Use debug_log for stderr logging when SKILL_EVAL_DEBUG=true

    line 32
  3. Distinctive:

    Test hooks with sample JSON input via stdin

    line 36
  4. Distinctive:

    Verify JSON output format

    line 37
  5. Distinctive:

    Check exit codes (0 for success)

    line 38

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md
<!-- Parent: ../AGENTS.md --><!-- Generated: 2026-01-31 | Updated: 2026-01-31 -->

hooks

Purpose

Claude Code hook scripts that integrate Forge into the tool lifecycle. Implements lazy detection (only scanning on Write/Edit), session management, and skill usage tracking.

Key Files

FileDescription
pre-tool.shPreToolUse hook - records skill invocation start time
post-tool.shPostToolUse hook - records skill completion and metrics
session-start.shSession initialization hook
session-stop.shSession cleanup hook
user-prompt.shUser prompt submission hook

Subdirectories

DirectoryPurpose
lib/Shared shell library functions (see lib/AGENTS.md)

For AI Agents

Working In This Directory

  • All hooks must output valid JSON: {"continue": true} or {"continue": false}
  • Source lib/common.sh at the top of each hook
  • Use debug_log for stderr logging when SKILL_EVAL_DEBUG=true

Testing Requirements

  • Test hooks with sample JSON input via stdin
  • Verify JSON output format
  • Check exit codes (0 for success)

Common Patterns

#!/bin/bash
source "$(dirname "$0")/lib/common.sh"
INPUT=$(cat)
# ... process INPUT ...
echo '{"continue": true}'

Dependencies

Internal

  • lib/ - All shared functions
  • ../config/settings.env - Configuration values

External

  • jq - JSON processing (optional, fallback to grep/sed)
  • date - Timestamp generation
<!-- MANUAL: -->

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.