agentleFS
ThirdKeyAIThirdKeyAI/symbi-claude-code/CLAUDE.md

symbi-claude-code

CLAUDE.md4 starsChanged 9 months agoApache-2.0View on GitHub

This project is a Claude Code plugin that delivers default-on protection against secret reads, sensitive writes, and destructive shell commands. The runtime upgrade path (Cedar evaluation, MCP tools, governed agents) is opt-in and only activates when the symbi binary is installed. The plugin's default behavior is Tier 2 protection. No local-policy.toml required. The built-in deny defaults block: - Reads: .env, .env.* (except .env.example/.sample/.test), .ssh/, .aws/, .gcp/, gcloud/, .npmrc, .pypirc, .netrc, *.pem, *.key, id_rsa/id_ed25519/id_ecdsa, secrets/, credentials/, config/database.yml, config/credentials.json, config/master.key. - Writes:…

  • Pipes a download into a shell
  • Reads credentials
  • Deletes or force-pushes
  • Commits and pushes

The file

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

4 rules. About 0 are common, 0 are distinctive, and 4 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.

  • 4

    Very specific

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

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

    Writes: all of the above plus .github/workflows/.

    line 18
  2. Very specific:

    All hooks check the .symbiont/disabled marker first and the SYMBIONT_MANAGED env var second.

    line 54
  3. Very specific:

    When the symbi binary is installed, additional features light up automatically — no plugin changes required:

    line 95
  4. Very specific:

    When Symbiont's CliExecutor spawns Claude Code as a governed subprocess, it sets SYMBIONT_MANAGED=true.

    line 108

≈ “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

Symbiont Plugin Context

This project is a Claude Code plugin that delivers default-on protection against secret reads, sensitive writes, and destructive shell commands. The runtime upgrade path (Cedar evaluation, MCP tools, governed agents) is opt-in and only activates when the symbi binary is installed.

Default Posture (Tier 2)

The plugin's default behavior is Tier 2 protection. No local-policy.toml required. The built-in deny defaults block:

  • Reads: .env, .env.* (except .env.example/.sample/.test), .ssh/, .aws/, .gcp/, gcloud/, .npmrc, .pypirc, .netrc, *.pem, *.key, id_rsa/id_ed25519/id_ecdsa, secrets/, credentials/, config/database.yml, config/credentials.json, config/master.key.
  • Writes: all of the above plus .github/workflows/.
  • Bash: rm -rf /, rm -rf /*, rm -rf ~, git push --force/-f, curl ... | sh|bash, wget ... | sh|bash, chmod 777, mkfs*, dd if=, fork bombs.
  • sudo is warned (block in [mode]=strict).

.symbiont/local-policy.toml extends these defaults with project-specific rules; it never replaces them unless [mode]=permissive is set.

Modes

[mode] in .symbiont/local-policy.toml:

  • balanced (default) — built-ins active, sudo warns
  • strict — built-ins active, sudo hard-blocked
  • permissive — built-ins disabled, only the local TOML enforces

Kill switch

.symbiont/disabled makes every hook no-op (still exits 0). Use /symbi-disable to drop it, /symbi-enable to remove it.

Hooks (always loaded)

  • scripts/install-check.sh — SessionStart. Detects JSON backend (jq → python3 → bash), nudges on sensitive files when no local-policy.toml exists, runs SchemaPin verification when symbi is on PATH.
  • scripts/policy-guard.sh — PreToolUse. Hard-blocks deny matches (plain-text reason on stderr + exit 2; sudo warns via stdout systemMessage).
  • scripts/policy-log.sh — PreToolUse. Silent advisory slot (recording is handled by audit-log.sh; retained for future signals).
  • scripts/audit-log.sh — PostToolUse. Appends JSONL to .symbiont/audit/tool-usage.jsonl. Always logs (no symbiont.toml gate).

All hooks check the .symbiont/disabled marker first and the SYMBIONT_MANAGED env var second.

JSON parsing in hooks

scripts/lib/json-extract.sh exposes json_field <payload> <dotted.path>. Backend selection on first use:

  1. jq if present
  2. python3 (or python) if present
  3. Pure-bash awk extractor — narrow, refuses payloads with \u escapes

The bash fallback only handles the field shapes Claude Code emits (tool_name, tool_input.file_path, tool_input.path, tool_input.command). Refusing exotic payloads is fail-safe: an empty return means "no match" so the policy guard does not block what it cannot parse, and never blocks based on misinterpreted bytes.

Slash commands

Plugin-only (no runtime needed):

  • /symbi-protect — print active defaults, drop a starter policy file
  • /symbi-disable / /symbi-enable — kill-switch toggle
  • /symbi-status — health check
  • /symbi-audit — query the audit log

Runtime-required (need symbi binary):

  • /symbi-init — scaffold a runtime-managed project
  • /symbi-policy, /symbi-verify, /symbi-pin, /symbi-dsl, /symbi-agent-sdk

Tests

tests/run-tests.sh covers built-in deny patterns, JSON backend parity, chain-bypass resistance, allowlist exemptions, mode switching, and the kill-switch marker. Run before committing changes to hooks.

Runtime upgrade path (opt-in)

When the symbi binary is installed, additional features light up automatically — no plugin changes required:

  • Tier 3 (Cedar evaluation): policy-guard.sh runs symbi policy evaluate --stdin --policies ./policies/ after the built-in checks pass.
  • MCP tools: the plugin connects to a symbi mcp server exposing invoke_agent, list_agents, parse_dsl, get_agent_dsl, get_agents_md, verify_schema.
  • SchemaPin: install-check.sh verifies pinned MCP servers on session start.

Mode B (ORGA-managed)

When Symbiont's CliExecutor spawns Claude Code as a governed subprocess, it sets SYMBIONT_MANAGED=true. All hooks early-return so the outer ORGA Gate is the single source of truth for hard enforcement.

Override .mcp.json at the project or user level to point at the parent runtime:

{
  "mcpServers": {
    "symbi": { "type": "http", "url": "${SYMBIONT_MCP_URL}" }
  }
}

Mode B environment variables:

  • SYMBIONT_MANAGED=true
  • SYMBIONT_MCP_URL
  • SYMBIONT_RUNTIME_SOCKET
  • SYMBIONT_SESSION_ID
  • SYMBIONT_BUDGET_TOKENS
  • SYMBIONT_BUDGET_TIMEOUT

File conventions

PathPurpose
.symbiont/local-policy.tomlProject deny/allow rules + mode
.symbiont/disabledKill-switch marker
.symbiont/audit/Local audit log
agents/*.dsl(runtime) Agent DSL definitions
policies/*.cedar(runtime) Cedar policies
symbiont.toml(runtime) Runtime configuration
AGENTS.md(runtime) Agent manifest

On Session Start

scripts/install-check.sh detects the JSON backend and prints a one-line nudge if sensitive files exist with no local-policy.toml yet. It does not require any user action and never blocks.

Implementation Plan

See ROADMAP.md for the full implementation history and phase details.

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.