cc-focus: Instructions file for Claude Code

CLAUDE.md

cc-focus CLAUDE.md is an instructions file for Claude Code 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 for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions Claude Code.

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

Reuse

Borrowing it

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

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/mattflower/cc-focus/claude-md/github.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/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 cc-focus CLAUDE.md

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. 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.00893 $0.00893
Opus 5.5 $0.00357 $0.00357
Sonnet 5.5 $0.00179 $0.00179
Haiku 4.5 $0.00089 $0.00089

Measured 2mo ago against content hash 6d07361d572b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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. 2mo 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 8mo ago), licensed MIT. It adds 893 tokens to every session, about $0.0036 per session on Opus 5.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

cc-focus CLAUDE.md compared with instructions from other repositories

cc-focus CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cc-focus CLAUDE.mdMattFlower/cc-focusInstructions file28mo agoMITB893Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file144ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file150ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,086GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file281k2d agoMITA4,335Codex, OpenCode