Skip to content
codedaptivePublic

About

Tessera: a Rust rewrite of CodeGraph, a deterministic code graph for AI coding agents

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Tessera

Code intelligence for coding agents, in one binary.

Tessera reads a codebase and answers questions about it: where a symbol is defined, what calls it, what a change would reach, and which tests cover a file. It builds an index of the code once, keeps it in a .codegraph/ folder inside the project, and answers from that index on the command line and as MCP tools.

It is a Rust rewrite of CodeGraph, built for coding agents: an agent asks Tessera where it would otherwise search text and read files.

Pre-release. Tessera is still being compared with CodeGraph, answer for answer. Until that is finished, treat it as a preview and keep using CodeGraph for daily work. There is no packaged release: build it from source, then tessera install places it; see Install.

Who it is for

  • Coding agents. An agent that speaks MCP launches tessera serve --mcp and asks codegraph_explore for the source of the symbols a task touches, with the call paths between them. An agent that cannot hold an MCP connection runs tessera botlink, one process per question.
  • People working beside agents. Every answer is also a command: tessera callers, tessera impact, tessera affected and the rest print the same facts in a terminal or as JSON for a script.
  • Teams that run many working copies of one repository. A git worktree with no index gets one copied from an indexed worktree of the same repository on its first call, so each agent's checkout answers for its own files.

What it is not

  • Not a writer. Tessera reads and reports. It never changes your code and never commits, stages, checks out or moves a ref. Inside a project it writes only its own .codegraph/ folder, with one exception you choose: tessera init can add a sync block to the repository's git hooks (see The index).
  • Not a compiler, linter or test runner. It reports structure. Whether the code is correct is still the job of your compiler, tests and linter.
  • Not semantic search. explore and query match names and indexed code words, not meaning.
  • Not exact about every call. Calls across files are resolved by name where nothing better is known, and an ambiguous call can be bound to the wrong definition. tessera suspects lists the edges bound that way.
  • Not a hosted service. Everything runs on your machine. The server listens on a local Unix socket, not on a network port, and has no access control beyond the repository a session was launched in (SECURITY.md).
  • Not all of CodeGraph. Tessera has no web UI, and no telemetry or upgrade command.

Install

Build from source

This is the only way to get Tessera today, on macOS or Linux; it does not build for Windows. You need a recent stable Rust toolchain, a C compiler (the vendored grammars are compiled as C), make, python3 and git. From a clone of this repository:

make bin-release

This builds tessera in cargo's release folder (target/release/ unless you have set another) and makes ts, a symlink to it, in the same folder. Put that folder on your PATH.

At run time Tessera calls git for projects that are git repositories, and tessera grep and the codegraph_grep tool call ripgrep: install rg, or set CODEGRAPH_RG to its path.

A fresh clone does not build yet. The workspace manifest (Cargo.toml) names four dependencies by a path on the build machine: the vendored grammar crate (kernel-grammars/, which is in this repository) and Moot's PersistenceKit, QueueKit and CorpusKit. Until those lines point at the in-repository crate and at published sources, make bin-release works only where those paths exist.

The two names

The program is tessera. ts is a short name for the same file. moreutils also ships a ts, so check which one your shell finds (command -v ts), and use tessera in anything that runs unattended: scripts, git hooks and MCP configuration. Tessera itself writes tessera in every command line it prints or installs.

tessera install

Once you have a built binary, tessera install sets it up for your user, without root. The full contract is docs/SPEC-install-2026-11-18.md.

target/release/tessera install -y   # the binary make bin-release built; -y takes every default
Command or option What it does
tessera install Copies the binary to ~/.local/bin/tessera, links ts and tessera-botLink to it, and offers to wire the agent harnesses it finds
--target <list> The harnesses to wire (claude, codex, cursor) instead of the interactive picker
--mode skill|mcp|both Write Tessera's skill file, wire its MCP server, or both
--location local Write the skill file into this project instead of the home folder (Claude)
-y No prompts: every detected harness, mode both. A run with no terminal does the same
--no-place Use the binary where it is instead of copying it; implied when it runs from /opt/homebrew or /usr/local
--short-name Link ts even when another program named ts is on PATH
tessera uninstall Remove exactly what install placed, and nothing else; it asks nothing

Install never overwrites what it did not write. Where a harness already has an MCP entry named codegraph (from CodeGraph itself), install leaves it, skips the MCP step for that harness and says so. It records each thing it placed in its state folder, ~/.local/state/tessera ($XDG_STATE_HOME is followed when set), and uninstall removes what that record names. It never touches a project's index or the server's state.

First run

In a project you want indexed:

tessera init .                # build the index into .codegraph/
tessera status                # what the index holds, and whether it is current
tessera query greet           # find symbols by name
tessera node greet            # one symbol's source, with who calls it
tessera callers greet         # every caller
tessera affected src/app.py   # the test files that reach a changed file

