hope-agent: Instructions file for Claude Code

AGENTS.md

hope-agent AGENTS.md is an instructions file for Claude Code, Codex, OpenCode from shiwenwen/hope-agent. It costs 16,995 tokens per session, scanned C, original, MIT.

Repository instructions for Hope Agent, a local desktop AI assistant built with Tauri, React, and Rust. They define security rules, branch and release conventions, and required checks before submitting code.

In plain words
What is it for?
Use them when changing Hope Agent code, especially its user interface, server, authentication, or release workflow.
Why use it?
They help contributors avoid leaking credentials, breaking project conventions, or submitting changes without the required checks.

Instructions file for Claude CodeCodexOpenCode

Written for Claude Code and Codex and OpenCode: UserPromptSubmit hook event, but also the file is AGENTS.md. Also seen: mentions subagents; mentions Claude Code; mentions AGENTS.md.

This is shiwenwen/hope-agent's own configuration. It tells Claude Code, Codex and OpenCode how to work on hope-agent 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 hope-agent configures →

About the project

Hope Agent is a cross-device personal AI assistant that remembers context, uses tools, and continues working toward goals through dynamically organized workflows. Individuals use it from desktop, web, server, or messaging environments to manage projects, knowledge, designs, and long-running tasks. The catalogue add-ons extend its agent workflows and capabilities.

shiwenwen/hope-agent · 1,553 stars · on GitHub

Reuse

Borrowing it

Nothing to install: this file belongs to shiwenwen/hope-agent. 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/shiwenwen/hope-agent/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/shiwenwen/hope-agent

Made for: Claude Code, 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 hope-agent AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/shiwenwen/hope-agent/agents-md.svg)](https://agentmods.dev/instructions/shiwenwen/hope-agent/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/shiwenwen/hope-agent/agents-md"><img src="https://agentmods.dev/badge/instructions/shiwenwen/hope-agent/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 16,995 This file is loaded in full into every session.
When invoked 16,995 The same file — it is already loaded in full.
Security scan C 1 finding. 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.16995 $0.16995
Opus 5 $0.08497 $0.08497
Sonnet 5 $0.03399 $0.03399
Haiku 4.5 $0.01699 $0.01699

Measured today against content hash 5da2bd340f30, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade C, and why

hope-agent AGENTS.md scanned grade C 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 today.

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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- **删除级联**:`rm -rf projects/{id}/` **绝不波及用户显式选的外部 working_dir**;跨 db 项目记忆单独删、启动期 reconciler 兜底
AGENTS.md · 349 lines

How it starts

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

Hope Agent

基于 Tauri 2 + React 19 + Rust 的本地 AI 助手桌面应用,内置 Provider 模板与预设模型,GUI 傻瓜式配置。三种运行模式:桌面 GUI(Tauri)、HTTP/WS 守护进程(hope-agent server)、ACP stdio(hope-agent acp)。技术栈见 package.json / Cargo.toml

本文只放跨 PR 必守的红线、同步契约与唯一入口——实现细节、数据结构、迁移逻辑、边角行为一律在 docs/architecture/(索引 docs/README.md)。加内容前先问:删掉它会让 agent 犯错吗?不会就别加。前端 / UI 风格规范见 src/AGENTS.mdsrc/ 嵌套 AGENTS.md,改前端时自动生效)。

安全红线

  • API Key / OAuth Token 禁止出现在任何日志中
  • Server Owner Token 只许走 Bearer header 或同源登录 body,禁止进 URL;同源浏览器换 HttpOnly Cookie,跨源 WebSocket / iframe 只用短时、scope 受限票据,资源票据入口必须保持只读 allowlist
  • tauri.conf.json CSP 不要放行外部域名
  • OAuth token 在 ~/.hope-agent/credentials/auth.json,登出时必须 clear_token()
  • OAuth 保存只走安全目录与 write_secure_file_outcome,异步写经 save_token_async;写入未发布不得报登录成功,已发布的令牌轮换不得按旧凭据重试

提交前检查(强制)

.husky/pre-push push 时自动跑全套门禁,与 CI required check 一一对应、改一边同步另一边;Agent 勿重跑。clippy / cargo test 覆盖 ha-base + ha-agent-loop + ha-agent-runtime + ha-memory + ha-goal + ha-workflow + ha-config-schema + ha-core + ha-acp + ha-browser + ha-channel + ha-cron + ha-dash + ha-design + ha-eval-runtime + ha-improve + ha-knowledge + ha-mac + ha-local-llm + ha-mcp + ha-media + ha-pet + ha-skills + ha-updater + ha-vcs + ha-weather + ha-serversrc-tauri 不在门禁内、须 --workspace 自查。

  • 开发中只单点验证cargo check -p <crate> / pnpm typecheck);跑 clippy / cargo test / pnpm {test,lint} 须先问用户等回复,例外限跨 crate / 多文件收尾,跑前说明
  • 应急跳过HA_SKIP_PREPUSH=1(限纯 .md / 弱网)/ HA_SKIP_PREPUSH_TEST=1(只跳 cargo test)。禁止 --no-verify(会绕过 GPG 等钩子)
  • i18n 无 CI 兜底:当次改动涉及的 key 提交时须全语言齐全(存量缺失不强制),node scripts/sync-i18n.mjs --check 自查
  • 评测不进 CI / PR / pre-push:完整专项评测只本地显式跑(hope-agent-eval),默认 cargo test 只留快速契约测试;GitHub CI 不构建 ha-eval、不跑评测 smoke。详见 capability-eval

分支与发布

  • 外部 Actions 固定完整提交摘要;R2 密钥只在读写步骤环境中可见,rclone 先验固定摘要再执行;守卫在 scripts/check-workflow-supply-chain.mjs(pre-push / CI 同源)

Read the full file on GitHub · 349 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. today Changed · +2 lines · +164 tokens per session 5da2bd340f30
  2. yesterday Changed · +2 lines · +56 tokens per session 18bc555cf131
  3. 5d ago Changed · +5 lines · +148 tokens per session efda68d7bdeb
  4. 8d ago First seen · 340 lines · 16,627 tokens per session scan C 335b753ea1e8

Subscribe to this mod's changes

hope-agent AGENTS.md is an instructions file published in the GitHub repository shiwenwen/hope-agent (1,553 stars, last pushed today), licensed MIT. It adds 16,995 tokens to every session, about $0.0850 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). 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

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens