Codemark is a structural bookmarking system for code. Unlike fragile file:line references that break when you insert a single newline, Codemark uses tree-sitter to capture the semantic structure of your code.
Bookmarks self-heal across renames, refactors, and formatting changes, making them perfect for long-running AI agent sessions, code audits, and developer knowledge management.
Standard bookmarks are "dumb"—they point to a coordinate. When the code moves, the coordinate points to the wrong thing. Codemark is "smart"—it knows what you bookmarked (e.g., "the validateToken function in auth.rs").
- Self-Healing Resolution: Tiered matching (Exact → Relaxed → Hash Fallback) ensures your bookmarks stay alive even if the code drifts.
- Agent Ready: Designed for AI coding agents (like Claude Code) to maintain context across sessions.
- TUI & CLI Native: Works beautifully with
fzf,television,bat, andNeovim. - Semantic Search: Find bookmarks by meaning using local vector embeddings (no API key required).
Codemark doesn't just store a pointer; it stores a comprehensive snapshot of the code's context:
- AST Structure: The exact Tree-Sitter query used to locate the node.
- Git Context: Commit hashes for both creation and every successful resolution.
- Content Hashes: Resilient SHA-256 hashes of normalized code content.
- Append-only Annotations: Multiple notes and context entries from different users or agents.
- Resolution History: A full audit log of how and where the bookmark has moved over time.
- 🧠 Smart Resolution: Bookmarks survive renames and structural changes.
- 📑 Rich Metadata: Captures AST structure, git context, content hashes, and append-only notes/tags.
- 🔍 Semantic Search: Find code by intent (e.g., "where is authentication handled?").
- 🗃️ Collections: Group bookmarks into logical sets for specific tasks.
- 📦 Git Integrated: Track bookmarks across commits and branches.
- 🧩 First-class Integrations:
- Television: Interactive TUI for browsing and fuzzy-finding.
- Neovim: Gut signs, visual selection bookmarking, and Telescope support.
- Claude Code: Specialized plugin for AI-driven bookmarking.
- 🚀 Quick Open: Jump directly to bookmarked code in your favorite editor.
brew tap DanielCardonaRojas/codemark
brew install codemarkcargo install codemarkRequires Rust 1.75+. SQLite is bundled.
Bookmark a function by line number. Codemark automatically identifies the AST node.
codemark add --file src/auth.rs --range 42 --tag auth --note "JWT entry point"Even if you've added lines or moved the function, Codemark finds it:
codemark resolve a1b2Reindex once to enable semantic search:
codemark reindex
codemark search --semantic "how are tokens validated?"The recommended way to browse is via television:
tv codemark- Full Command Reference — Detailed flag and subcommand guide.
- Configuration — Editor setup, global/local config, and semantic search.
- Markdown Templates — Customize
codemark showoutput. - Neovim Plugin — Setup for
codemark.nvim. - Claude Code Plugin — Power up your AI agent.
Codemark speaks AST for:
- 🦀 Rust
- 🍎 Swift
- 🔷 TypeScript / TSX
- 🐍 Python
- 🐹 Go
- ☕ Java
- 🎯 Dart
- ♯ C#
Released under the MIT License.