Repository navigation
Add autter context, memory skills install and mcp connect - #80
Merged
Merged
Conversation
Three commands so every coding agent gets Autter's codebase memory: - `autter context "<task>"` posts the task (and the changed files, or --path/--symbol) to POST /api/cli/orgs/<slug>/context and prints the memory facts (rmf_ ids), wiki pages and code structure that matter as Markdown, with read-more pointers and a cursor for --since. It is the CLI form of the get_context MCP tool and reuses autter memory's org, token, remote, sharing-policy and error handling. - `autter memory skills install|preview` fetches GET /api/cli/orgs/<slug>/repo-memory/skill and writes the files into the checkout. It replaces only files marked autter_generated: true unless --force is given, and refuses paths outside the checkout. - `autter mcp connect|disconnect` registers <api base>/mcp as `autter` in Claude Code (claude mcp add, else ~/.claude.json), Codex (codex mcp add, else config.toml), Cursor, VS Code, Gemini CLI and OpenCode. Only the URL is written (OAuth). Every file is backed up first, and JSON and TOML are edited in place so comments and key order are kept. Supports --agent and --dry-run. The repo-memory skill now tells agents to call autter context first, cite fact ids, and use autter mcp connect. A 404 from either new route prints that the backend doesn't serve it yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
Three commands so every coding agent gets Autter's codebase memory, with or without MCP.
autter context "<task>"One call for what Autter knows that matters for a task: memory facts (
rmf_…ids to cite), wiki pages and code structure, ranked and cut to a token budget. It is the CLI form of theget_contextMCP tool.POST /api/cli/orgs/<slug>/contextwith the CLI token. It uses the same org and token resolution, repository-remote resolution, local-mode and excluded-repository refusal, and error mapping asautter memory.--path(repeatable; defaults to the files changed in the checkout, likeautter memory for),--symbol,--budget 300..16000,--include memory,wiki,code,--since <cursor>,--repo,--org,--json.# Autter context for <repo>, one line per item (- **<Store> · <title>** (<path>) \rmf_…`:), amore:line with the read-more tool and args (plus the CLI equivalent forget_repo_memorypages), notes on omitted/unchanged items, and a finalcursor:` line.autter memory skills install | previewGET /api/cli/orgs/<slug>/repo-memory/skill?repository=<remote>. Each returned file is written relative to the checkout root, with directories created as needed.autter_generated: truein their frontmatter) are replaced freely. Anyone else's file is kept unless--forceis given. The command refuses paths outside the checkout,.git/, symlinked escapes, and content without the marker.preview(orinstall --print) prints the files and writes nothing.installlists what it wrote and tells you to commit the files so teammates' agents get them.autter mcp connect | disconnectRegisters
<api base>/mcp(defaulthttps://api.autter.dev/mcp) asautterin each installed agent's user-level MCP config. Only the URL is written: the server signs people in with OAuth on first use.claude mcp add --transport http --scope user autter <url>whenclaudeis on PATH; elsemcpServers.autter = {"type":"http","url"}in~/.claude.json($CLAUDE_CONFIG_DIR/.claude.jsonwhen set)codex mcp add autter --url <url>whencodexis on PATH; else[mcp_servers.autter] urlin~/.codex/config.toml. Tells you to runcodex mcp login auttermcpServers.autter = {"url"}in~/.cursor/mcp.jsonservers.autter = {"type":"http","url"}in the usermcp.json, plus each profile that already has onemcpServers.autter = {"httpUrl"}in~/.gemini/settings.jsonmcp.autter = {"type":"remote","url","enabled":true}in~/.config/opencode/opencode.json(or an existingopencode.jsonc)--agent(repeatable) picks agents.--dry-runshows the commands and diffs without running or writing anything.<file>.autter-backup-<time>before it is written.toml_edit, so comments, key order and indentation survive.autterentry instead of adding a second one. If an agent's own CLI fails, the command falls back to editing that agent's file.disconnectremoves only theautterentry, usingclaude mcp remove/codex mcp removewhere they exist.Also
repo-memoryskill now says: callautter context "<task>"first (orget_contextwhen the MCP server is connected), cite fact ids (rmf_…) when a fact changes what you do, and runautter mcp connectto connect agents.changelog/agent-context-and-mcp-connect.md.toml_edit 0.23, which was already inCargo.locktransitively. Theserde_jsonfeature is now enabled onjsonc-parser. No new crates are downloaded.Backend dependency
This PR depends on Autter-dev/autter-monorepo#636 (the
/contextroute) and on the Phase 4 monorepo PR (the/repo-memory/skillroute) being deployed. Until then, both commands print a clear message on the route's 404 instead of a generic error:autter contextyet (POST /context). Useautter memory forandautter memory searchuntil it is updated."A 404 that carries a message, such as an unknown repository, still shows that message, the same way
autter memoryhandles it.Tests
context;--force, missing marker, unsafe paths, symlink escape;tests/integration/context_command.rs) check that nothing is sent in local mode or for excluded repositories, that the connected path needs a login, and that bad usage is rejected.Local results:
cargo build: passes.cargo testin daemon mode, 8 threads: all 2050 lib tests passed, including the 28 new ones, and all 6 new integration tests passed.utf8_filenames,worktrees,windsurf,virtual_attribution_unit, and onecodextest.cargo clippy --all-targets -D warningson Rust 1.93.0: clean.daemon.rs,blame.rs,config.rs, …).🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.