Replace greet and src/app.py with a symbol and a file of your own. init refuses your home folder, a parent of it, and the filesystem root unless you pass --force. It may ask one question, about git hooks; --yes skips the question and takes the default (see The index).

Tessera prints CodeGraph's messages as CodeGraph wrote them, so its output says "CodeGraph" in places ("Initializing CodeGraph", "CodeGraph Status"). That is Tessera speaking.

Languages

The index recognises TypeScript, JavaScript, TSX, JSX, ArkTS, Python, Go, Rust, Java, C, C++, C#, Razor, PHP, Ruby, Swift, Kotlin, Dart, Svelte, Vue, Astro, Liquid, Pascal, Scala, Lua, Luau, Objective-C, R, Solidity, Nix, YAML, Twig, XML, .properties files, CFML (with CFScript and CFQuery), COBOL, VB.NET, Erlang and Terraform. The list is CodeGraph's (crates/shared/src/language.rs). How completely each one is covered is part of the comparison with CodeGraph that is still under way.

Commands

tessera --help lists them. tessera help <command> or tessera <command> --help prints a command's options, except for grep, blast, orphans, suspects, daemon and botlink, which do not answer --help yet; their options are given below. Commands that take -p, --path <path> look for the index at that project instead of the working directory. Most accept -j, --json.

Build and maintain the index

Command What it does
tessera init [path] Create .codegraph/ and build the first index. -y, --yes no prompts; -f, --force allow a home folder or root; -v, --verbose
tessera index [path] Rebuild the whole index from scratch. -q, --quiet, -v, --verbose, -f, --force
tessera sync [path] Bring the index up to date with the files changed since the last index. -q, --quiet
tessera status [path] Files, symbols and edges in the index, and whether it is up to date
tessera checkpoint [path] The git state the index reflects (HEAD, a hash of uncommitted changes, files pending). Exit 0 when fresh, 3 when not. --fresh syncs first, then reports
tessera unlock [path] Remove a stale lock file that is blocking indexing
tessera uninit [path] Delete the project's .codegraph/ folder. -f, --force skips the confirmation

Ask about the code

Command What it answers
tessera explore <query...> The source of the relevant symbols and the call paths between them, in one answer. Takes a question or a list of names. --max-files <number>
tessera context <task...> Context for a task: relevant symbols, relationships and code. -f, --format markdown|json, -n, --max-nodes <number>, --no-code
tessera query <search> Symbols by name. -l, --limit <number>, -k, --kind <kind>
tessera node [name] One symbol's source with its callers and callees; with -f, --file <file>, a file with line numbers and what depends on it (--offset, --limit, --symbols-only)
tessera callers <symbol> What calls it. -f, --file <path> narrows to one definition; -l, --limit <number>
tessera callees <symbol> What it calls. Same options as callers
tessera impact <symbol> What is affected by changing it. -d, --depth <number>
tessera implementations <symbol> The types that implement or extend a trait, interface or class. -d, --depth <number> (1 to 6)
tessera affected [files...] The test files that changed files reach. --stdin reads the file list from stdin; -f, --filter <glob> says which files count as tests; -d, --depth <number>; -q, --quiet prints paths only
tessera files The project's files, from the index. --filter <dir>, --pattern <glob>, --format tree|flat|grouped, --max-depth <number>, --no-metadata
tessera cycles [path] Circular imports between files. Exits 1 when there are any

Ask about a change

Command What it answers
tessera grep <pattern> Text matches in every indexed file, grouped under the symbol that encloses each and ranked by incoming edges. --in <path>, --fixed, -i, --ignore-case, --strict, --json
tessera blast The symbols and files that depend on the lines changed since a base ref, grouped by directory. -b, --base <ref>, -d, --depth <number>, -f, --format <format>, --strict
tessera orphans The symbols added since the merge base of a base ref and HEAD that nothing uses. -b, --base <ref> (required), --json
tessera suspects Call edges bound by name only, ranked by how likely each is wrong. -l, --limit <n|all>, -e, --edges <n>, --json

The server and the rest

Command What it does
tessera daemon Show the running server: pid, version, uptime, socket and state folder. --stop stops it. Also tessera daemons
tessera project list|pin|unpin|remove The projects the server knows. A pinned project stays open instead of closing when idle; remove unregisters one and deletes nothing
tessera version Print the version. Also -V, --version
tessera help [command] Help

The global options --color and --no-color force or disable ANSI colours; NO_COLOR is honoured.

For agents

MCP

Tessera's MCP server speaks JSON-RPC on stdio. Register it in your client under the name codegraph:

{
  "mcpServers": {
    "codegraph": {
      "command": "tessera",
      "args": ["serve", "--mcp"]
    }
  }
}

