---
title: "inline-mentions"
url: "https://claudemods.dev/zh-tw/builds/inline-mentions-e8e333"
source: "https://github.com/IVLIU/inline-mentions"
source_type: "github"
repo: "https://github.com/IVLIU/inline-mentions"
author: "IVLIU"
author_handle: "IVLIU"
stars: 0
category: "提示詞與輸入強化"
categories: ["input"]
tags: ["autocomplete", "file-paths", "hooks", "mentions", "prompt-input", "typescript"]
permission_level: 1
scan_complete: true
install: "claude plugin marketplace add IVLIU/inline-mentions\nclaude plugin install inline-mentions@inline-mentions"
added: "2026-10-31T14:31:17.194Z"
updated: "2026-10-31T14:29:04Z"
locale: "zh-tw"
content_locale: "en"
---

# inline-mentions

A Claude Code plugin that lets the @ file/folder picker open anywhere in the prompt, not just at the start of a token, and paints every @path that resolves to something on disk while you type.

## Description

Inline Mentions extends Claude Code's @ picker so it triggers anywhere in the prompt instead of only when the token begins with @. The path begins after the last @ in the token, so text like `看看@src/co` completes `src/co` while leaving the preceding characters untouched. Folders complete with a trailing `/` so you can keep descending and files close with a space.

It supports relative, absolute and `~` paths, hides dotfiles unless you type `@.`, sorts folders first, caps results at 30 rows per keystroke and reads each directory only once per burst of typing. Any `@path` that actually resolves on disk is painted in the theme's suggestion colour as you type, which doubles as a validity check, including the case where a path is immediately followed by Chinese text without a space.

Because Claude Code only reads an `@path` at a word boundary, a mid-word mention would otherwise attach nothing; on submit the plugin reads those files itself and passes them to the model as context without rewriting the prompt. It also re-paints the UserMessage row in the transcript so a mention stays coloured after it is sent. Installation is via `/plugin marketplace add IVLIU/inline-mentions` and `/plugin install inline-mentions@inline-mentions`, with no configuration required; a Claude Code build with function hooks (2.1.306+) is needed. MIT licensed.

## Install

```
claude plugin marketplace add IVLIU/inline-mentions
claude plugin install inline-mentions@inline-mentions
```

## Original README

<div align="center">

# Inline Mentions

**`@` anywhere in the prompt, not just at the start.**

[![license](https://img.shields.io/github/license/IVLIU/inline-mentions?style=flat-square&color=8E86C9)](LICENSE)
[![version](https://img.shields.io/badge/version-0.1.1-8E86C9?style=flat-square)](.claude-plugin/plugin.json)
[![claude code](https://img.shields.io/badge/Claude%20Code-2.1.306%2B-D97757?style=flat-square)](https://code.claude.com/docs)

</div>

Claude Code's `@` picker only opens when the token starts with `@`. Inline Mentions
lets you put it anywhere — glued to the end of a sentence, in the middle of a
Chinese clause, right after a bracket — and complete files and folders from
there:

```
请参考看下@src/co          ->  pick components/
请参考@src/components/     ->  keep descending
其实@README.md 里写了       ->  the file, closed with a space
```

Every `@path` that actually resolves is painted in the theme's accent while you
type, so a mention reads as a reference rather than as ordinary text.

## Install

```
/plugin marketplace add IVLIU/inline-mentions
/plugin install inline-mentions@inline-mentions
```

No configuration. Type `@` in the prompt and the rows appear.

## What you get

- **Completion anywhere.** The path starts after the last `@` in the token, so
  `看看@src/co` completes `src/co` and leaves `看看` untouched.
- **Folders too.** A folder completes with a trailing `/` so you can keep
  descending; a file completes with a space so the mention closes.
- **Relative, absolute and `~` paths.** `@./`, `@../lib/`, `@/usr/local/`,
  `@~/notes/` all work.
- **Hidden entries on request.** Dotfiles appear after `@.` and nowhere else.
  Folders sort first, at most 30 rows per keystroke, one directory read per
  burst of typing.
- **Paint that follows the path.** A `@path` is painted in the theme's
  `suggestion` colour only while it names something on disk, so the colour
  doubles as a validity check. A path followed by Chinese without a space
  stops painting where the file does: `看@src/a.ts的内容` paints `@src/a.ts`.
- **Immediate paint on a pick.** Accepting a row writes the draft without an
  edit, so the mod writes the same text back through `prompt.fill` with the
  paint attached.
- **Mentions that actually reach the model.** Claude Code reads an `@path` only
  where it starts a word or follows whitespace or one of `。、？！`. A mid-word
  mention therefore attaches nothing, however it is painted. On submit the mod
  reads those files itself and hands them over as context, so the prompt
  reaches the model exactly as you typed it — no space inserted, no rewrite.
- **Paint that survives the send.** A sent prompt is drawn by the engine, so
  the composer's paint is gone once it is in the transcript. The mod re-paints
  the `UserMessage` row: the engine's own tree is kept and only the runs
  naming a mention are coloured.

## How it works

Everything rides three prompt-box events:

1. `prompt.autocomplete` — when the token at the cursor holds an `@`, list the
   directory before the fragment and offer the matching entries. Rows the
   engine already offered are kept; duplicates are dropped by comparing what
   they name rather than how they spell it.
2. `prompt.edit` — return `decorations` over every `@path` that resolves, so
   the draft paints while typing. Ranges the engine already painted are left
   alone.
3. `prompt.change` — an accepted completion is an engine write that carries no
   paint, so the same text is re-filled with `prompt.fill` when the caret sits
   at the end of the draft.
4. `prompt.submit` — a mention glued to the character before it is one the
   engine will not read, so the mod reads that file (or lists that folder) and
   adds it to the model's `context`. The prompt text itself is untouched.
5. `ui.render` on `UserMessage` — the transcript row of a sent prompt is the
   engine's drawing; the mod walks its tree and colours the string runs that
   name a mention, leaving every other node and prop as it was.

## Notes

- Needs a Claude Code build with function hooks (the `claude-code` hooks API is
  early access and may change between releases).
- Paths containing spaces are written as typed; the mention ends at the space.
- The paint is display only — it does not change what reaches the model.
- The colour is one constant: `MENTION_COLOR` in `hooks/register.tsx`, any theme
  key (`suggestion`, `claude`, `ide`, `success`, `permission`, …).
- MIT licensed.

---

<div align="center"><sub>Not affiliated with Anthropic. Claude and Claude Code are trademarks of Anthropic, PBC.</sub></div>

<details>
<summary><b>中文</b></summary>

在输入框**任意位置**用 `@` 补全文件和文件夹，不再只能在开头。

`看看@src/co` 补的是 `src/co`，`看看` 原样保留；文件夹以 `/` 结尾继续往里跳，
文件以空格结尾闭合引用；相对路径、绝对路径、`~/` 都支持；隐藏文件只在 `@.`
之后出现。凡是真能落到磁盘上的 `@路径`，输入时就用主题色 `suggestion` 画出来，
一眼能看出这个引用到底有没有效。

安装：

```
/plugin marketplace add IVLIU/inline-mentions
/plugin install inline-mentions@inline-mentions
```

不需要任何配置。要求支持 function hooks 的 Claude Code（2.1.306+）。
换颜色只改 `hooks/register.tsx` 里的 `MENTION_COLOR`。

</details>
