Hopet: Instructions file for Codex

AGENTS.md

Hopet AGENTS.md is an instructions file for Codex, OpenCode from BinaryFroggy/Hopet. It costs 3,103 tokens per session, scanned A, original, MIT.

A project instruction document for AI coding agents working on Hopet, a macOS desktop AI-pet application written in Swift.

In plain words
What is it for?
Use it to guide changes in the Hopet app and its command-line tool, including state management, interprocess communication, hooks, interface components, themes, and Swift package structure.
Why use it?
It gives agents a shared source of rules for the project’s architecture, documentation, code organization, naming, and visibility.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions CLAUDE.md; names the AskUserQuestion tool; mentions Claude Code.

This is BinaryFroggy/Hopet's own configuration. It tells Codex and OpenCode how to work on Hopet itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Hopet configures →

Reuse

Borrowing it

Nothing to install: this file belongs to BinaryFroggy/Hopet. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/BinaryFroggy/Hopet/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/BinaryFroggy/Hopet

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 Hopet AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/binaryfroggy/hopet/agents-md/github.svg)](https://agentmods.dev/instructions/binaryfroggy/hopet/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/binaryfroggy/hopet/agents-md"><img src="https://agentmods.dev/badge/instructions/binaryfroggy/hopet/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Hopet AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/binaryfroggy/hopet/agents-md"><img src="https://agentmods.dev/badge/instructions/binaryfroggy/hopet/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,103 This file is loaded in full into every session.
When invoked 3,103 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.03103 $0.03103
Opus 5.5 $0.01241 $0.01241
Sonnet 5.5 $0.00621 $0.00621
Haiku 4.5 $0.00310 $0.00310

Measured 1mo ago against content hash 6c387c501f01, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

Hopet AGENTS.md scanned grade A with 0 findings 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 1mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 212 lines

How it starts

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

Hopet · Agent 协作规范

本文件是 Hopet 仓库面向 AI 编码 agent(Claude Code / Codex CLI 等)的唯一权威规范。CLAUDE.md 通过 @AGENTS.md 引用本文件,规则改动只在本文件进行。

0. 项目

macOS 桌面 AI 宠物,将 Claude Code / Codex CLI 的会话生命周期映射到桌面状态。Swift 5.10 / macOS 14+ / SwiftPM。两个 executable target:Hopet(App)与 hopet-emit(hook 投递 CLI)。

1. 文档

  • 架构、状态机、优先级、hook 协议的事实之源在 DevDocs/。注释引用使用章节级指引,例如 See architecture.md §7.1。
  • 注释解释意图与约束,不复述代码。
  • README 仅描述已实现能力。未实现项需明确标注。

2. Swift 代码风格

2.1 模块组织

源码位于 Sources/Hopet/,按职责分目录:

目录 职责
App/ NSApplication 入口、AppDelegate、菜单栏、SceneRouter
Core/ 状态机、聚合器、Session 注册表、日志、路径、计时器(纯逻辑、可单测)
Models/ 值类型、enum、Codable 数据结构
IPC/ Unix Domain Socket、长度前缀帧、hook 同步通道
HookKit/ Claude / Codex hook settings 的 merge 安装与卸载
Pet/ 桌面宠物 NSPanel、气泡布局与渲染、权限 / AskUser 交互
Notch/ 刘海条三态渲染与降级顶条
Panel/ 偏好面板 Tab 骨架
Theme/ 主题包、color token

新增文件应归入贴切的现有目录,不另起新层级。Sources/hopet-emit/ 为独立 CLI target,禁止反向依赖主 App 符号。

2.2 命名与可见性

  • 公共类型与 API 显式声明 public;模块内部默认 internal,省略关键字。
  • 工具与算法集合优先使用 caseless enum 作为命名空间,参考 HopetLog、SessionStateMachine、HopetPaths。不使用空 struct 或全局函数。
  • @MainActor 标注于面向 UI 的聚合器与控制器,参考 PetAggregator。
  • 跨模块的异步状态使用 Combine PassthroughSubject / CurrentValueSubject,避免直接暴露 @Published。

2.3 实现取舍

  • 不实现做不完整的功能,宁可移除。
  • 不为假想的未来需求引入抽象。三段相似代码优于一个早产的 protocol。
  • 错误处理仅在系统边界进行(用户输入、socket 解码、外部 settings 文件)。模块内部信任调用方,不写防御性 guard。
  • 日志统一走 HopetLog。终端事件流追踪使用 HopetLog.trace(tag:_:),结构化日志使用 .info / .warn / .error。禁止使用 print。

2.4 IPC 与 Hook 协议

  • 跨进程消息统一使用长度前缀 JSON 帧,编解码集中在 IPC/。业务代码不得自行拼装字节。
  • 新增 hook 字段需先更新 DevDocs/hooks-and-priority.md 字段表,再修改 hopet-emit 的 flag 解析与 HookKit 的 settings merge。代码与文档同 PR 提交。
  • Permission Allow/Deny 与 AskUserQuestion 同步回包是协议级承诺。修改这两条路径需保留跨终端宿主兼容性。

Read the full file on GitHub · 212 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. 1mo ago First seen · 212 lines · 3,103 tokens per session scan A 6c387c501f01

Subscribe to this mod's changes

Hopet AGENTS.md is an instructions file published in the GitHub repository BinaryFroggy/Hopet (63 stars, last pushed 3mo ago), licensed MIT. It adds 3,103 tokens to every session, about $0.0124 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories