Official

claude

Claude Code agent provider: runs the Claude Code CLI headless for each account.

The app opens the listing; nothing installs until an agent in your Plugins workspace has read the files and you enable the plugin. In a terminal: dvg install divergence/claude@0.2.5

Permissions in 0.2.5

  • Provide agents agents.provideMediumAdds agents to the app.Provide the Claude Code agent and pass its tool calls to plugin tools
  • Run named programs processMediumStarts the listed programs.Run the Claude Code CLI (sessions, sign-in, `claude update`), and ask the npm installation that owns it about a newer versionPrograms: claudenpm
  • Read files fs.readMediumReads files in the listed places.Read Claude Code's sessions, settings and skills (in ~/.claude, other accounts' ~/.claude-* folders, the shared skills and the folder you choose in Settings), the project's .claude folder, the administrator's skill policy, and once, what the previous provider keptPlaces: ~/.claude/**~/.claude*/**~/.agents/skills/**the open workspaceits own data folder/Library/Application Support/ClaudeCode/managed-settings.json/etc/claude-code/managed-settings.json${settings.configDir}
  • Environment variables envMediumReads the listed environment variables.Find Claude Code's configuration directory, and the launch settings you set in CLAUDE_* variables (extra arguments, MCP servers, setting sources, appended system prompt, extra folders)Variables: HOMECLAUDE_CONFIG_DIRCLAUDE_EXTRA_ARGSCLAUDE_MCP_CONFIGCLAUDE_STRICT_MCP_CONFIGCLAUDE_SETTING_SOURCESCLAUDE_APPEND_SYSTEM_PROMPTCLAUDE_ADD_DIRS

Files

fingerprint.ts5.1 KB
// What a history read saw of Claude Code's files, so that a later read of
// the same session can tell from `stat` and `list` alone that nothing
// changed (`ClaudeAgent.readSession`). A transcript can be hundreds of
// megabytes of JSON lines; its metadata is a few host calls.
import * as Effect from "effect/Effect";
import type { FsEntry, FsStat } from "divergence";
import type { Files } from "./files.ts";
import { mapLimit } from "./files.ts";

/// One path a read used: a file's metadata or, for a folder it listed, the
/// listing (every entry with its size and time). `seen` is `null` when the
/// path was not there.
interface Probe {
  path: string;
  list: boolean;
  seen: string | null;
}

/// The paths one read of a transcript used, the transcript itself first.
export interface Fingerprint {
  probes: Probe[];
}

const statText = (stat: FsStat | null) => (stat === null ? null : `${stat.kind} ${stat.size} ${stat.modified}`);
const listingText = (entries: readonly FsEntry[] | null) =>
  entries === null ? null : JSON.stringify(entries.map((entry) => [entry.name, entry.kind, entry.size, entry.modified]));

/// Metadata that cannot show a change: a link (it is not followed, so the
/// file behind it can change unseen), or no modification time.
const opaque = (stat: FsStat) => stat.kind === "symlink" || stat.kind === "other" || typeof stat.modified !== "number";

/// `files` for one read, noting what the read uses. A file is looked at
/// just before it is read, unless a listing of its folder already gave its
/// size and time; either way the note is no later than the read, so a write
/// during the read shows as a change next time. A note that cannot prove
/// anything (a link, no time, a read that found what the note did not, or
/// the reverse) leaves the read without a fingerprint.
export function recordReads(files: Files) {
  const probes = new Map<string, Probe>();
  const folders = new Map<string, Set<string> | null>();
  let sound = true;
  const note = (probe: Probe) => {
    const key = `${probe.list ? "list" : "stat"}:${probe.path}`;
    const known = probes.get(key);
    if (!known) probes.set(key, probe);
    else if (known.seen !== probe.seen) sound = false; // It changed during the read.
  };
  const noteStat = (path: string, stat: FsStat | null) => {
    if (stat && opaque(stat)) sound = false;
    note({ path, list: false, seen: statText(stat) });
  };
  /// Whether `path` was there just before the read of it.
  const lookAt = Effect.fnUntraced(function* (path: string) {
    const at = path.lastIndexOf("/");
    const folder = folders.get(path.slice(0, at));
    if (folder !== undefined) return folder?.has(path.slice(at + 1)) ?? false;
    const stat = yield* files.stat(path);
    noteStat(path, stat);
    return stat !== null;
  });
  const tracked: Files = {
    text: Effect.fn("Claude.files.text")(function* (path: string) {
      const there = yield* lookAt(path);
      const text = yield* files.text(path);
      if ((text !== null) !== there) sound = false;
      return text;
    }),
    bytes: Effect.fn("Claude.files.bytes")(function* (path: string) {
      const there = yield* lookAt(path);
      const bytes = yield* files.bytes(path);
      if ((bytes !== null) !== there) sound = false;
      return bytes;
    }),
    range: Effect.fn("Claude.files.range")(function* (path: string, offset: number, length: number) {
      const there = yield* lookAt(path);
      const bytes = yield* files.range(path, offset, length);
      if ((bytes !== null) !== there) sound = false;
      return bytes;
    }),
    list: Effect.fn("Claude.files.list")(function* (path: string) {
      const entries = yield* files.list(path);
      if (entries?.some(opaque)) sound = false;
      if (!folders.has(path)) folders.set(path, entries && new Set(entries.map((entry) => entry.name)));
      note({ path, list: true, seen: listingText(entries) });
      return entries;
    }),
    stat: Effect.fn("Claude.files.stat")(function* (path: string) {
      const stat = yield* files.stat(path);
      noteStat(path, stat);
      return stat;
    }),
  };
  /// The fingerprint of a completed read of the transcript at `path`, or
  /// `null` when what the read saw cannot prove a later read unchanged.
  const fingerprint = (path: string): Fingerprint | null => {
    const main = probes.get(`stat:${path}`);
    if (!sound || !main || main.seen === null) return null;
    return { probes: [main, ...[...probes.values()].filter((probe) => probe !== main)] };
  };
  return { files: tracked, fingerprint };
}

/// Whether every path behind `fingerprint` looks as it did. A path that
/// cannot be looked at now, or that changed in any way, is a change.
export const unchanged = Effect.fn("Claude.unchanged")(function* (files: Files, fingerprint: Fingerprint) {
  const look = (probe: Probe) =>
    probe.list ? Effect.map(files.list(probe.path), listingText) : Effect.map(files.stat(probe.path), statText);
  const [main, ...rest] = fingerprint.probes;
  // The transcript is what changes most: one call when it did.
  if (!main || (yield* look(main)) !== main.seen) return false;
  const now = yield* mapLimit(rest, 8, look);
  return rest.every((probe, at) => now[at] === probe.seen);
});

Versions

VersionPublishedPlugin APISizePermissionsStatus
0.2.7latestNov 21, 2026>=5 <6207.5 KB4 permissionsListed
0.2.6Nov 16, 2026>=5 <6206 KB4 permissionsListed
0.2.5Nov 11, 2026>=5 <6168.3 KB4 permissionsListed
0.2.4Nov 9, 2026>=5 <6166.1 KB4 permissionsListed
0.2.3Oct 27, 2026>=2 <4151.6 KB4 permissionsListed

Reviews and comments

0 threads · 0 reviews

No comments yet.