cc-focus CLAUDE.md

cc-focus CLAUDE.md is an instructions file for coding agents from MattFlower/cc-focus. It costs 893 tokens per session, scanned B, original, MIT.

Instructions for a macOS menu-bar app that shows the status of Claude Code sessions. It describes the app's Swift code, shell hooks, commands, and installation files.

In plain words
What is it for?
Use it when working on the app, its Claude Code hooks, its Unix socket communication, or its build and installation scripts.
Why use it?
It gives coding agents the project-specific information needed to change, build, install, or uninstall the app safely.

Instructions file

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/mattflower/cc-focus/claude-md
Clone the repo
git clone --depth 1 https://github.com/MattFlower/cc-focus

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/mattflower/cc-focus/claude-md.svg)](https://agentmods.dev/instructions/mattflower/cc-focus/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/mattflower/cc-focus/claude-md"><img src="https://agentmods.dev/badge/instructions/mattflower/cc-focus/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 893 This file is loaded in full into every session.
When invoked 893 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.00893 $0.00893
Opus 5 $0.00447 $0.00447
Sonnet 5 $0.00179 $0.00179
Haiku 4.5 $0.00089 $0.00089

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

Security

Grade B, and why

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

- `install-hooks.sh` - Merges hook entries into ~/.claude/settings.json (preserves existing hooks)
CLAUDE.md · 66 lines

How it starts

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

cc-focus

macOS menu bar status indicator for Claude Code sessions. Single-file Swift/AppKit app.

Architecture

Claude Code hooks (JSON on stdin)
  → cc-focus-hook.sh <event_type>     # injects event_type, sends to socket
    → nc -U /tmp/cc-focus-$(id -u).sock
      → cc-focus.swift                # NSStatusItem menu bar app

All logic is in cc-focus.swift (~350 lines). No external dependencies, no packages.

Files

  • cc-focus.swift - The entire app: socket listener, state machine, menu bar UI
  • cc-focus-hook.sh - Shell hook that reads Claude Code JSON from stdin, injects event_type via python3, sends to Unix socket
  • cc-focus-cli - CLI wrapper: cc-focus-cli setup / cc-focus-cli teardown for hook management
  • Info.plist - App bundle config (LSUIElement=true for no dock icon)
  • build.sh - Compiles Swift and creates .app bundle
  • install.sh - Builds, cleans up legacy installs, sets up hooks
  • install-hooks.sh - Merges hook entries into ~/.claude/settings.json (preserves existing hooks)
  • uninstall-hooks.sh - Removes cc-focus hooks from ~/.claude/settings.json
  • uninstall.sh - Stops service, cleans up legacy installs, removes socket/hooks

Build & Test

bash build.sh                    # compile
bash install.sh                  # build + hooks (cleans up legacy installs)
bash uninstall.sh                # full removal
brew services restart cc-focus   # start/restart via Homebrew
brew services stop cc-focus      # stop

Manual test events:

echo '{"event_type":"session_start","session_id":"test1","cwd":"/tmp"}' | nc -U /tmp/cc-focus-$(id -u).sock
echo '{"event_type":"stop","session_id":"test1","cwd":"/tmp"}' | nc -U /tmp/cc-focus-$(id -u).sock
echo '{"event_type":"session_end","session_id":"test1"}' | nc -U /tmp/cc-focus-$(id -u).sock

Key Design Decisions

  • Stop hook for idle: The Stop hook (fires when Claude finishes its turn) maps to the idle (gray) state. The PermissionRequest hook and idle_prompt/permission_prompt Notification hooks map to needsInput (red). PermissionRequest fires promptly when the permission dialog appears; the Notification/permission_prompt hook fires with a delay and serves as a backup.
  • Notification events lack session_id: Notification hook events (permission_prompt, idle_prompt) don't include session_id. The app falls back to extracting it from transcript_path.
  • Resume creates orphan sessions: When continuing a session, Claude fires two session_start events: a "startup" wrapper and a "resume". Only the resumed session gets a session_end. The app cleans up the orphaned wrapper when it sees a resume event.
  • isTemplate = false: The status item image must not be a template, otherwise macOS recolors the circle to match the menu bar theme.
  • Compile with -swift-version 5: Avoids Swift 6 strict concurrency requirements.
  • Debug logging: cc-focus-hook.sh writes to /tmp/cc-focus-debug.log. Remove once stable.

Read the full file on GitHub · 66 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 · 66 lines · 893 tokens per session scan B 6d07361d572b

Subscribe to this mod's changes

cc-focus CLAUDE.md is an instructions file published in the GitHub repository MattFlower/cc-focus (2 stars, last pushed 6mo ago), licensed MIT. It adds 893 tokens to every session, about $0.0045 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-31.

Related

Other instructions, from other repositories

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

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

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

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

next.js 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