The tool names stay CodeGraph's: codegraph_explore, codegraph_search, codegraph_callers, codegraph_callees, codegraph_impact, codegraph_node, codegraph_status, codegraph_files, codegraph_grep, codegraph_blast, codegraph_orphans and codegraph_suspects.

  • One tool is listed by default. tools/list shows codegraph_explore alone; the others can be called but are not listed. Set CODEGRAPH_MCP_TOOLS to a comma list (explore,callers,impact) to list and allow exactly those.
  • Every call needs projectPath, the root of the code to query. A call without it is answered missing argument: root path to the code you wish to query.
  • A session answers for one repository: the one it was launched in, and that repository's git worktrees. A path outside them gets guidance, not results. -p, --path <path> sets the launch directory.
  • --focus <dir> (repeatable) narrows codegraph_search and codegraph_explore to those directories; pass scope: "repo" on a call to search the whole repository. codegraph_callers and codegraph_impact always cover the whole repository and list results outside the focus separately.
  • fresh: true on any tool waits, within a bound, until the index matches the working tree before answering.
  • One server per machine. Each serve --mcp process is a proxy to a single background server, which it starts when none is running. Set CODEGRAPH_NO_DAEMON=1 for a session served by its own process alone.

botLink

For an agent that cannot hold an MCP connection, tessera botlink runs one MCP operation per process against the server on this machine and prints exactly one JSON value:

tessera botlink ping
tessera botlink list
tessera botlink call codegraph_explore --projectPath "$PWD" --query "greet"
tessera botlink rpc '<json-rpc frame>'

call takes its arguments as --<key> <value> pairs, as one JSON object, or with --args '<json object>'. rpc reads its frame from stdin when none is given. --socket <path> names the server's Unix socket; only a local socket is accepted. Exit codes: 0 for a result, 2 when the tool answered with an error, 1 for a transport or server failure, 64 for bad arguments. A link named tessera-botLink to the binary runs botlink directly.

Hooks for Claude Code

Two commands are meant to be run by a harness, not typed: tessera worktree-hook, a PreToolUse hook for the codegraph tools, and tessera prompt-hook, a UserPromptSubmit hook that adds code context to prompts about code structure. Nothing installs them for you today.

The index

  • Where. <project>/.codegraph/. The main file is tessera.db, with its search files beside it. The folder carries its own .gitignore, so git leaves it out. Storage is built on Moot's PersistenceKit, over SQLite.
  • Beside CodeGraph. Tessera's index format is its own, and it neither reads nor writes CodeGraph's index. Both tools can index the same project; each keeps its own file in .codegraph/.
  • Staying current. While the server has a project open, a background builder watches its files and syncs the index as they change. From the command line, tessera sync brings it up to date, and tessera checkpoint --fresh syncs and then reports.
  • Git hooks. Where live watching is not available, tessera init offers to add a sync block to the repository's post-commit, post-merge and post-checkout hooks, so the index refreshes after a commit, pull or checkout. It installs them only when you agree, or when you pass --yes. Existing hook content is kept.
  • Worktrees. A git worktree with no index gets one on its first call: copied from an indexed worktree of the same repository, or built in the background when there is none.
  • Server state. The server keeps its lock, socket, logs and build queue in ~/.local/state/tessera ($XDG_STATE_HOME/tessera when that is set to an absolute path), or in the absolute path CODEGRAPH_STATE_DIR names. CodeGraph's default is ~/.codegraph, so the two stay apart unless CODEGRAPH_STATE_DIR points both at one folder.

Tessera and CodeGraph

Tessera is built to serve the same MCP tools and CLI commands as CodeGraph, with the same output text. It adds:

Addition What it is
grep Text search grouped by enclosing symbol
blast What depends on the lines changed since a base ref
orphans Symbols added since a base ref that nothing uses
suspects Call edges bound by name only
--fresh checkpoint --fresh on the command line and fresh: true on the tools: sync first, then answer
Worktree indexes An index for each git worktree, copied from a sibling on first use
botLink One MCP operation per process, for agents that cannot hold a connection

It leaves out CodeGraph's UI, installer, upgrade and telemetry.

The parsing kernel under kernel/ is CodeGraph's codegraph-kernel/, used unchanged under its MIT license (docs/KERNEL.md). A parser fix belongs upstream, not in this copy.

With Mortar and Temperare

Tessera (ts) reads the code, Mortar (mr) writes its history, and Temperare (tm) checks it. Each one works alone.

  • Temperare can ask Tessera the questions its rules need the code graph for.
  • Tessera needs nothing from either.

Where to go next

Security

Tessera runs locally and reads the code you point it at. What it reads, writes and runs, and how to report a problem, are in SECURITY.md.

Contributing

See CONTRIBUTING.md.

License

Tessera is licensed under the MIT License, the same license as upstream CodeGraph. The third-party code in this repository keeps its own licenses: the parsing kernel is MIT, Copyright (c) 2026 Colby Mchenry, and the vendored grammars under kernel/grammars/ and kernel-grammars/grammars/ carry their own LICENSE files. LICENSE lists each one.

About

Tessera: a Rust rewrite of CodeGraph, a deterministic code graph for AI coding agents

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages