agentleFS
postmeridiempostmeridiem/clide/CLAUDE.md

clide

CLAUDE.md4 starsChanged 3 months agoMITView on GitHub

An IDE for Claude Code CLI. Single Flutter package at the repo root. Claude session persistence is --resume <session-id> against Claude Code's transcript files (D-77, superseding the original tmux-backed D-41) — the app re-attaches on restart, no tmux required. Native rendering — markdown, canvas, graph — is Dart/Flutter (CustomPaint + widgets), not third-party packages. Design doc: docs/initial-plan.md. Decisions: governance/ (D-NNN confirmed, Q-NNN open, R-NNN rejected — see governance/README.md). Python Textual predecessor under legacy/. These are load-bearing. Violating any means the…

The file

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

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

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

    User/Claude parity: Every CLI subcommand has a UI affordance, and every UI action has a CLI.

    line 25
  2. Very specific:

    Decision discipline: All architectural choices live in governance/decisions/<domain>.md as D-NNN records.

    line 29
  3. Very specific:

    Prefer the Read/Edit/Grep tools over cat/sed/grep for inspecting files.

    line 92

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.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
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What clide is

An IDE for Claude Code CLI. Single Flutter package at the repo root.

  • lib/ — all Dart code. Subsystem handlers (lib/src/daemon/, lib/src/pty/, lib/src/ipc/, lib/src/git/, lib/src/pql/), kernel services (lib/kernel/), UI widgets (lib/widgets/), built-in extensions (lib/builtin/), and the extension framework (lib/extension/). The Flutter app hosts the IPC server in-process (D-56). PTY spawning uses Dart FFI posix_openpt() + posix_spawn() directly.
  • pql — external supporter tool. Clide wraps it for every query surface; never re-implements it.

Claude session persistence is --resume <session-id> against Claude Code's transcript files (D-77, superseding the original tmux-backed D-41) — the app re-attaches on restart, no tmux required. Native rendering — markdown, canvas, graph — is Dart/Flutter (CustomPaint + widgets), not third-party packages.

Design doc: docs/initial-plan.md. Decisions: governance/ (D-NNN confirmed, Q-NNN open, R-NNN rejected — see governance/README.md). Python Textual predecessor under legacy/.

Guardrails

These are load-bearing. Violating any means the design is wrong, not the rule.

  • Flutter desktop is the host. No Electron, ever. The web UI is a real target: the full IDE in a browser, served from a containerised host (D-116, front door D-117). It is the same Flutter UI, and desktop fidelity is never traded for it. The web build is Flutter's WebAssembly (CanvasKit/Skwasm) compile, not the JS/HTML renderer. xterm.dart is the terminal renderer; markdown, canvas, graph are custom CustomPaint/widget components.
  • Single process — per host, per workspace. On desktop the Flutter app hosts everything in-process: IPC server, subsystem handlers (pane, files, editor, git, pql), extensions. No separate daemon binary (D-56 dissolved it). In web UI mode the UI runs in the browser, and each workspace's subsystems run in one host process behind the front door (D-116).
  • CLI-first, not MCP. Claude talks via Bash (clide ...), matching pql's contract. See D-1.
  • Dart is the core; pql fills the query gap. PTY spawning is native Dart FFI (posix_openpt + posix_spawn). pql (Go) handles vault queries. No second "core language." See D-5 (amended by D-56).
  • Own the rendering stack. PTY (via Dart FFI), markdown renderer, graph, canvas — all clide-owned, not pulled from opinionated packages.
  • User/Claude parity. Every CLI subcommand has a UI affordance, and every UI action has a CLI. See D-6.
  • pql: wrap, don't duplicate. Pql logic only lives in lib/src/pql/ (pure shell-outs). Clide owns pql's ignore_files: config key; it never touches pql's .pql/ index/cache data. See D-3.
  • Repo-is-the-workspace. The git repo root is the workspace — no parallel "vault" concept.
  • Ignore discipline. Single knob: ignore_files: in .pql/config.yaml, ordered layering. See D-4.
  • Decision discipline. All architectural choices live in governance/decisions/<domain>.md as D-NNN records. Open questions as Q-NNN under governance/questions/<domain>.md. Rejected alternatives as R-NNN under governance/rejected/<domain>.md. Claim new IDs via pql decisions claim D <domain> "title". See governance/README.md.
  • No pre-existing excuse. Solo-dev repo — every failure encountered is yours to fix, regardless of who introduced it. If make test is red, a golden is broken, or flutter analyze shows a warning when you start working, the order is: fix it first, then your work. If you genuinely can't fix it in scope (separate ticket, large sweep, missing context), stop and surface it before continuing — don't push on top of broken state. "It was already broken" is not a reason to add more on top.

Repo layout

lib/
  main.dart              # Flutter app entry point
  app.dart               # Root layout, workspace, panels
  clide.dart             # Barrel: shared types (IPC envelope, pane kinds, etc.)
  src/                   # Core subsystems (IPC server, PTY, git, files, pql, panes, editor)
  kernel/                # Kernel services (theme, i18n, settings, panels, commands, focus)
  builtin/               # Built-in extensions (claude, editor, files, git, terminal, etc.)
  widgets/               # Custom widget primitives (no Material/Cupertino)
  extension/             # Extension contract and registration
  lua/                   # Lua runtime support (Tier 6)
