Cross-tool context for AI developer workflows
See the code
Trace. Context. Continuity.
A local-first engineering memory layer and MCP server that provides AI coding tools with a shared, persistent context architecture.
traz is a local-first engineering memory layer designed specifically for AI-augmented development.
By capturing debugging history, architectural decisions, file modifications, and workflow traces as you code, traz establishes a highly searchable, persistent context timeline. This timeline is securely stored in a local SQLite vector database and automatically exposed via the Model Context Protocol (MCP). This enables any compatible AI agent (Claude Code, Cursor, Aider, Gemini CLI, OpenAI Codex) to instantly synchronize context without manual developer intervention or copy-pasting.
Modern software development increasingly relies on multiple, specialized AI agents. A standard workflow might involve:
At every tool boundary, context is lost. The AI in the IDE does not inherently know what the AI in the terminal just fixed. Every new session starts as an isolated environment, forcing developers to manually rebuild the context window.
traz resolves this by acting as a persistent context plane. It ensures that subsequent AI sessions—regardless of the tool—inherit the context of previous decisions, mitigating context loss, reducing LLM token duplication, and preventing regression of thought.
The traz architecture is built upon three primary pillars:
fastembed-rs library to execute ONNX-accelerated embedding generation locally. It implements Reciprocal Rank Fusion (RRF) to intelligently merge exact keyword matches (FTS5) with semantic vector similarity, ensuring high-fidelity context retrieval even when vocabulary drifts.graph TD
A[Claude Code] -->|stdio / MCP| C(traz MCP Server)
B[Cursor IDE] -->|stdio / MCP| C
D[CLI / Shell Hooks] -->|Commands| C
C --> E[(SQLite Vector DB)]
C --> F[fastembed-rs ONNX]
E --> G[Timeline Engine]
For an in-depth review of the underlying schema, migration logic, and RRF mathematics, please refer to the Architecture Documentation.
Select your preferred installation method:
npm install -g @traz-dev/traz
brew tap mithilgirish/traz
brew install traz
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mithilgirish/traz/releases/latest/download/traz-installer.sh | sh
irm https://github.com/mithilgirish/traz/releases/latest/download/traz-installer.ps1 | iex
Requires the Rust toolchain (v1.75.0 or higher):
cargo install --git https://github.com/mithilgirish/traz.git traz
For contributors or users requiring specific branch deployments:
git clone https://github.com/mithilgirish/traz.git
cd traz
cargo build --release
# Optional: Add to PATH systematically
sudo cp target/release/traz /usr/local/bin/
Ensure the binary is correctly linked and the embedding model engine is accessible.
traz doctor
Initialize traz within your repository to establish the local timeline directory (.traz/). This directory acts as the nexus for your project's history.
cd your-project
traz init
Running traz init performs the following automated steps:
.traz/ local directory.traz.db) and vector index..traz/ to your .gitignore to prevent committing the database to remote version control.The CLI is designed to be highly composable, scriptable for CI/CD integration, and readable for daily workflow monitoring.
Log Manual Context: Append a manual note, architectural decision, or debugging trace directly to the timeline.
traz log "traced root cause of memory leak to unbounded queue growth in the worker pool"
Add Structured Events: Useful for shell aliases or git hooks.
traz add --tool cursor --event-type bug_fix --title "Fixed auth race condition"
View Recent Activity: Fetch a chronological list of the most recent events across all tools.
$ traz recent --limit 5
[claude-code · 2h ago] fixed websocket reconnect issue
[cursor · 5h ago] updated auth middleware
[warp · 1d ago] traced memory leak in queue worker
[aider · 2d ago] reverted broken cache optimization
Search Engineering History: Perform keyword searches against the timeline.
$ traz search auth
[2d ago] claude-code
Fixed JWT refresh race condition
[5h ago] cursor
Updated auth middleware retry logic
View Workflow Timeline: Render a bulleted workflow trace of operations, useful for generating PR descriptions or commit summaries.
$ traz timeline
• created websocket handler
• debugged reconnect issue
• added retry backoff
• verified with local tests
Time-Bounded AI Recap: Generate a time-bounded summary, commonly used for daily standups or morning synchronization.
$ traz recap --hours 24
Context Checkpointing: Save a named snapshot of the current state. Useful when switching branches or finalizing a massive refactor.
traz checkpoint --message "completed auth migration"
Backfill Embeddings: Generate missing vector embeddings for older events ingested prior to vector support or during offline periods.
traz backfill-embeddings
For an interactive, visually structured view of the repository's history and AI traces, traz ships with a native TUI.
traz tui
The TUI provides:
traz acts as an MCP stdio server. It features auto-detecting setup workflows to register itself across major AI tools effortlessly.
Run the setup command corresponding to your primary tool. The wizard will automatically locate the tool's configuration file and inject the necessary MCP routing logic.
traz setup claude # Configures Claude Code
traz setup cursor # Modifies ~/.cursor/mcp.json
traz setup opencode # Configures OpenCode
traz setup codex # Configures OpenAI Codex CLI
traz setup gemini # Configures Gemini CLI
traz setup agy # Configures Antigravity CLI
For tools not supported by the interactive wizard (such as Aider or custom agents), configure your agent to execute traz with the mcp subcommand.
Example mcp.json structure:
{
"mcpServers": {
"traz": {
"command": "traz",
"args": ["mcp"]
}
}
}
Once configured, the AI tool will automatically query the traz server on initialization, retrieve the latest checkpoints, and restore context natively. For further details, refer to the Agent Integration Guide.
By default, traz generates local embeddings for all ingested events using an ONNX-accelerated MiniLM model (fastembed-rs). This enables semantic retrieval, allowing you to find contextually relevant history even when exact keywords are omitted.
$ traz search "database connection pooling"
[semantic search] Search: "database connection pooling" (2 results)
─────────────────────────────────────────────
1. Added pg_bouncer for connections (72%)
Tool: cursor Type: commit Age: 3d ago Tags: #db
2. Re-architected connection lifecycle (64%)
Tool: gemini Type: refactor Age: 1w ago Tags: #db #performance
Long-running projects accumulate extensive, verbose timelines. Standard JSON serialization of this data rapidly depletes an LLM's context window.
traz implements a --dense formatting protocol over MCP. Instead of passing nested JSON arrays to the agent, the server parses the historical data into an ultra-compact plaintext format, stripping redundant schema keys and whitespace. This methodology consistently compresses context payload sizes by 60% to 75%.
Security is foundational to traz.
.traz/traz.db) and is strictly .gitignored. No data is transmitted to an external server.Q: traz setup cursor fails to detect my configuration.
A: Ensure you have initialized Cursor at least once so the ~/.cursor configuration directory exists. You can manually append the JSON block defined in the Manual MCP Configuration section.
Q: Semantic search is returning errors or panicking in CI environments.
A: In headless CI environments missing certain runtime libraries, fastembed-rs may fail to generate embeddings. Set the TRAZ_DISABLE_EMBEDDINGS=1 environment variable during automated testing to bypass vector generation.
Q: How do I clear my context timeline?
A: You can purge the local memory by simply deleting the database file: rm -rf .traz/. Re-run traz init to start fresh.
v0.1 (Current)
Future Proposals
We welcome contributions from the community. If you plan to introduce significant architectural changes or core database migrations, please open an issue first to discuss the proposed design.
# Clone the repository
git clone https://github.com/mithilgirish/traz.git
cd traz
# Run test suite
cargo test
# Ensure formatting and linting pass
cargo fmt --all -- --check
cargo clippy -- -D warnings
Please review the CONTRIBUTING.md for strict code style guidelines and testing protocols prior to submitting Pull Requests.
This project is licensed under the MIT License. All contributions are subject to these licensing terms.
Built for developers who switch tools, not context.
40 commits
Rust
99.1%
Cross-tool context for AI developer workflows
See the code
Trace. Context. Continuity.
A local-first engineering memory layer and MCP server that provides AI coding tools with a shared, persistent context architecture.
traz is a local-first engineering memory layer designed specifically for AI-augmented development.
By capturing debugging history, architectural decisions, file modifications, and workflow traces as you code, traz establishes a highly searchable, persistent context timeline. This timeline is securely stored in a local SQLite vector database and automatically exposed via the Model Context Protocol (MCP). This enables any compatible AI agent (Claude Code, Cursor, Aider, Gemini CLI, OpenAI Codex) to instantly synchronize context without manual developer intervention or copy-pasting.
Modern software development increasingly relies on multiple, specialized AI agents. A standard workflow might involve:
At every tool boundary, context is lost. The AI in the IDE does not inherently know what the AI in the terminal just fixed. Every new session starts as an isolated environment, forcing developers to manually rebuild the context window.
traz resolves this by acting as a persistent context plane. It ensures that subsequent AI sessions—regardless of the tool—inherit the context of previous decisions, mitigating context loss, reducing LLM token duplication, and preventing regression of thought.
The traz architecture is built upon three primary pillars:
fastembed-rs library to execute ONNX-accelerated embedding generation locally. It implements Reciprocal Rank Fusion (RRF) to intelligently merge exact keyword matches (FTS5) with semantic vector similarity, ensuring high-fidelity context retrieval even when vocabulary drifts.graph TD
A[Claude Code] -->|stdio / MCP| C(traz MCP Server)
B[Cursor IDE] -->|stdio / MCP| C
D[CLI / Shell Hooks] -->|Commands| C
C --> E[(SQLite Vector DB)]
C --> F[fastembed-rs ONNX]
E --> G[Timeline Engine]
For an in-depth review of the underlying schema, migration logic, and RRF mathematics, please refer to the Architecture Documentation.
Select your preferred installation method:
npm install -g @traz-dev/traz
brew tap mithilgirish/traz
brew install traz
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mithilgirish/traz/releases/latest/download/traz-installer.sh | sh
irm https://github.com/mithilgirish/traz/releases/latest/download/traz-installer.ps1 | iex
Requires the Rust toolchain (v1.75.0 or higher):
cargo install --git https://github.com/mithilgirish/traz.git traz
For contributors or users requiring specific branch deployments:
git clone https://github.com/mithilgirish/traz.git
cd traz
cargo build --release
# Optional: Add to PATH systematically
sudo cp target/release/traz /usr/local/bin/
Ensure the binary is correctly linked and the embedding model engine is accessible.
traz doctor
Initialize traz within your repository to establish the local timeline directory (.traz/). This directory acts as the nexus for your project's history.
cd your-project
traz init
Running traz init performs the following automated steps:
.traz/ local directory.traz.db) and vector index..traz/ to your .gitignore to prevent committing the database to remote version control.The CLI is designed to be highly composable, scriptable for CI/CD integration, and readable for daily workflow monitoring.
Log Manual Context: Append a manual note, architectural decision, or debugging trace directly to the timeline.
traz log "traced root cause of memory leak to unbounded queue growth in the worker pool"
Add Structured Events: Useful for shell aliases or git hooks.
traz add --tool cursor --event-type bug_fix --title "Fixed auth race condition"
View Recent Activity: Fetch a chronological list of the most recent events across all tools.
$ traz recent --limit 5
[claude-code · 2h ago] fixed websocket reconnect issue
[cursor · 5h ago] updated auth middleware
[warp · 1d ago] traced memory leak in queue worker
[aider · 2d ago] reverted broken cache optimization
Search Engineering History: Perform keyword searches against the timeline.
$ traz search auth
[2d ago] claude-code
Fixed JWT refresh race condition
[5h ago] cursor
Updated auth middleware retry logic
View Workflow Timeline: Render a bulleted workflow trace of operations, useful for generating PR descriptions or commit summaries.
$ traz timeline
• created websocket handler
• debugged reconnect issue
• added retry backoff
• verified with local tests
Time-Bounded AI Recap: Generate a time-bounded summary, commonly used for daily standups or morning synchronization.
$ traz recap --hours 24
Context Checkpointing: Save a named snapshot of the current state. Useful when switching branches or finalizing a massive refactor.
traz checkpoint --message "completed auth migration"
Backfill Embeddings: Generate missing vector embeddings for older events ingested prior to vector support or during offline periods.
traz backfill-embeddings
For an interactive, visually structured view of the repository's history and AI traces, traz ships with a native TUI.
traz tui
The TUI provides:
traz acts as an MCP stdio server. It features auto-detecting setup workflows to register itself across major AI tools effortlessly.
Run the setup command corresponding to your primary tool. The wizard will automatically locate the tool's configuration file and inject the necessary MCP routing logic.
traz setup claude # Configures Claude Code
traz setup cursor # Modifies ~/.cursor/mcp.json
traz setup opencode # Configures OpenCode
traz setup codex # Configures OpenAI Codex CLI
traz setup gemini # Configures Gemini CLI
traz setup agy # Configures Antigravity CLI
For tools not supported by the interactive wizard (such as Aider or custom agents), configure your agent to execute traz with the mcp subcommand.
Example mcp.json structure:
{
"mcpServers": {
"traz": {
"command": "traz",
"args": ["mcp"]
}
}
}
Once configured, the AI tool will automatically query the traz server on initialization, retrieve the latest checkpoints, and restore context natively. For further details, refer to the Agent Integration Guide.
By default, traz generates local embeddings for all ingested events using an ONNX-accelerated MiniLM model (fastembed-rs). This enables semantic retrieval, allowing you to find contextually relevant history even when exact keywords are omitted.
$ traz search "database connection pooling"
[semantic search] Search: "database connection pooling" (2 results)
─────────────────────────────────────────────
1. Added pg_bouncer for connections (72%)
Tool: cursor Type: commit Age: 3d ago Tags: #db
2. Re-architected connection lifecycle (64%)
Tool: gemini Type: refactor Age: 1w ago Tags: #db #performance
Long-running projects accumulate extensive, verbose timelines. Standard JSON serialization of this data rapidly depletes an LLM's context window.
traz implements a --dense formatting protocol over MCP. Instead of passing nested JSON arrays to the agent, the server parses the historical data into an ultra-compact plaintext format, stripping redundant schema keys and whitespace. This methodology consistently compresses context payload sizes by 60% to 75%.
Security is foundational to traz.
.traz/traz.db) and is strictly .gitignored. No data is transmitted to an external server.Q: traz setup cursor fails to detect my configuration.
A: Ensure you have initialized Cursor at least once so the ~/.cursor configuration directory exists. You can manually append the JSON block defined in the Manual MCP Configuration section.
Q: Semantic search is returning errors or panicking in CI environments.
A: In headless CI environments missing certain runtime libraries, fastembed-rs may fail to generate embeddings. Set the TRAZ_DISABLE_EMBEDDINGS=1 environment variable during automated testing to bypass vector generation.
Q: How do I clear my context timeline?
A: You can purge the local memory by simply deleting the database file: rm -rf .traz/. Re-run traz init to start fresh.
v0.1 (Current)
Future Proposals
We welcome contributions from the community. If you plan to introduce significant architectural changes or core database migrations, please open an issue first to discuss the proposed design.
# Clone the repository
git clone https://github.com/mithilgirish/traz.git
cd traz
# Run test suite
cargo test
# Ensure formatting and linting pass
cargo fmt --all -- --check
cargo clippy -- -D warnings
Please review the CONTRIBUTING.md for strict code style guidelines and testing protocols prior to submitting Pull Requests.
This project is licensed under the MIT License. All contributions are subject to these licensing terms.
Built for developers who switch tools, not context.
40 commits
Rust
99.1%