User guide

Connect it, configure it, use it well.

How to get useful context into your AI tools once Detour is running. Not running yet? Start with the quick start.

What it does

Detour is a small app that runs in Docker on your computer. You save the context your AI tools do not carry between sessions: rules, decisions, runbooks, prompts, skills, and notes. Your AI tool then retrieves it through a local, read-only MCP connection when the work needs it.

Context is grouped into Detours:

  • Global Detour: applies across all of your work.
  • Project Detour: applies only to one project.
  • Sub-detour: optional, advanced context beneath one Project Detour.

When rules conflict, Global outranks Project and Project outranks Sub-detour. Nothing leaves your computer unless you export a bundle yourself.

Connect your AI tool

  1. Open Connections in the portal and create a key named for the tool, for example “Claude Code on laptop”. Copy it now; it is shown only once.
  2. Add Detour as an HTTP MCP server in your tool using:
    Endpoint: http://127.0.0.1:3788/mcp
    Header:   Authorization: Bearer <YOUR_DETOUR_KEY>
    Connections shows ready-to-copy configuration for VS Code, Codex, Claude Code, Claude Desktop, and Cursor.
  3. Check it works by asking your tool: “List my Detours.”

Detour gives your tool four read-only tools:

list_detour_routesLists your Detours with scope so the AI can pick the right one.
get_detour_routeReturns one Detour's context with Global and parent context ranked above it.
search_detour_artifactsSearches saved context by title, body, or tag.
get_detour_artifactReads one saved item in full.

Detour cannot run commands, change files, or write data through MCP.

Use it well

01

Start with one Global Detour

Put the rules that apply everywhere in a single Global Detour: how you review, what never ships, how you name things. Add a Project Detour for each repository only when it has context of its own.

02

Save what lasts, not what happened

Decisions, runbooks, review checklists, conventions, prompts, and skills retrieve well. Chat transcripts and scratch notes rarely do. If you would tell a new teammate, save it.

03

Use environment flags for operating rules

Set non-secret flags such as NEVER_DELETE=true or TF_WORKSPACE=staging in Settings for every Detour, or on one Detour to override it. They reach your AI with the rest of the context. Names that look like secrets are rejected.

04

Keep tags consistent with tag sets

Define a tag set such as Stage: development, staging, production. Once a set applies, new items can only use its tags, so search keeps working and near-duplicates never appear.

05

Ask for context at checkpoints

Tell your AI to check Detour before a change, before a commit, before a pull request, and before anything public. For example: “Check my Detour for this project before you edit anything.”

06

Keep secrets and sensitive data out

Detour is for guidance, not credentials. Do not save passwords, tokens, customer records, regulated data, or confidential employer data unless your organization has approved it.

07

Treat retrieved context as advice

What Detour returns is context, never permission. Your AI tool still decides what to run and should still ask before destructive actions.

08

Give every tool its own key

Create one key per AI tool on each machine and name it clearly. Revoke a key when you stop using that tool; the others keep working.

Configuration

Set these as environment variables when starting Compose. Defaults are shown; the secure defaults should rarely change.

DETOUR_MCP_AUTH_MODEkey · Set to off only on a trusted offline machine. Keys are required otherwise.
DETOUR_MCP_ALLOW_STDIOfalse · Allows stdio transport. Refused while key authentication is on.
DETOUR_ENABLE_NESTED_DETOURSfalse · Enables Sub-detours beneath Project Detours.
DETOUR_USER_NAMELocal user · Display name in the portal.

Both ports bind to 127.0.0.1. Do not expose them through a proxy, tunnel, or 0.0.0.0; the portal has no login.

Data and upgrades

  • Everything lives in one SQLite file, /data/detour.sqlite, in the detour-data volume. Rebuilds and restarts keep it.
  • Detour is 0.x. Copy that file out before upgrading, and read the changelog for breaking changes.
  • To hand context to someone else, export a bundle as Markdown or JSON, or export a whole Detour from its page.
  • Removing the volume deletes everything and cannot be undone.

Troubleshooting

My AI tool cannot connect

Check the endpoint is http://127.0.0.1:3788/mcp, the header is Authorization: Bearer followed by your key, and the key is still active under Connections. Restart the AI tool after changing its configuration.

A cloud-hosted AI tool cannot reach Detour

Expected. Detour listens only on this computer, so browser-based and cloud-hosted assistants cannot reach it. Use a desktop or command-line tool on the same machine.

I lost a key

Keys are shown once and only a hash is stored. Revoke the lost key under Connections and create a new one.

A flag or tag was rejected

Flag names must be uppercase letters, numbers, and underscores, and cannot look like a secret (TOKEN, PASSWORD, SECRET, API_KEY). Tags must belong to a tag set that applies to the Detour.