leashd: Skill for Claude Code

.claude/skills/architecture/SKILL.md

architecture is a skill for Claude Code from vmehera123/leashd. It costs 75 tokens per session (1,595 once invoked), scanned C, original, Apache-2.0.

A map of leashd's software structure: a safety-focused daemon that connects users to coding agents and checks the agents' tool calls.

In plain words
What is it for?
Onboarding, planning changes across subsystems, tracing request flow, and locating the main files responsible for wiring and safety.
Why use it?
It gives developers a way to understand how messages, agent runtimes, safety checks, plugins, configuration, and storage fit together before changing the system.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions Codex.

This is vmehera123/leashd's own configuration. It tells Claude Code how to work on leashd itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything leashd configures →

Reuse

Borrowing it

Nothing to install: this file belongs to vmehera123/leashd. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/vmehera123/leashd/main/.claude/skills/architecture/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/vmehera123/leashd

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for architecture

README.md
[![agentmods](https://agentmods.dev/badge/skills/vmehera123/leashd/architecture.svg)](https://agentmods.dev/skills/vmehera123/leashd/architecture)
Your own site
<a href="https://agentmods.dev/skills/vmehera123/leashd/architecture"><img src="https://agentmods.dev/badge/skills/vmehera123/leashd/architecture.svg" alt="Measured on agentmods" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,595 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00075 $0.01595
Opus 5 $0.00037 $0.00797
Sonnet 5 $0.00015 $0.00319
Haiku 4.5 $0.00007 $0.00160

Measured 8d ago against content hash 77f21de553c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade C, and why

architecture scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

3. **Approval** — `require_approval` → human buttons (interactive) or AI auto-approve (autonomous). Hard-denies (credentials, `rm -rf`, `sudo`, force-push) **can never be overridden** by any approver.
.claude/skills/architecture/SKILL.md · 85 lines

How it starts

The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.

leashd architecture

Safety-first agentic coding daemon. Shape: connectors → Engine → middleware → agent runtime, with every tool call the agent makes intercepted by a three-layer safety pipeline, and an EventBus decoupling plugins. This skill is the mental model plus a file map.

Specs drift. specs/app/ has deeper numbered references, but they lag the code — 00-quick-reference.md still lists deleted modules (task_orchestrator.py, auto_approver.py, …). Treat specs and README.md as starting points; verify every claim against source before relying on it.

Request flow (one user message)

connector (web / telegram) → MultiConnector (chat_id routing)
  → Engine.handle_message → middleware chain (auth, rate limit)
    → agent runtime executes
      → each tool call → Gatekeeper: sandbox → policy → approval
  → streamed response back to the connector

Bootstrap & wiring

main.py:run()cli.py (argparse router, smart-start) → main.py:start() → one of _run_cli / _run_telegram / _run_web / _run_multi (chosen by which connectors are configured) → app.py:build_engine(config, connector).

build_engine is the single wiring point. In order it constructs: logging → MCP server config → session store + message store (both global at ~/.leashd/) → SessionManageragent = get_agent(config.agent_runtime, config)EventBusPolicyEngineSandboxEnforcerAuditLoggercreate_builtin_plugins(...) → approval + interaction coordinators (only when a connector exists) → middleware chain → git handler → Engine(...).

Components & where they live

Concern Entry point Notes
Orchestration core/engine.py (Engine) message loop, streaming, command dispatch, auto-approve mgmt
Safety pipeline core/safety/gatekeeper.py (ToolGatekeeper) orchestrates sandbox → policy → approval for every tool call
↳ sandbox core/safety/sandbox.py (SandboxEnforcer) path-scoped to approved dirs
↳ policy core/safety/policy.py + policies/*.yaml allow / deny / require_approval; compound-bash split, deny-wins
↳ approval core/safety/approvals.py (ApprovalCoordinator) human buttons or AI auto-approve
↳ audit core/safety/audit.py.leashd/audit.jsonl append-only decisions
Agent runtimes agents/registry.py + agents/runtimes/ tmux (default), claude-cli, claude-code, codex
Connectors connectors/{web,telegram,multi}.py MultiConnector routes by chat_id
Middleware middleware/{auth,rate_limit}.py run before the agent
Plugins / events core/events.py (EventBus) + plugins/registry.py pub/sub; create_builtin_plugins() registers builtins
Autonomous / task plugins/builtin/task_v4.py, autonomous_loop.py /task pipeline and post-task retry
Config core/config.py (LeashdConfig), config_store.py env prefix LEASHD_
Storage storage/{sqlite,memory}.py two-tier, see below
Web UI / hooks web/ (app.py, routes.py, ws_handler.py, tmux_hooks.py) FastAPI; also hosts the tmux hook receiver

Read the full file on GitHub · 85 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 85 lines · 75 tokens per session scan C 77f21de553c3

Subscribe to this mod's changes

architecture is a skill published in the GitHub repository vmehera123/leashd (5 stars, last pushed 13d ago), licensed Apache-2.0. It adds 75 tokens to every session and 1,595 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.