Reason Network: your team's coding agents, talking to each other. The engine behind `reason network`.
Rust agent-to-agentai-agentsclaude-codecodexcoding-agentscursorgrokirohmcpmcp-servermulti-agentpeer-to-peerreason
The plugin ships only the tools; agents learn to join from them
Lars Talianbc56d5d007c3
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonindex 497fcd7..5d2dcbf 100644--- a/.claude-plugin/marketplace.json+++ b/.claude-plugin/marketplace.json@@ -8,7 +8,7 @@{"name": "tincan","source": "./plugins/tincan",- "description": "Your agents, talking to your teammates' agents: tincan's tools and skill for Claude Code.",+ "description": "Your agents, talking to your teammates' agents: tincan's tools for Claude Code.","homepage": "https://larstalian.github.io/tincan"}]diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.ymlindex 448f2b6..554c3bc 100644--- a/.github/workflows/pages.yml+++ b/.github/workflows/pages.yml@@ -5,7 +5,7 @@ name: pageson:push:branches: [main]- paths: ["site/**", "plugins/tincan/skills/**", "install.sh", "install.ps1", ".github/workflows/pages.yml"]+ paths: ["site/**", "install.sh", "install.ps1", ".github/workflows/pages.yml"]workflow_dispatch:permissions:@@ -25,7 +25,7 @@ jobs:url: ${{ steps.deploy.outputs.page_url }}steps:- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4- - run: cp install.sh install.ps1 site/ && mkdir -p site/skill && cp plugins/tincan/skills/tincan/SKILL.md site/skill/+ - run: cp install.sh install.ps1 site/- uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5- uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3with:diff --git a/DESIGN.md b/DESIGN.mdindex f08a58e..9e6b649 100644--- a/DESIGN.md+++ b/DESIGN.md@@ -240,8 +240,9 @@ edits): Claude Code plugin or `claude mcp add --scope user` + hooks, `~/.codex/c`tincan setup [--remove]`, launchd/systemd service, `tincan doctor`. Amp: MCP only, by hand.- **M3, ship** (done, pending a first tagged release): GitHub Actions builds for macOS and Linux, `install.sh`(install and join in one line), GitHub Pages site. Later: Homebrew. The repo is a Claude Code- plugin marketplace: its plugin brings the MCP server (installing tincan first if needed; `tincan setup` then- leaves Claude Code alone) and the skill (`plugins/tincan/skills/tincan/SKILL.md`, also on the site).+ plugin marketplace: its plugin brings only the MCP server (installing tincan first if needed; `tincan setup` then+ leaves Claude Code alone), no skill: the skill teaches the CLI, which inside Claude Code would compete with the+ tools.- **M4, team features**: file-overlap warnings ("bob/api-codex is also editing src/auth.rs", from`PostToolUse` edit paths), anchor mailbox and history, hold/approve notifications, web dashboard.diff --git a/README.md b/README.mdindex 2167a98..38ddd29 100644--- a/README.md+++ b/README.md@@ -25,7 +25,7 @@ irm https://larstalian.github.io/tincan/install.ps1 | iex```Or in Claude Code (macOS and Linux): `/plugin marketplace add larstalian/tincan`, `/plugin install tincan@tincan`,-restart, and ask Claude to start or join a team.+restart, and ask Claude to start or join a team. Already set up? Run `tincan setup` once so the tools don't show twice.You get a team link (it's on your clipboard). Send it to your teammates: they open it, paste one command, typetheir name, and they're in. Or they just tell their agent "join my tincan team: <link>".@@ -89,6 +89,8 @@ service. `tincan who` shows the team. Agents without tincan's tools, like cloudtincan setup --remove && tincan leave && rm -rf ~/.tincan ~/.local/bin/tincan```+With the Claude Code plugin, also `claude plugin uninstall tincan@tincan`.+On Windows, in PowerShell: `tincan setup --remove; tincan leave; Remove-Item -Recurse -Force ~\.tincan, ~\.local\bin\tincan*`## Contributingdiff --git a/plugins/tincan/.claude-plugin/plugin.json b/plugins/tincan/.claude-plugin/plugin.jsonindex f5fdd71..780e28a 100644--- a/plugins/tincan/.claude-plugin/plugin.json+++ b/plugins/tincan/.claude-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "tincan",- "description": "Your agents, talking to your teammates' agents. Installs tincan if needed, adds its tools, and the skill for joining a team and messaging the right session. macOS and Linux.",+ "description": "Your agents, talking to your teammates' agents. Installs tincan if needed and adds its tools to Claude Code. macOS and Linux.","author": {"name": "Lars Talian"},diff --git a/plugins/tincan/scripts/tincan-mcp b/plugins/tincan/scripts/tincan-mcpindex 851868f..e4e15a6 100755--- a/plugins/tincan/scripts/tincan-mcp+++ b/plugins/tincan/scripts/tincan-mcp@@ -1,10 +1,11 @@#!/bin/sh# Claude Code starts tincan's MCP server with this, installing tincan first on a machine that doesn't have it.# Standard output is the MCP connection, so anything else goes to standard error.-bin="$HOME/.local/bin/tincan"+bin="${TINCAN_BIN_DIR:-$HOME/.local/bin}/tincan"[ -x "$bin" ] || bin="$(command -v tincan 2>/dev/null)"if [ -z "$bin" ]; then+ command -v curl >/dev/null 2>&1 || { echo "tincan: installing needs curl" >&2; exit 1; }curl -fsSL https://larstalian.github.io/tincan/install.sh | TINCAN_NO_PROMPT=1 sh >&2 || exit 1- bin="$HOME/.local/bin/tincan"+ bin="${TINCAN_BIN_DIR:-$HOME/.local/bin}/tincan"fiexec "$bin" mcpdiff --git a/plugins/tincan/skills/tincan/SKILL.md b/site/skill/SKILL.mdsimilarity index 74%rename from plugins/tincan/skills/tincan/SKILL.mdrename to site/skill/SKILL.mdindex ce5c725..6298d1e 100644--- a/plugins/tincan/skills/tincan/SKILL.md+++ b/site/skill/SKILL.md@@ -8,12 +8,10 @@ description: Talk with your team's coding agents over tincan. See who is workingtincan connects coding agents across a team's machines. Every session on every teammate's machine shows up in alive directory, and any of them can message another. You use it through the `tincan` command.-## Joining or starting a team+## Not installed yet?If your user gave you a team link (`https://…/tincan/join/#tincan1…`), ask what name teammates should see (for-your user's own cloud agent, their own name). If `tincan` is installed (the tincan plugin for Claude Code installs-it), run `tincan join '<the whole link>' --as <name>`. Otherwise install and join in one go, with the whole link-exactly as given:+your user's own cloud agent, their own name), then run, with the whole link exactly as given:```shcurl -fsSL https://larstalian.github.io/tincan/install.sh | sh -s -- '<the whole link>' --as <name>@@ -25,8 +23,6 @@ On Windows:powershell -c "& ([scriptblock]::Create((irm https://larstalian.github.io/tincan/install.ps1))) '<the whole link>' --as <name>"```-To start a team instead: `tincan init <team> --as <name>`, then `tincan link` prints the link for teammates.-## Commands- `tincan who`: every person, machine and session, with what each is working on.@@ -36,12 +32,6 @@ To start a team instead: `tincan init <team> --as <name>`, then `tincan link` pr- `tincan listen --as <name>`: waits (up to 10 minutes) for the next message to you, prints it, and exits. Youare reachable as `<your user>/<name>`. After handling a message and replying, run it again to keep listening.-## Picking the recipient--Each message interrupts someone else's agent, so send to the one session that owns what you need. Narrow-`tincan who` (or `list_team`) by the repo the question is about, then the branch, then what each is doing, then-the person your user named. Still more than one? Ask your user which. None? Tell your user who is around instead.-## How to behave- Message only when you need something from another agent or it needs something from you: a blocking question, adiff --git a/src/claude.rs b/src/claude.rsindex 698b0f5..635b101 100644--- a/src/claude.rs+++ b/src/claude.rs@@ -65,12 +65,14 @@ pub fn wired() -> bool {})}-/// Whether Claude Code has the tincan plugin on, which brings its own tincan MCP server. (Its launcher is a shell-/// script: macOS and Linux.)+/// Whether Claude Code has the tincan plugin installed and on, which brings its own tincan MCP server. (Its launcher+/// is a shell script: macOS and Linux.)pub fn plugin() -> bool {+ let dir = paths::claude_dir();cfg!(unix)- && json(&paths::claude_dir().join("settings.json"))- .is_some_and(|v| v["enabledPlugins"]["tincan@tincan"] == true)+ && json(&dir.join("settings.json")).is_some_and(|v| v["enabledPlugins"]["tincan@tincan"] == true)+ && json(&dir.join("plugins/installed_plugins.json"))+ .is_some_and(|v| v["plugins"]["tincan@tincan"].as_array().is_some_and(|a| !a.is_empty()))}fn json(file: &std::path::Path) -> Option<serde_json::Value> {diff --git a/src/mcp.rs b/src/mcp.rsindex 1185432..4e11a33 100644--- a/src/mcp.rs+++ b/src/mcp.rs@@ -27,8 +27,8 @@ use std::{};use tokio::sync::mpsc;-/// How agents should use tincan, kept once: in the plugin's skill, which cloud agents also read on the site.-const SKILL: &str = include_str!("../plugins/tincan/skills/tincan/SKILL.md");+/// How agents should use tincan, kept once: in the skill, which cloud agents read on the site.+const SKILL: &str = include_str!("../site/skill/SKILL.md");fn instructions() -> String {// Windows checkouts may have turned the file's line ends into \r\n.@@ -267,8 +267,13 @@ impl TincanMcp {Ok(key)}- /// Tool result text, plus a note about unread mail so pull-only agents notice it.+ /// Tool result text, plus a note about unread mail so pull-only agents notice it, and how to join a team on a+ /// machine that isn't in one.async fn finish(&self, key: &str, res: Result<String>, notice: bool) -> CallToolResult {+ let join = match self.link.call::<TeamInfo>(Request::Team).await {+ Err(e) if e.to_string().contains("not in a team") => Some(join_hint()),+ _ => None,+ };match res {Ok(mut text) => {if notice@@ -278,9 +283,16 @@ impl TincanMcp {text.push_str("\n\n");text.push_str(&n);}+ if let Some(j) = join {+ text.push_str("\n\n");+ text.push_str(&j);+ }CallToolResult::success(vec![ContentBlock::text(text)])}- Err(e) => failure(e),+ Err(e) => failure(match join {+ Some(j) => anyhow::anyhow!("{e:#}\n\n{j}"),+ None => e,+ }),}}@@ -301,6 +313,15 @@ fn failure(e: anyhow::Error) -> CallToolResult {CallToolResult::error(vec![ContentBlock::text(format!("{e:#}"))])}+/// Getting this machine into a team, with this binary's own path (the plugin's may not be on PATH).+fn join_hint() -> String {+ let exe = crate::setup::exe().map_or_else(|_| "tincan".into(), |p| p.display().to_string());+ format!(+ "This machine isn't in a team yet. Ask your user for the team link and the name teammates should see, then run \+ `{exe} join '<link>' --as <name>`; to start a team instead, `{exe} init <team> --as <name>`."+ )+}+#[cfg(test)]mod tests {#[test]diff --git a/src/setup.rs b/src/setup.rsindex f094a6a..270a8cd 100644--- a/src/setup.rs+++ b/src/setup.rs@@ -179,7 +179,7 @@ fn claude(exe: &Path, remove: bool, dry: bool) -> Result<Option<Report>> {let get = Command::new(&bin).args(["mcp", "get", "tincan"]).stdin(std::process::Stdio::null()).output()?;let existing = get.status.success();// The tincan plugin brings its own server: a second one would show every tool twice.- let plugin = !remove && crate::claude::plugin();+ let plugin = crate::claude::plugin();let current = existing && !plugin && String::from_utf8_lossy(&get.stdout).contains(&exe.display().to_string());if remove || (existing && !current) {if existing && !dry {@@ -190,6 +190,10 @@ fn claude(exe: &Path, remove: bool, dry: bool) -> Result<Option<Report>> {}if remove {r.lines.push(if existing { "removed the tincan MCP server" } else { "nothing to remove" }.into());+ if plugin {+ r.notes+ .push("Claude Code still has the tincan plugin: `claude plugin uninstall tincan@tincan`.".into());+ }return Ok(Some(r));}}