agentleFS
lcoutodemoslcoutodemos/clui-cc/docs/AGENTS.md

clui-cc

AGENTS.md1.2k starsChanged 9 months agoMITView on GitHub

This file is optimized for AI coding agents (Claude Code, Cursor, Copilot, etc.). For human-readable docs see ARCHITECTURE.md and CONTRIBUTING.md. Clui CC is a macOS-only Electron overlay that wraps the Claude Code CLI (claude -p --output-format stream-json) in a floating pill UI. It is NOT a web app, NOT a VS Code extension, and does NOT call the Anthropic API directly — it spawns CLI subprocesses. Main process changes require full restart. Renderer changes hot-reload. All IPC and event types…

Trending

Quiet since March.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the lcoutodemos/clui-cc repository that our weekly crawl found: only 1 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about lcoutodemos/clui-cc

The biggest 1 of 1 mention linking to the repository that our crawl found. Each line is their own headline.

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

20 rules. About 0 are common, 5 are distinctive, and 15 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 15

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All IPC and event types live in src/shared/types.ts.

    line 71
  2. Very specific:

    All new IPC channels: must be added to src/shared/types.ts AND wired in both src/preload/index.ts and src/main/index.ts

    line 88
  3. Distinctive:

    Don't import main-process modules from renderer (or vice versa) — the preload bridge is the only crossing point

    line 102
  4. Distinctive:

    Don't add network calls — the app is designed to be nearly offline (only marketplace fetches from GitHub)

    line 103
  5. Very specific:

    Don't use node-pty for new features — it's legacy, prefer RunManager (stdio-based)

    line 104
  6. Very specific:

    Don't add Electron remote module usage — it's disabled for security

    line 105
  7. Very specific:

    Add channel name to IPC const in src/shared/types.ts

    line 110
  8. Very specific:

    Add handler in src/main/index.ts (ipcMain.handle or ipcMain.on)

    line 111
  9. Very specific:

    Call from renderer via window.clui.*

    line 113
  10. Very specific:

    Use useColors() for all colors

    line 117
  11. Very specific:

    Use Phosphor icons (@phosphor-icons/react) — not other icon libraries

    line 118
  12. Very specific:

    Add raw type to ClaudeEvent union in src/shared/types.ts

    line 122
  13. Very specific:

    Add normalized form to NormalizedEvent union

    line 123
  14. Very specific:

    Add to TabState interface in src/shared/types.ts

    line 128
  15. Very specific:

    Update via ControlPlane events — never directly from renderer

    line 130
  16. Distinctive:

    No telemetry. No analytics.

    line 154
  17. Distinctive:

    Forgetting to restart dev server: after main-process changes — renderer hot-reloads but main does not

    line 158
  18. Very specific:

    Adding raw color values: instead of using useColors() — breaks theming

    line 159
  19. Distinctive:

    Mutating tab state from renderer: instead of going through ControlPlane events

    line 160
  20. Very specific:

    Hardcoding IPC strings: instead of using IPC.* constants

    line 161

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Agent Guide — Clui CC

This file is optimized for AI coding agents (Claude Code, Cursor, Copilot, etc.). For human-readable docs see ARCHITECTURE.md and CONTRIBUTING.md.

What This Project Is

Clui CC is a macOS-only Electron overlay that wraps the Claude Code CLI (claude -p --output-format stream-json) in a floating pill UI. It is NOT a web app, NOT a VS Code extension, and does NOT call the Anthropic API directly — it spawns CLI subprocesses.

Quick Reference

ActionCommand
Install depsnpm install
Dev mode (hot-reload)npm run dev
Type-check / buildnpm run build
Toggle overlay⌥ + Space (fallback: Cmd+Shift+K)
Debug loggingCLUI_DEBUG=1 npm run dev (writes to ~/.clui-debug.log)

Main process changes require full restart. Renderer changes hot-reload.

Architecture (3-Layer)

Renderer (React 19 + Zustand 5 + Tailwind CSS 4)
    ↕  contextBridge IPC (src/preload/index.ts)
Main Process (Node.js / Electron 33)
    ↕  spawns subprocess
Claude Code CLI (claude -p --output-format stream-json)

Layer Responsibilities

LayerDirectoryManages
Renderersrc/renderer/UI state, theming, user input, message display
Preloadsrc/preload/Typed IPC bridge (window.clui API). Security boundary.
Mainsrc/main/Process lifecycle, tab state machine, permission server, marketplace

Key Files by Concern

ConcernFile(s)
Tab lifecycle & state machinesrc/main/claude/control-plane.ts
Spawning Claude CLI processessrc/main/claude/run-manager.ts
Raw NDJSON → canonical eventssrc/main/claude/event-normalizer.ts
Permission hook serversrc/main/hooks/permission-server.ts
All TypeScript types & IPC channelssrc/shared/types.ts
Zustand state storesrc/renderer/stores/sessionStore.ts
Theme / color systemsrc/renderer/theme.ts
Main window & IPC handler setupsrc/main/index.ts
Marketplace catalogsrc/main/marketplace/catalog.ts
Skill installersrc/main/skills/installer.ts

