cc-pocket: Instructions file for Claude Code

CLAUDE.md

cc-pocket CLAUDE.md is an instructions file for Claude Code from heypandax/cc-pocket. It costs 1,985 tokens per session, scanned A, a copy of cc-pocket AGENTS.md, MIT.

Project instructions for cc-pocket, a mobile companion system that lets a phone drive a computer’s Claude Code sessions through an encrypted relay. They document how to update its local background service safely.

In plain words
What is it for?
Use them when developing or updating cc-pocket, especially when rebuilding, installing, restarting, or troubleshooting its local daemon.
Why use it?
They prevent common failures such as running two competing background services, which can cause connection problems, freezes, or duplicated sessions.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; names the AskUserQuestion tool; positional $N argument.

This is heypandax/cc-pocket's own configuration. It tells Claude Code how to work on cc-pocket 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 cc-pocket configures →

Reuse

Borrowing it

Nothing to install: this file belongs to heypandax/cc-pocket. 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/heypandax/cc-pocket/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/heypandax/cc-pocket

Made for: Claude Code.

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 CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/heypandax/cc-pocket/claude-md.svg)](https://agentmods.dev/instructions/heypandax/cc-pocket/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/heypandax/cc-pocket/claude-md"><img src="https://agentmods.dev/badge/instructions/heypandax/cc-pocket/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,985 This file is loaded in full into every session.
When invoked 1,985 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 86% copy Near-identical to another mod 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.01985 $0.01985
Opus 5 $0.00992 $0.00992
Sonnet 5 $0.00397 $0.00397
Haiku 4.5 $0.00198 $0.00198

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

Security

Grade A, and why

cc-pocket CLAUDE.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 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.

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

This is a copy

86% identical to cc-pocket AGENTS.md — 19 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

CLAUDE.md · 78 lines

How it starts

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

CLAUDE.md — cc-pocket

手机 App 通过零知识 E2E relay 驱动本机 Claude Code 的伴侣工具。组成: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」,不达标就报错退出。

更新前的会话确认门(用户规则):两个 update 脚本都会先查 daemon 是否还驱动着其他正在进行的会话(daemon 的直接子进程,自身谱系除外;探测器 scripts/daemon-live-sessions.sh)。有活会话时脚本会带清单 exit 1——此时必须把清单报给用户、经确认后FORCE=1 重跑,不许自作主张点火。

在 cc-pocket 驱动的 claude 会话里(手机/桌面 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 · 78 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 Changed · +2 lines · +112 tokens per session 5bcc71fd8de8
  2. 8d ago First seen · 76 lines · 1,873 tokens per session scan A 6b621b9a868f

Subscribe to this mod's changes

cc-pocket CLAUDE.md is an instructions file published in the GitHub repository heypandax/cc-pocket (112 stars, last pushed yesterday), licensed MIT. It adds 1,985 tokens to every session, about $0.0099 per session on Opus 5. A static security scan graded it A with 0 findings. It is 86% identical to cc-pocket AGENTS.md, differing in 19 lines, and is treated as a copy.

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,153 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