Your editor shows you the function.
Your AI agent loads the file.
Twira gives your AI agent the same precision lookups developers already use, read one symbol, or just the outline of a file, without loading the whole thing into context. Three deterministic read modes, in milliseconds, across 26 languages.
Your editor jumps to the function. Your agent scans around it. Twira makes the agent precise.
symbolOne function. Exact lines. No whole-file load.
overviewA file’s structure, symbols and imports. No content.
contentThe whole file with line numbers, when you really need it all.
You ask
“Show me the handleLogin function.”
Twira instantly
- looks up handleLogin in the symbol index
- finds its file and exact line range
- pulls those exact lines from the indexed content
- returns just the function with its signature and line numbers
- no whole-file load, no re-parsing
Agent gets the function, not the whole file.
How the agent uses this
Agent calls `read` via MCP. Three modes: `name` for a symbol slice, `file_path` for a file overview, `file_path` + `content: true` for the full file. Optional `include_context` adds N lines before AND after a symbol.
When you reach for it
- The agent needs to know what is in a file before deciding what to touch, it calls read with a file_path and gets the symbol outline plus imports in one response.
- The agent wants the actual implementation of one function without re-loading the whole file, it calls read with name: "handleLogin" and gets the function source with line numbers.
- Reading a short config, JSON schema, or test end-to-end, read with file_path plus content: true returns the full file with line numbers.
- Looking at three lines before and after a symbol for surrounding context, read with name plus include_context: 3 returns the symbol plus its neighbourhood.
See it work
$ # Agent calls via MCP, there is no `twira read` CLI
read file_path="src/auth/login.ts"Technical depth, for engineers who want it
In your editor
In your editor, `F12` jumps to a function’s definition. Peek Definition shows it inline without leaving the tab. The Outline panel maps every file, symbols and imports, without you having to read the source. Three different ways your IDE shows you what is there, none of which require reading the whole file.
What Code Read does
Code Read gives your AI agent three precision read modes. Symbol slice returns one function (or class, or constant), exact lines, with the signature, the type info, the line range from the index, and the source pulled from the indexed copy. File overview returns the structure of a file, every top-level symbol and every import, without the content. Full file mode returns the whole file with line numbers, for the rare cases where the agent really needs everything. Three calls, three precision levels.
How it actually works
Code Read is three different reads in one tool. The agent picks the right mode for the question being asked, and each mode returns deterministic data in milliseconds, no LLM call, no re-parsing, no token burn on context the agent does not need.
Symbol slice is the most-used mode. Ask for handleLogin by name and get back just that function: file path, line range, signature, and the source with line numbers prefixed. The line range comes from the symbols table the index already built, so the slice is exact, not "the file I think this is in, starting around line 40." Scope to a specific file with the file_path parameter when you need to be precise about which file’s symbol you mean. The symbol match itself uses the same five-tier cascade as Code Search (exact, case-insensitive, normalised, substring, token), so the agent does not need to know the exact casing.
File overview is the quietly most-valuable mode. Pass a file_path with no other arguments and get back a structured outline: file type, byte count, line count, every top-level symbol (with name, kind, line, exported status, signature, and a type_info JSON capturing generics, enum variants, and interface members), plus every import (source, type, line). The agent learns the shape of a file in one call instead of reading the whole thing. Most agent sessions need "what is in this file", not "give me every line of it", and this mode is the answer.
Full file content is opt-in via the content parameter. With content set to true, you get the whole file back with line numbers prefixed. Useful for short configs, JSON schemas, tests, or any file where the structure-only overview is not enough. Disk reads above 1 MB are rejected to prevent memory exhaustion, for genuinely large files you want symbol slice or overview anyway.
On symbol-slice mode, the optional include_context parameter adds N lines both before and after the symbol. Useful when the agent wants to see surrounding declarations, the call site context, or related comments without doing a second read for the whole file. Defaults to 0.
How the source is actually retrieved: Code Read checks the indexed file_content table first for a cached copy. If there is one, it returns immediately, no disk IO at all. If not, it reads fresh from disk, after a project-root path-traversal check and the 1 MB safety cap. Either way you get the current on-disk content; line-range slicing happens in memory after the read, with no whole-file scan and no parse.
Setup is one step. Like every other read-from-index tool, Code Read needs the index in place. Run twira index once on install, file-overview mode reads the symbol metadata the indexer built, symbol-slice mode reads the line ranges it captured, and full-content mode reads either the cached file_content table or falls through to disk.
What it isn’t
- Symbol slice needs the symbol to be in the index. If the agent asks for a function in a file that has not been indexed yet, the answer is honest: "symbol not found", not a guess.
- File overview returns what is in the file (symbols and imports). It does not infer what the file is "for", it tells you what is literally there.
- Full file content is opt-in (`content: true`). The default is the leaner overview, because most calls do not need every line.
One install. Your agent will know the difference in the first session.
$ curl -fsSL twira.com/install.sh | sh