gryph AGENTS.md

gryph AGENTS.md is an instructions file for Codex, OpenCode from safedep/gryph. It costs 1,030 tokens per session, scanned B, original, Apache-2.0.

Project instructions for Gryph, a Go command-line application with event, session, audit, security, storage, and agent components. They describe how to build, test, lint, and regenerate generated code.

In plain words
What is it for?
Building and testing Gryph, running its linter, regenerating code and schemas, and locating its main command-line, storage, and agent entry points.
Why use it?
They tell an agent which checks and generation steps are required after specific code changes, reducing the risk of submitting incomplete or inconsistent changes.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/safedep/gryph/agents-md
Clone the repo
git clone --depth 1 https://github.com/safedep/gryph

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gryph AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/safedep/gryph/agents-md.svg)](https://agentmods.dev/instructions/safedep/gryph/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/safedep/gryph/agents-md"><img src="https://agentmods.dev/badge/instructions/safedep/gryph/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,030 This file is loaded in full into every session.
When invoked 1,030 The same file — it is already loaded in full.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01030 $0.01030
Opus 5 $0.00515 $0.00515
Sonnet 5 $0.00206 $0.00206
Haiku 4.5 $0.00103 $0.00103

Measured 4d ago against content hash 6f7189e48213, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

gryph AGENTS.md scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- Hooks configured in `~/.claude/settings.json` (per official docs)
AGENTS.md · 92 lines

How it starts

The opening of the file, as written. The whole thing — 92 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Gryph

Build

make deps      # Install dependencies
make generate  # Generate ent code
make gryph     # Build binary
make test      # Run tests
make lint      # Run linter (golangci-lint)

Always run make lint before submitting changes to catch issues early.

When modifying the Event model (core/events/event.go) or any payload types, run make generate-schema.

Architecture

core/           Domain models (events, sessions, audit, security) - most stable
config/         Viper-based configuration
storage/        SQLite + ent ORM
agent/          Adapter pattern (claudecode/, cursor/ and more)
cli/            Cobra commands as an App pattern
tui/            Output formatters (table, json, csv)

Key Entry Points

  • cmd/gryph/main.go - Entry point
  • cli/root.go - App struct, dependency injection
  • agent/adapter.go - Agent adapter interface
  • storage/storage.go - Store interface

Notes

  • SQLite driver: modernc.org/sqlite (pure Go, uses sqlite not sqlite3)
  • Config paths: macOS ~/Library/Application Support/safedep/gryph/, Linux ~/.config/safedep/gryph/. Overrides: GRYPH_CONFIG_DIR, GRYPH_DATA_DIR, GRYPH_CACHE_DIR
  • Storage layer fully implemented with ent ORM
  • Self-audit logs tool actions (install, uninstall, config changes)

Hook Implementation

Claude Code

  • Hooks configured in ~/.claude/settings.json (per official docs)
  • Hook types: PreToolUse, PostToolUse, PostToolUseFailure, SessionStart, SessionEnd, Notification
  • Uses matcher pattern "*" for tool hooks to capture all tools
  • Version detection via claude -v command

Cursor

  • Hooks configured in ~/.cursor/hooks.json
  • Hook types: beforeSubmitPrompt, beforeShellExecution, beforeMCPExecution, beforeReadFile, afterFileEdit, stop

Session Tracking

  • SessionID: Deterministic UUID derived from agent's session_id using uuid.NewSHA1(uuid.NameSpaceOID, []byte(agentSessionID))
  • AgentSessionID: Original session ID string from the agent, stored for correlation with agent's own storage (e.g., Claude Code transcripts)
  • Sessions are created on first event and updated on subsequent events
  • Session end detected from SessionEnd (Claude Code) or stop (Cursor) hook types

Read the full file on GitHub · 92 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 92 lines · 1,030 tokens per session scan B 6f7189e48213

Subscribe to this mod's changes

gryph AGENTS.md is an instructions file published in the GitHub repository safedep/gryph (161 stars, last pushed 4d ago), licensed Apache-2.0. It adds 1,030 tokens to every session, about $0.0052 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.