agentleFS
ProjectAJ14ProjectAJ14/eklavya/cli/CLAUDE.md

eklavya / cli

CLAUDE.md29 starsChanged 22 days agoMITView on GitHub

This directory contains the POSIX eklavya-gate script. The eklavya binary (config, doctor, install, dashboard, etc.) lives in mcp/src/cli.ts. Read the root CLAUDE.md for the repository contract. The terminal gate requires both a per-repository installation and project quiz.enforced: true. eklavya install does not install a git hook. scripts/install-git-hook.sh writes into the common Git directory so linked worktrees use the same hook. It preserves an existing hook as pre-commit.local and runs that first; --uninstall restores it. With core.hooksPath configured, it prints the…

The file

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the root CLAUDE.md for the repository contract.

    line 5
  2. Very specific:

    Use POSIX sh; the installed hook runs through /bin/sh.

    line 31
  3. Distinctive:

    Do not add an operational error that prevents a commit.

    line 37

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 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

Working in cli/

This directory contains the POSIX eklavya-gate script. The eklavya binary (config, doctor, install, dashboard, etc.) lives in mcp/src/cli.ts. Read the root CLAUDE.md for the repository contract.

Installation and scope

The terminal gate requires both a per-repository installation and project quiz.enforced: true. eklavya install does not install a git hook.

scripts/install-git-hook.sh writes into the common Git directory so linked worktrees use the same hook. It preserves an existing hook as pre-commit.local and runs that first; --uninstall restores it. With core.hooksPath configured, it prints the integration line and exits 2 without installing anything.

The installed wrapper tries the managed runtime, then the original installation path, and invokes the script with sh. Missing both paths warns and allows the commit. Preserve this fallback: updates can move plugin directories. eklavya uninstall warns about the hook and prints removal instructions; it does not remove the hook itself.

Project config lives in ~/.eklavya/projects/<slug>/config.json; worktrees fold to their main checkout. The script reads the old <repo>/.eklavya.json only as a fallback and never migrates it. Global enforcement alone does not activate this gate, but a global quiz.enabled: false releases it unless overridden by the project. Keep legacy mode compatibility and explicit false values.

Fail-open contract

Use POSIX sh; the installed hook runs through /bin/sh. Missing repository, config, jq, sqlite3, database or gate row allows the commit. Database query errors also allow it. Missing dependencies warn on stderr.

Exit 1 only when the latest gate row for this checkout or, in a linked worktree, its main checkout exists and passed is not 1. Do not add an operational error that prevents a commit.

Keep duplicated logic aligned

Script responsibilitySource and verification
Config merge and legacy mode aliasmcp/src/config.ts; shared fixtures in mcp/test/gate.test.ts
Project slug and worktree foldingmcp/src/paths.ts; physical paths must also handle symlinks
Latest repository gate lookupgates schema and syncGate in mcp/src/store.ts
In-session commit detectionmcp/src/hooks/pre-tool-gate.ts and commit-lib.ts

The script trusts persisted passed; it must not duplicate passing-grade or threshold arithmetic. It looks up the latest gate keyed on the checkout or its main checkout, whereas the in-session hook uses a session ID. In jq, use explicit if/elif for booleans: // treats false as absent and can re-enable a disabled legacy gate.

Documentation and verification

In the same PR, update the manual commit-gate.mdx for installer, prerequisite, scope, bypass or failure behavior changes. Check configuration.mdx, skills/setup/SKILL.md and the commit-gate acceptance check in CONTRIBUTING.md when their claims change. Every claim about terminal enforcement must include both installation and project enforcement.

From mcp/, run npm test -- gate. It builds the runtime and exercises the real script and installer in temporary repositories, including an actual commit. Build web/ after documentation changes; report any live acceptance test not run.

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.