Agent setup
Agent Setup Guide
Section titled “Agent Setup Guide”Connect Attestack to your AI coding agent in a few minutes. Every integration follows the same pattern:
- Install Attestack (
attestack+attestack-mcp) - Initialize the repo (
attestack init) - Connect the agent (MCP config or session wrapper)
- Start a session before agent work (
attestack start "…") - Stop and export when done (
attestack stop && attestack bundle create)
Quick setup (automated)
Section titled “Quick setup (automated)”From your project root (after cloning or installing Attestack):
# One agent./scripts/setup-agent.sh cursor
# Several at once./scripts/setup-agent.sh cursor claude-code windsurf
# MCP binary + repo init only (any agent)./scripts/setup-agent.sh --init-onlyThe script will:
- Build or locate
attestack-mcp - Run
attestack initif needed - Write the correct MCP config for each agent
- Optionally install Cursor rules (see below)
Session workflow (all agents)
Section titled “Session workflow (all agents)”attestack start "fix auth bug"# … agent work …attestack stopattestack bundle createattestack verify .attestack/bundles/*.attestack.zipOr use the helper:
./scripts/agent-session.sh start "fix auth bug"# … agent work …./scripts/agent-session.sh finish # stop + bundle createCursor
Section titled “Cursor”Best for: MCP-native recording inside the editor.
Automated
Section titled “Automated”./scripts/setup-agent.sh cursorManual
Section titled “Manual”- Build MCP:
cargo build --release -p attestack-mcp - Copy
examples/agents/cursor/mcp.json→.cursor/mcp.json - Replace
/path/to/attestack-mcpwith your binary path (or~/.local/bin/attestack-mcp) - Restart Cursor (or reload MCP)
- Optional: copy
examples/agents/cursor/rules.mdc→.cursor/rules/attestack.mdc
Before agent work
Section titled “Before agent work”attestack initattestack start "feature work"Ask the agent to use MCP tools: attestack_status, attestack_note, attestack_agent_tool_call, attestack_agent_decision, attestack_snapshot.
Claude Code
Section titled “Claude Code”Best for: Terminal agent with project-local MCP.
Automated
Section titled “Automated”./scripts/setup-agent.sh claude-codeManual
Section titled “Manual”- Build MCP:
cargo build --release -p attestack-mcp - Copy
examples/agents/claude-code/mcp.json→.mcp.jsonin the project root
(or merge into~/.claude/settings.jsonundermcpServers) - Add
CLAUDE.mdsnippet fromexamples/agents/claude-code/CLAUDE.md.snippet - Restart Claude Code
CLI alternative (no MCP)
Section titled “CLI alternative (no MCP)”Wrap your session:
./scripts/agent-session.sh start "claude code session"claude "implement the billing fix"./scripts/agent-session.sh finishRecord decisions manually:
attestack agent decision --summary "Used existing JWT middleware"Claude Desktop
Section titled “Claude Desktop”Best for: Desktop app with global MCP.
Automated
Section titled “Automated”./scripts/setup-agent.sh claude-desktopWrites a config fragment to examples/agents/claude-desktop/generated-config.json and prints where to merge it.
Manual
Section titled “Manual”- Open Claude Desktop → Settings → Developer → Edit Config
- Merge
examples/agents/claude-desktop/mcp.jsonintomcpServers - Use an absolute path to
attestack-mcp - Set
ATTESTACK_REPO_ROOTto your project path (or open Claude from that directory)
Config file locations:
| OS | Path |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
Windsurf
Section titled “Windsurf”Best for: Codeium Windsurf (Cursor-like MCP).
Automated
Section titled “Automated”./scripts/setup-agent.sh windsurfManual
Section titled “Manual”- Copy
examples/agents/windsurf/mcp.jsoninto Windsurf MCP settings
(global:~/.codeium/windsurf/mcp_config.json, or project MCP UI) - Set absolute
attestack-mcppath andATTESTACK_REPO_ROOT
Same session workflow as Cursor.
VS Code + GitHub Copilot
Section titled “VS Code + GitHub Copilot”Copilot does not expose MCP in all setups. Use the CLI wrapper pattern:
Automated
Section titled “Automated”./scripts/setup-agent.sh copilotInstalls .github/copilot-instructions.md (optional) and prints wrapper commands.
Manual workflow
Section titled “Manual workflow”attestack initattestack start "copilot session"
# Run tests/build through Attestack so commands are recordedattestack run -- npm testattestack note "Copilot: refactored auth module"
attestack stopattestack bundle createAdd examples/agents/copilot/copilot-instructions.md to your repo as .github/copilot-instructions.md so Copilot knows to remind you to record evidence.
Cline (VS Code extension)
Section titled “Cline (VS Code extension)”Best for: MCP in VS Code.
Automated
Section titled “Automated”./scripts/setup-agent.sh clineManual
Section titled “Manual”- Open Cline → MCP Servers → Configure
- Merge
examples/agents/cline/mcp.json - Use absolute
attestack-mcppath
Or paste the JSON from examples/agents/cline/mcp.json into Cline’s MCP settings UI.
OpenCode
Section titled “OpenCode”Best for: Open-source terminal agents with MCP.
Automated
Section titled “Automated”./scripts/setup-agent.sh opencodeManual
Section titled “Manual”- Add
examples/agents/opencode/mcp.jsonto OpenCode’s MCP config (see OpenCode docs for config path) - Set
ATTESTACK_REPO_ROOTto the project root
Fallback: use ./scripts/agent-session.sh like Claude Code CLI.
Any agent (shell-only)
Section titled “Any agent (shell-only)”No MCP required. Works everywhere:
attestack initattestack start "manual agent session"
attestack run -- make test # records command + output metadataattestack note "Agent reviewed diff"attestack agent tool-call --tool apply_patch --summary "Updated auth.rs"attestack snapshot
attestack stopattestack bundle createVerify MCP is working
Section titled “Verify MCP is working”attestack start "mcp test"attestack statusIn the agent, invoke attestack_status (or ask: “call attestack_status MCP tool”). You should see the open session ID.
If MCP fails:
- Confirm
attestack-mcpis on PATH or path in config is absolute - Confirm
ATTESTACK_REPO_ROOTpoints at an initialized repo (attestack init) - Confirm an open session exists (
attestack start "…") - Restart the editor/agent after config changes
What gets recorded
Section titled “What gets recorded”| Method | Records |
|---|---|
MCP attestack_note | Session notes |
MCP attestack_agent_tool_call | Tool name + optional hashes |
MCP attestack_agent_decision | Decision summary |
MCP attestack_snapshot | Git snapshot |
attestack run -- … | Shell commands + exit codes |
attestack agent … | AI events from CLI |
Raw prompts are not stored by default — only hashes if you use attestack agent prompt --content-hash ….
Next steps
Section titled “Next steps”- Agent guide — MCP tools and CLI reference
- CI integration — record CI runs
- Scenarios — end-to-end workflows