agentleFS
kyluskylus/agentport/CLAUDE.md

agentport

CLAUDE.md0 starsChanged 3 months agoMITView on GitHub

Plumbing between a long-lived agent and the things it talks to: the provider underneath, the chat channel in front, and the approval gate on its memory. Read README.md first for what it does; this file is about how to change it without breaking the parts that are load-bearing. CI runs the first two. The third answers a different question — whether the gate is wired into a real topic and actually firing — so run it from inside a topic…

  • Reads credentials

The file

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

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read README.md first for what it does.

    line 5

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

agentport — notes for anyone (or anything) changing this repo

Plumbing between a long-lived agent and the things it talks to: the provider underneath, the chat channel in front, and the approval gate on its memory. Read README.md first for what it does; this file is about how to change it without breaking the parts that are load-bearing.

Checks

uvx ruff@0.16.2 check .              # the version CI pins
python3 -m unittest discover -s tests
python3 hooks/role_gate.py --self-test

CI runs the first two. The third answers a different question — whether the gate is wired into a real topic and actually firing — so run it from inside a topic directory, not from here.

Invariants

One prepare stage. tools/run-topic.sh decides which channels are on, materializes their tokens, regenerates .mcp.json and produces the claude argv. Front-ends ask it (--print-argv); they never assemble a command line themselves. Every time that seam has been bypassed the copies drifted, and the drift was silent — an agent with no channels attached looks perfectly healthy and simply never receives anything.

Every deny is a claim, and every claim has a test. hooks/role_gate.py is the only thing making approval a control rather than a convention. A rule with no test disappears in the next refactor while CI stays green. When you add an allowance, add its negative case too: the test that proves the neighbouring shape is still refused is the one that matters.

The gate fails closed. An unset, empty or unreadable role is a contributor. Anything that resolves a role from something the model can type is a bug, not a convenience — AGENTPORT_ROLE=owner python3 … sets that variable for the command, not for the hook.

Secrets live in bot.env and nowhere else. Adapter .env files and access.json are regenerated from it on every launch, so flipping a channel on or off is a one-file edit. Never put a token on a command line; ps is world-readable.

Where things surprise people

  • Skills need a SKILL.md. A directory of scripts without one is invisible to Claude Code — it looks installed and never loads.
  • .git/hooks/post-commit is not carried by a clone. Re-run tools/create-topic.sh against an existing topic to reinstall it; the script is idempotent and leaves everything else alone.
  • The session-resume path depends on Claude Code storing sessions at ~/.claude/projects/<cwd with / replaced by ->/<uuid>.jsonl. If that layout changes, --continue silently stops finding prior sessions and every topic starts fresh on restart. Re-test when claude major-versions.

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.