cc-pocket AGENTS.md

cc-pocket AGENTS.md is an instructions file for Codex, OpenCode from heypandax/cc-pocket. It costs 1,507 tokens per session, scanned A, original, MIT.

Project instructions for cc-pocket, a mobile companion that controls a local Codex daemon through an encrypted relay. They explain how its mobile app, daemon, relay, and shared protocol fit together.

In plain words
What is it for?
Use them when changing the daemon, updating the installed local daemon, troubleshooting phone connections, or working on the mobile app, relay, or protocol.
Why use it?
They prevent a common setup failure: running two daemons that compete for the same account and port, which can make connections unstable.

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/heypandax/cc-pocket/agents-md
Clone the repo
git clone --depth 1 https://github.com/heypandax/cc-pocket

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 cc-pocket AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/heypandax/cc-pocket/agents-md.svg)](https://agentmods.dev/instructions/heypandax/cc-pocket/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/heypandax/cc-pocket/agents-md"><img src="https://agentmods.dev/badge/instructions/heypandax/cc-pocket/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,507 This file is loaded in full into every session.
When invoked 1,507 The same file — it is already loaded in full.
Security scan A 0 findings. 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.1 $0.01507 $0.01507
Opus 5 $0.00754 $0.00754
Sonnet 5 $0.00301 $0.00301
Haiku 4.5 $0.00151 $0.00151

Measured 6d ago against content hash 411ff99a1e28, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

cc-pocket 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 6d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

AGENTS.md · 69 lines

How it starts

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

AGENTS.md — cc-pocket

手机 App 通过零知识 E2E relay 驱动本机 Codex 的伴侣工具。组成:mobile/(Compose Multiplatform App)、daemon/(本机 Kotlin/JVM 守护进程)、relay/(云端 Ktor 中转,源站地址在 .envRELAY_HOST,Cloudflare 前置 pocket.ark-nexus.cc)、protocol/(共享 wire 协议)。

⚠️ 本机 daemon 操作铁律(最重要,先读这一段)

症状:手机连不上 / 卡死 / 状态乱跳 / 会话疯狂 fork。根因几乎总是「同时跑了两个 daemon」——它们抢同一个 relay 账号 + 端口 8799,互相 kill -9,谁都稳不住。

改完 daemon 代码要更新本机 daemon —— 只用这一条命令

cd ~/Desktop/Project/app/cc-pocket
bash scripts/update-local-daemon.sh

它幂等地:构建 installDist → 装到可执行位置 ~/Library/Application Support/cc-pocket/杀干净所有现存 daemon + 清 8799service-install 注册单实例 → 校验「进程数=1 且 relay-socket≥1」,不达标就报错退出。

在 cc-pocket 驱动的 Codex 会话里(手机/桌面 App 开的会话)不要直接跑上面这条——bootout 会连坐杀掉会话本身(exit 137)。改用:

bash scripts/update-local-daemon-detached.sh

它先做谱系自检(是否 daemon 后代):普通终端 → 等价于直接更新;daemon 驱动 → 预热构建后延迟 20s 脱离点火(python 双 fork+setsid),让会话来得及发完汇报。随后会话断开属预期,daemon 被 launchd 拉起后手机自动重连,重新进入会话即可。

绝对不要做(每一条都会制造第二个 daemon → 立刻不可用)

  • ./gradlew :daemon:run —— 会起一个前台 daemon,和 launchd 的那个抢账号。
  • ❌ 直接执行 daemon/build/install/.../bin/cc-pocket-daemon —— 同上;而且这个路径在 ~/Desktop 下,launchd 无权执行(TCC,报 Operation not permitted),一旦被 service-install 指到这里就崩溃循环。
  • ❌ 手动 nohup cc-pocket-daemon run & 起临时实例做测试后忘了杀。
  • ❌ 让 cask 的 dev.ccpocket.daemon 和 dev 构建同时存在/自启。

必须知道的两个反直觉事实(本机环境)

  1. cask app-image 版 daemon 在本机连不上 relay(TUN 代理 fake-IP 不放行它,lsof 看它 0 个 socket)。必须用 java 的 installDist 构建(走 ~/Library/Application Support/)。update-local-daemon.sh 已默认这么做。
  2. daemon 在 macOS 上不会自注册 launchd 服务(自注册只在 Windows)。plist 只被显式的 cc-pocket-daemon service-install 改写。所以 plist 指错路径 = 有人从错误位置跑了 service-install

排查 / 自证命令(只读)

# 有几个 daemon 在跑?(正常应恰好 1 个)
# ⚠️ 不要用 pgrep -f 判断:macOS pgrep 匹配不到超长 java classpath 里的关键字(实测漏报为 0),必须走 ps
ps aux | grep 'cc-pocket-daemon/lib' | grep -v grep | wc -l
# 谁真的连上了 relay(应有 1 条 :443 ESTABLISHED)
for p in $(ps aux | grep 'cc-pocket-daemon/lib' | grep -v grep | awk '{print $2}'); do lsof -nP -p $p 2>/dev/null | grep ':443.*ESTABLISHED' && echo "  ^pid $p"; done
lsof -nP -iTCP:8799 -sTCP:LISTEN            # pair loopback 端口占用者
launchctl list | grep -i ccpocket          # launchd agent(应只有 dev.ccpocket.daemon 一个)
# daemon 日志
tail -f ~/Library/Logs/cc-pocket/daemon.err.log

Read the full file on GitHub · 69 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. 6d ago First seen · 69 lines · 1,507 tokens per session scan A 411ff99a1e28

Subscribe to this mod's changes

cc-pocket AGENTS.md is an instructions file published in the GitHub repository heypandax/cc-pocket (110 stars, last pushed 2d ago), licensed MIT. It adds 1,507 tokens to every session, about $0.0075 per session on Opus 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

AppClaw CLAUDE.md

Claude Code instructions for appclawhq/AppClaw, covering claude.md, what is appclaw?, build & run commands, architecture and entry point & cli modes (src/index.ts).

appclawhq/AppClaw · 5,726 tokens

spellbook AGENTS.md

AGENTS.md instructions for majiayu000/spellbook, covering spellbook agent contract, routing, scope rules, threads long-run guardrails and validation.

majiayu000/spellbook · 910 tokens

OpenGUI CLAUDE.md

Claude Code instructions for Core-Mate/OpenGUI, covering opengui release - repository guide for claude code / codex, 1. repository positioning, 2. default working rules, 3. high-level architecture and 4. directory map.

Core-Mate/OpenGUI · 2,471 tokens

android-media-pack CLAUDE.md

Instructions for sunnat629/android-media-pack, covering claude.md, what this repository is, commands, markdown lint (config in .markdownlint-cli2.jsonc) and shell script lint.

sunnat629/android-media-pack · 1,293 tokens

android-qa-kit AGENTS.md

Instructions for willbytee-sudo/android-qa-kit, covering agents.md — setting up and driving an android device, 1. how to work with the user, 2. start by finding out what's already there, 3. what you can do in each mode and 4. if there's no device: ask first.

willbytee-sudo/android-qa-kit · 2,707 tokens

cordial AGENTS.md

AGENTS.md instructions for luohoa97/cordial, covering agents.md, reach for the mcp first, the one rule, verify by running. do not report what you have not observed and which issue this is.

luohoa97/cordial · 7,333 tokens