top | item 47044540

(no title)

nielstron | 13 days ago

Exactly my thoughts... the model should just auto ingest README and CONTRIBUTING when started.

discuss

order

delaminator|13 days ago

You could have claude --init create this hook and then it gets into the context at start and resume

Or create it in some other way

    {
      "hookSpecificOutput": {
        "hookEventName": "SessionStart",
        "additionalContext": "<contents of your file here>"
      }
    }
I thought it was such a good suggestion that I made this just now and made it global to inject README at startup / resume / post compact - I'll see how it works out

https://gist.github.com/lawless-m/fa5d261337dfd4b5daad4ac964...

    #!/bin/bash
    # ~/.claude/hooks/inject-readme.sh

    README="$(pwd)/README.md"

    if [ -f "$README" ]; then
      CONTENT=$(jq -Rs . < "$README")
      echo "{\"hookSpecificOutput\" :{\"hookEventName\":\"SessionStart\",\"additionalContext\":${CONTENT}}}"
      exit 0
    else
      echo "README.md not found" >&2
      exit 1
    fi
with this hook

    {
      "hooks": {
        "SessionStart": [
          {
            "matcher": "startup|clear|compact",
            "hooks": [
              {
                "type": "command",
                "command": "~/.claude/hooks/inject-readme.sh"
              }
            ]
          }
        ]
      }
    }

delaminator|13 days ago

Unlike other content - what you put in here survives compacting

rmnclmnt|13 days ago

And that makes total sense. Honestly working since a few days with Opus 4.6, it really feels like a competent coworker, but need some explicit conventions to follow … exactly when onboarding a new IC! So i think there is a bright light to be seen: this will force having proper and explicit contribution rules and conventions, both for humans and robots