Attaching Files and Context

Tuochat gives you several ways to load content into a conversation. It is important to understand the difference between client-side attachments (visible in the chat) and server-side context (sent silently to Duo). See Server vs Client Context for a detailed explanation.


Client-side attachments (visible in chat)

These commands add content to your next user message. The content is visible in the chat transcript, counted in token estimates, and saved in the conversation history.

Attachment discovery respects supported ignore files in the workspace: .gitignore, .agentignore, .claudeignore, and .copilotignore. These files use gitignore-style syntax and apply to /include, folder picks, /map, /code-map, recipes, and directory-style file listings.

Single file: /include or /attach

/include src/auth.py
/attach src/auth.py
/include 3

The file's contents are prepended to the next message you send. Binary files and ignored files are rejected.

Directory listing: /map

/map
/map "*.py" 50

Attaches a directory listing without sending file contents.

Full code bundle: /code-map

/code-map
/code-map "src/**/*.py"

Attaches a recursive file tree plus the full contents of every matching text file.

Web page attachment: /web and /web-preview

/web https://docs.python.org/3/library/pathlib.html
/web-preview https://example.com/blog/post

/web fetches a page and queues a markdown rendering for the next request. /web-preview shows a short preview first and asks for confirmation before attaching it.

By default, tuochat uses a safety-oriented policy here: HTTPS only, public IPs only, limited redirects, and capped response sizes. See Configuration for the [web_attach] section.

Built-in attachment bundles: /recipes and /recipe

/recipes
/recipe python-overview
/recipe python-debug

Recipes are reusable bundles of common project files. They are useful when you want to attach a language- or stack-specific overview without manually building a /map or /code-map.

Detaching and re-attaching

/detach src/auth.py
/detach all
/include-last

Server-side context (silent, persistent)

These commands load content into a side channel that is sent to Duo on every subsequent turn without appearing in the visible transcript.

GitLab artifacts

/gl issue 42
/gl mr 17
/gl file src/auth.py

Arbitrary content

/server-add FILE my-notes.txt

Inspecting and clearing

/gl current
/server-current-items
/gl remove my-notes.txt
/server-clear

Jira issue attachments

/jira
/jira status
/jira auth

/jira lets you pick a Jira project and one or more issues, then queues them as visible attachments for your next message. It requires the optional jira extra plus Jira credentials in config or environment variables.


Skills

A skill is a markdown file that tunes Duo's behavior for a particular task. Skills are loaded into the visible conversation.

/skills
/skill explain
/skill 2

Skill files are discovered from your config directory, bundled tuochat skills, and supported workspace skill roots.


Templates

A template is a prompt with named placeholders that are filled in automatically or by you.

/template
/template explain

Built-in templates include explain and refactor.

In non-interactive mode, supply template variables with --var NAME=value:

tuochat chat new --template refactor --var TARGET_FILE=src/auth.py

Custom instructions

Custom instructions let you prepend standing guidance to every new conversation.

/custom
/custom my-prefs
/custom off
/custom status

Custom instructions apply to the next new conversation, not the current one.


Estimating prompt size

Before sending a large attachment, check that it fits:

/token-check