Skip to main content

hatchway

A narrow, logged opening through which an outside agent reaches your tools.

pip install hatchway
hatchway authorize "ssh-ed25519 AAAA... my-agent" --agent assistant   # one confined key
hatchway check "crowsnest triage"                                     # what the gate would do

An agent that lives somewhere else (a personal assistant on its own cloud VM, another machine's scheduler, a phone shortcut) gets one SSH key. That key can do exactly one thing: run hatchway gate, which reads the requested command line, checks it against a profile (an allowlist kept as a TOML file), logs the call, and runs the allowed command directly, never through a shell. Anything not in the profile is refused with a reason.

It is the "reach in" half of connecting an outside agent to the tools on your machine, with no new server, no open port and no new dependency: OpenSSH already has forced commands, and hatchway is the policy and the bookkeeping around one.

What you get

  • An allowlist as data. A rule names the words the agent sends, the command that actually runs (with fixed arguments the agent cannot remove, such as --no-verify), and exactly which flags and names it may add. Names are checked against a pattern and passed after --, so they can never be read as options. Shell characters are refused outright.
  • A confined key. hatchway authorize writes one authorized_keys line with command="hatchway gate --agent NAME", restrict (no shell, no port, agent or X11 forwarding, no pty), and by default from="100.64.0.0/10,fd7a:115c:a1e0::/48", so the key works only from a Tailscale tailnet even if sshd is reachable elsewhere. It keeps every other line, backs the file up first, and is idempotent. hatchway revoke --agent NAME takes it out.
  • A log of every call in ~/.local/share/hatchway/calls.jsonl: when, which agent, from where, what was asked, allowed or refused, exit status. Never the output. hatchway log shows the tail.
  • Gated classes. A rule can belong to a class that stays off until a flag file exists. The bundled profile's dispatch class (starting a Claude Code session) needs both ~/.config/hatchway/allow-dispatch and a list of directories it may start sessions in.
  • A snapshot for pulling instead of waiting. hatchway snapshot runs the profile's snapshot requests (through the same allowlist) and writes the answers atomically to ~/.local/share/hatchway/out/, with an index.json. The agent reads them through the gate (snapshot triage.md) without waiting for anything to run. hatchway schedule --every 300 keeps them fresh with launchd (macOS) or a systemd user timer (Linux).
  • Skills for the agents that set it up. hatchway install-skills links the bundled skills into one or more Claude Code homes.

The bundled profile: claude-fleet

For a machine running Claude Code sessions watched by crowsnest (live sessions) and openloops (what sessions left owed or blocked). hatchway help prints it, and it is what the agent gets when it sends help:

Request Runs
crowsnest [--brief|--json] the roster across every configured Claude home
crowsnest triage [-q] [--json] what needs you, what is safe to close, what is working
crowsnest show|turns|recap|brief NAME one session (show and turns quote its transcript)
crowsnest ledger [NAME...], groups, synopsis GROUP, questions, lineage, report the rest of crowsnest's read side
ol, ol owed, ol blocked, ol dashboard openloops; owed and dashboard always with --no-verify (verify predicates are commands taken from issue bodies, and a remote request never runs them); blocked runs no predicate, so it takes no such flag
snapshot [FILE] list or print the snapshot files
crowsnest spawn NAME --cwd DIR --prompt TEXT gated: starts a session on sonnet, in a directory under the dispatch roots

Nothing in it kills, reaps, messages or writes into a running session.

To change it for one machine, copy hatchway/data/profiles/claude-fleet.toml to ~/.config/hatchway/profiles/<name>.toml, edit it, and set profile = "<name>" in ~/.config/hatchway/config.toml (or pass --profile <name> to authorize, which puts it in that key's forced command).

The second transport: MCP

The same profile can be served as MCP tools, for an agent that speaks MCP but cannot open SSH (a claude.ai custom connector, so also the Claude app's voice mode; Claude Desktop; another machine's MCP client). One tool per rule: its tool name, its flags and names as typed parameters, its help as the description. Every call is turned back into the request words and goes through the gate, so it is decided, logged and locked exactly as an SSH call is.

pip install 'hatchway[mcp]'
hatchway mcp --profile claude-ai --list                    # the tools, with their signatures
hatchway mcp --profile claude-ai --http 8799               # serve on 127.0.0.1:8799/mcp
hatchway mcp --profile claude-ai --ssh me@laptop --identity key   # each call through that machine's gate
from hatchway.mcp import fan_out, mk_server, routed_runner, ssh_runner, with_fallback

server = ssh_runner("root@127.0.0.1", identity="key")  # this machine, as another user
laptop = ssh_runner(
    "me@127.0.0.1", identity="key", ssh=("ssh", "-T", "-p", "2222")
)  # through a tunnel
runner = routed_runner(server, {"crowsnest": with_fallback(laptop, server)})
# or ask every machine at once and merge, each row tagged [laptop] / [server]:
runner = routed_runner(server, {"crowsnest": fan_out({"laptop": laptop, "server": server})})
app = mk_server("claude-ai", runner=runner, auth=..., classes=("read", "handoff")).http_app()

The runner is the seam: local_runner runs the gate on this machine; ssh_runner sends the request to a key whose forced command is the gate, so a server process running as its own account reaches tools it holds no credentials for. routed_runner sends a request to the runner of the longest leading words it matches ("crowsnest", "crowsnest intent"); with_fallback asks a second machine only when the first cannot be reached; fan_out asks several machines in parallel and merges their answers, each line tagged with its machine, and names on its own line any machine that did not answer, so a partial list never reads as a whole one. Use it for reads only: a request that changes something goes to one runner. A rule's reply (a template over {out}, the command's output) shapes a successful answer for these transports, as post_handoff does to return a line to paste into Claude Code. Authentication is the job of whoever serves it on a network (auth= goes to FastMCP). Only the classes you name are offered (default: read). Long answers are paged: every tool takes offset, and the answer says where to resume.

The bundled claude-ai profile is shaped for a conversation, typed or spoken: Claude Code sessions (session_triage, session_roster, session_recap, session_turns, session_ledger), open loops (owed_by_owner, blocked_work), the owner's reminders (list_reminders; and add_reminder, close_reminder, snooze_reminder in the reminder class, off until allow-reminder exists; a push never reveals its title), GitHub read-only (list_repos, repo_overview, read_repo_file, list_issues, read_issue; a repository whose name contains secret is refused), and a handoff inbox shared with Claude Code through annals (read_handoffs, read_document and document_info, which take an annals link as handed, on any annals the machine's annals config can read, and post_handoff in the handoff class, whose text goes to the command's standard input, never its arguments). A machine adds what only it has in a private profile that starts with extends = "claude-ai".

Configuration

~/.config/hatchway/config.toml, every key optional:

profile = "claude-fleet"
path = ["~/.local/bin"]           # where the commands live (sshd's PATH is minimal)
timeout = 120
[roots]                           # extra directories file rules may serve, by name
[dispatch]
roots = ["~/projects"]            # where a gated spawn may start a session
[snapshot]
to = ""                           # optional private copy: a local dir or host:path

The security model, in one paragraph

What the key can do is the profile, so read it before you authorise a key. Read commands still send what they read to wherever the agent runs: crowsnest show quotes your sessions' transcripts, so authorise only an agent you would show them to. Keep the from= restriction. If the agent joins your Tailscale tailnet, give it a policy that allows only TCP port 22 to the machines it serves and no Tailscale SSH rule: Tailscale SSH authenticates by tailnet identity and never reads authorized_keys, so it would bypass the gate entirely. 100.64.0.0/10 is also ordinary carrier-grade NAT space, so once you know the agent's own tailnet address, narrow --from to it (--from 100.x.y.z/32). Leave dispatch off until you have watched the log for a while: a session it starts runs code as you. The bundled rule pins --model sonnet and --permission-mode default (the session asks before acting), refuses a prompt that starts with -, and starts sessions only under the directories you list.

Also built in: the commands run with an allowlisted environment (nothing the connecting client can set reaches them beyond LANG), in their own process group so a timeout stops their children too, one call at a time per agent (a concurrent call is refused with exit 75), and every allowed call is logged before it runs, so a dropped connection still leaves its line.

Agents

  • hatchway skill: install and verify a connection for an outside agent on this machine (the steps, the checks, the Tailscale policy).
  • hatchway-muse skill: when a task would be better handed to a personal Muse agent (Meta), which integration pattern fits, and the exact prompt to give it.

Metadata

Release files for hatchway 0.0.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hatchway 0.0.14
File Size Uploaded Provenance Actions
hatchway-0.0.14.tar.gz 54.4 kB Without provenance Details for hatchway-0.0.14.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hatchway 0.0.14
File Interpreter ABI Platform Actions
hatchway-0.0.14-py3-none-any.whl Python 3 none any Details for hatchway-0.0.14-py3-none-any.whl

Total release size: 105.0 kB

Release files / hatchway-0.0.14.tar.gz

Download URL hatchway-0.0.14.tar.gz
Size 54.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6b5b5e3977389f80083dc7991eb5827e469b7ff13946de9be3632e05d961cb2c
BLAKE2b-256 checksum
How to use checksums
2545a7203e37530e149dcba23a9c937b91f7751d22d6caa465c1f3424ae9614d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / hatchway-0.0.14-py3-none-any.whl

Download URL hatchway-0.0.14-py3-none-any.whl
Size 50.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae349304772e8a4699b45a7a18b0532b08853618b1b119bb9cf5ef3aea710224
BLAKE2b-256 checksum
How to use checksums
98437193e4e49a9b6179e9957766ab0a2ffa8d64680decd5f429d3d768b2e6e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for hatchway 0.0.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page