Data Flow: Prompt → Response

InputBar.tsx → window.clui.prompt(tabId, requestId, opts)
  → ipcRenderer.invoke('clui:prompt')
  → ControlPlane.prompt()
  → RunManager spawns: claude -p --output-format stream-json --resume <sid>
  → stdout emits NDJSON lines
  → EventNormalizer → NormalizedEvent
  → ControlPlane broadcasts via IPC
  → useClaudeEvents hook → sessionStore.handleNormalizedEvent()
  → React re-renders

Canonical Types

All IPC and event types live in src/shared/types.ts. Key types:

  • NormalizedEvent — union of all events the main process emits to the renderer
  • TabState — full state of a single tab (status, messages, permissions, session metadata)
  • TabStatus — state machine: connecting → idle → running → completed/failed/dead
  • IPC — const object with all IPC channel names (use these, never raw strings)
  • RunOptions — options passed when spawning a Claude CLI run
  • CatalogPlugin — marketplace plugin metadata

Conventions & Rules

Must Follow

  1. TypeScript strict mode — zero errors required (npm run build must pass)
  2. Use IPC.* constants for all IPC channel names — never hardcode strings
  3. Use useColors() hook for all color references in renderer — never hardcode colors
  4. Narrow Zustand selectors with custom equality functions for performance
  5. All new IPC channels must be added to src/shared/types.ts AND wired in both src/preload/index.ts and src/main/index.ts
  6. Tab state transitions go through ControlPlane only — never mutate tab state directly

Security — Do Not Break

  • Permission server binds to 127.0.0.1 only (never 0.0.0.0)
  • Per-launch app secret (random UUID) validates hook requests — do not weaken
  • Per-run tokens route permission responses to correct tab — do not bypass
  • CLAUDECODE env var is explicitly removed from spawned processes
  • Sensitive fields (tokens, passwords, secrets, keys, auth, credentials) are masked via maskSensitiveFields() before display
  • 5-minute auto-deny timeout on unanswered permissions — do not remove

Don't

  • Don't import main-process modules from renderer (or vice versa) — the preload bridge is the only crossing point
  • Don't add network calls — the app is designed to be nearly offline (only marketplace fetches from GitHub)
  • Don't use node-pty for new features — it's legacy, prefer RunManager (stdio-based)
  • Don't add Electron remote module usage — it's disabled for security

Adding a New Feature — Checklist

New IPC channel

  1. Add channel name to IPC const in src/shared/types.ts
  2. Add handler in src/main/index.ts (ipcMain.handle or ipcMain.on)
  3. Expose via contextBridge in src/preload/index.ts
  4. Call from renderer via window.clui.*

New UI component

  1. Create in src/renderer/components/
  2. Use useColors() for all colors
  3. Use Phosphor icons (@phosphor-icons/react) — not other icon libraries
  4. Animations via Framer Motion

New event type from Claude CLI

  1. Add raw type to ClaudeEvent union in src/shared/types.ts
  2. Add normalized form to NormalizedEvent union
  3. Handle in EventNormalizer.normalize() (src/main/claude/event-normalizer.ts)
  4. Handle in sessionStore.handleNormalizedEvent() (src/renderer/stores/sessionStore.ts)

New tab state field

  1. Add to TabState interface in src/shared/types.ts
  2. Initialize in createTab() in both ControlPlane and sessionStore
  3. Update via ControlPlane events — never directly from renderer

Stack

LayerTechVersion
DesktopElectron33
Buildelectron-vite3
UIReact19
StateZustand5
StylingTailwind CSS4
AnimationFramer Motion12
IconsPhosphor Icons2
Markdownreact-markdown + remark-gfm9 / 4
PTY (legacy)node-pty1.1

Network Surface

EndpointPurposeRequired
raw.githubusercontent.com/anthropics/*Marketplace catalog (cached 5 min)No
api.github.com/repos/anthropics/*/tarball/*Skill auto-installNo
127.0.0.1:19836Permission hook server (local only)Yes

No telemetry. No analytics. No auto-update.

Common Pitfalls

  1. Forgetting to restart dev server after main-process changes — renderer hot-reloads but main does not
  2. Adding raw color values instead of using useColors() — breaks theming
  3. Mutating tab state from renderer instead of going through ControlPlane events
  4. Hardcoding IPC strings instead of using IPC.* constants
  5. Testing on non-macOS — this is macOS-only (transparent windows, node-pty bindings)
  6. Not handling the session_dead event — if a Claude process crashes, the tab must transition to dead status

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.