test/                    # All tests (core subsystems + widgets + goldens + a11y)
assets/                  # Fonts, themes, grammars, licenses, logo
linux/, macos/, web/     # Flutter platform directories
native/                  # Vendored native libs (libtree-sitter.so, dugite)
docker/                  # Container images — web/ is the web UI's edge (D-117)
governance/              # D/Q/R records (decisions/, questions/, rejected/ subdirs)
docs/                    # Design docs, wireframes
legacy/                  # Python Textual clide v1.2 (frozen)

Dependencies & supply chain

  • Prefer-zero-deps. Flutter-SDK widgets first; third-party packages need justification. What stays is exact-pinned in pubspec.yaml (no caret ranges). Advisories reviewed before every bump; pubspec.lock committed.
  • Document every bundled dependency. Listed in assets/licenses.yaml with name, kind, version, homepage, license, and purpose. Adding a dep is a two-step commit: add the artefact and the licenses.yaml entry. See D-42.
  • Native deps (dugite, libtree-sitter): vendored in native/, pinned by SHA. Bumps follow the same advisory-review + licenses.yaml rule.

Commands

make run             # launch Flutter desktop app
make reload          # hot-reload it   (only when `make run` had no tty)
make restart         # hot-restart it  (ditto — prefer after a const change)
make quit            # stop it         (ditto)
make analyze         # flutter analyze
make format          # dart format --set-exit-if-changed
make test            # fast test suite (analyze + format + unit + widget + golden)
make test-core       # core subsystem tests (IPC, PTY, git, pane registry)
make test-a11y       # accessibility contract tests
make test-integration# real app boot integration tests
make build-linux     # flutter build linux
make build-macos     # flutter build macos
make push-check      # pre-push gate: decisions + core + fast tests + a11y
make hooks           # install the repo's git hooks (one-time setup)
make clean           # remove build artefacts

One-time setup on a fresh clone: make hooks && flutter pub get once Flutter is installed.

Driving a running app. flutter run only reloads when someone presses r on its stdin, which an agent or background shell does not have — so make run detects the missing tty and feeds flutter from a control pipe (tmp/clide-run.fifo) that make reload/restart/quit write to. Iterating on visuals then costs a restart, not a rebuild. An interactive make run is unchanged and keeps the keyboard. Prefer make restart over make reload when the change is inside a const widget — const canonicalisation makes reload show stale pixels, which reads as "my edit did nothing".

Tooling discipline

The make targets above are the entry points — run them, not the scripts they wrap. Check the changelog with make changelog-gate, never ci/changelog_gate.sh directly; same for analyze/format/test/push-check. The make layer sets up the environment and stays correct if a script moves.

Shell hygiene (keeps commands inside the permission allowlist, so they don't get denied mid-task):

  • Working directory is the repo root already — don't prepend cd /…/clide or pass git -C. Just run the command.
  • One command per invocation — no &&/; chaining and no multiple greps/echos in one call. The only exception is the git commit -F HEREDOC.
  • Prefer the Read/Edit/Grep tools over cat/sed/grep for inspecting files.
  • Edit files with Edit/Write — never a python3 -c, heredoc, or sed script. A scripted string-replace that doesn't match fails silently and reports success, so the next several minutes are spent debugging a change that was never applied. Edit errors instead. This holds for throwaway files too.

Git workflow

Commit and push directly to main for routine work — this is a solo-dev repo and does not use a branch-first / feature-branch flow. Do not create a working branch just to land a change. (This overrides the generic "branch before committing on the default branch" assistant default.) The usual safety rules still hold: never --no-verify, never force-push main, and let the pre-push gate run.

Never git add -A or git add . — stage explicit paths every time (git add <file> …), no exceptions. This worktree can host concurrent Claude sessions: a blanket add vacuums another session's in-progress files — and your own unrelated edits — into your commit, mislabeling work and entangling history (this has happened). If git status shows files you didn't touch this turn, they are not yours to stage. Always create commits through the git-commit skill — it encodes the message format (Conventional Commits, per D-37), the explicit-staging rule, changelog discipline, and the safety reminders. Don't hand-roll a commit that skips it.

The pre-commit hook auto-exports and stages .pql/changelog/ (the pql ticket DB) on every commit — don't hand-stage it. A ticket change only persists if the turn makes at least one commit; with no commit the hook never fires and a later branch switch can drop it.

Commit per change; batch pushes to checkpoints. The pre-push gate (.githooks/pre-push, installed by make hooks) runs the full suite plus the coverage gate — ~2 minutes — whenever the push touches lib/, test/, ci/, .githooks/ or pubspec.*. It costs the same whether it guards one commit or twenty, so pushing per commit pays it over and over for no extra safety. Push at a natural checkpoint, or when asked. (A push touching none of those runs only the instant decisions + changelog gates, so plan-only commits are cheap to send.) Never --no-verify: if the gate is slow, fix the slow test.

Changelog discipline

Keep a Changelog 1.1.0. Every user-visible commit adds an entry under ## [Unreleased] in CHANGELOG.md. Cutting a release means moving Unreleased entries under a new dated version heading and bumping pubspec.yaml version: in the same commit — see .claude/skills/git-commit/SKILL.md for the full rule.

Open questions

Open questions live under governance/questions/.

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.