A browser extension for exploring and reviewing GitHub and GitLab repositories from a code tree.
Version 0.7.0 · Chrome / Chromium 140+ · Manifest V3
Website · Chrome Web Store · Privacy policy
Browse files, switch branches, review PR/MR changes and open the whole changed file without leaving the request. Codetree runs locally and talks directly to your repository host. No Codetree account, subscription or backend is required.
These screenshots show Codetree 0.3.1 installed from a local build on public pages (the Codetree repository on GitHub and gitlab-org/cli on GitLab) without an account. Each image joins identical light and dark captures: light above the seam, dark below. Separate light and dark captures are in docs/store/screenshots/.
- Repository file tree with file/folder search, keyboard navigation and branch switching.
- Compare branches and tags with Base/Head selection, a changed-file tree and full-file previews.
- Changed-file tree for PRs, MRs and commits, with additions/deletions aggregated by folder.
- Inline review comments with authors and links to their discussions.
- View full in native file headers: complete UTF-8 text, highlighted changes and both revision line numbers. Works with a closed sidebar, collapsed files, additions, deletions and unchanged renames.
- Open PR/MR lists with Requested from me, Reviewed by me, Changes requested, Approved and No reviews filters.
- Viewed marks, unlimited local bookmarks, file-icons file and folder icons (Color, Monochrome or Minimal) and configurable code fonts/sizes.
- Left/right docking, pinning per browser window, hover opening and resizing.
- Custom shortcuts, page-display rules, URL exclusions and folder-click preferences.
- Multiple accounts, GitHub Enterprise Server and self-managed GitLab over HTTPS.
See Features for provider differences. This is an independent implementation with original code and interface. File and folder icons come from file-icons/atom; see Third-party notices.
Install Codetree from the Chrome Web Store, then open or refresh a GitHub or GitLab repository page.
To install a release ZIP manually:
- Download
codetree-<version>.zipfrom GitHub Releases and extract it into a folder. - Open
chrome://extensionsand enable Developer mode. - Select Load unpacked and choose the extracted folder containing
manifest.json. - Open or refresh a GitHub or GitLab repository page.
To run the current source instead, bundle it first and load the generated build/ folder:
git clone https://github.com/ziqq/Codetree.git
cd Codetree
npm ci
npm run buildAfter updating, click Reload on the extension card and refresh repository tabs. After disabling the extension, refresh tabs to remove the previously injected UI.
The edge tab opens the sidebar. Use Files, Pull requests / Merge requests and Bookmarks to switch sections. PR/MR and commit pages initially show changed files; the selector above the tree also provides the repository tree.
In Files, toggle .* to search full paths with a case-insensitive regular expression, for example \.(dart|swift)$ or ^src/. Enter the pattern without / delimiters or flags. Invalid patterns show an error. Search includes loaded entries and combines with Only unviewed; the mode resets when navigating or switching tabs.
Click a tree file to open it on GitHub or GitLab. In a PR, MR or commit, clicking a changed file navigates to the provider's diff. Ctrl/Cmd-click opens the native destination in another browser tab. Switching branches from a file page opens the same path on the selected branch. From other pages, the branch switcher opens the branch root.
View full in a native header or the tree's full-diff action opens a separate dialog. On branch and tag comparisons, clicking a changed file opens this dialog directly. Previous/next controls cover all changed files independently of sidebar search. The Unified / Side-by-side switch keeps your source position, with aligned Old/New lines and synchronized scrolling in Side-by-side.
Back / Forward in View full restores earlier files and source positions in either layout. History records file changes within the dialog, Ctrl/Cmd+G line jumps, Outline jumps and Quick Open @name jumps. A new jump after Back discards the forward steps. History keeps up to 50 points in page memory and clears when the dialog closes.
Use Ctrl/Cmd+P to open Quick Open, a palette that fuzzy-matches names and paths in the loaded file tree. An empty query shows files opened recently within the current page and file mode. Up/Down selects a result, Home/End selects the first/last result, Enter opens the selected file and Escape closes the palette. Ctrl/Cmd-click opens the native destination in a new browser tab. Append a source line, such as src/main.js:120, to open an exact-revision link on GitHub or GitLab. In a diff, the link uses the New revision, or the Old revision for a removed file. Query and recent-file state reset when the route, file mode or account changes.
For JavaScript, TypeScript and Dart, open Outline in View full to browse recognized classes, functions and methods. Select a symbol to reveal its source line. The New / Old lists use the source path for each revision, including renamed and removed files, in Unified and Side-by-side.
With a diff open in View full, type @ in Quick Open to list symbols from the revision selected in Outline, or @render to filter by name. Enter jumps within the viewer. Ctrl/Cmd-click opens an exact-revision source link in a browser tab. Unsupported languages, empty results and analysis limits are shown explicitly. Symbol data stays in viewer memory.
Use Ctrl/Cmd+F or the View full search button to find literal text. Search ignores case by default. Aa (Match case) makes it case-sensitive, and the underlined ab (Whole word) skips matches that touch a Unicode letter, combining mark, digit or underscore. The search covers the complete loaded text, including virtualized rows. Enter / Shift+Enter and the arrow buttons cycle through matches. Enter right after typing searches the latest query without waiting. Escape closes search before closing View full. Both / New / Old chooses which revisions to search. Both counts shared context once, New covers added and context lines, and Old covers removed and context lines. At most 10,000 matches are listed, with a + count when more exist. Native text editors keep their normal find shortcut.
Viewer text search and source-line navigation use the same field; Quick Open has a separate file palette:
| Shortcut and input | Result |
|---|---|
Ctrl/Cmd+F, then :223 |
Find the literal text :223 in the View full diff. |
Ctrl/Cmd+G, then append 223 to the prefilled : and press Enter |
Go to source line 223. |
Ctrl/Cmd+P, then src/main.js:120 and Enter |
Open the file at line 120 on GitHub or GitLab. |
In View full, Line mode offers New (the default) and Old, including removed lines. Enter reveals the line and closes the field. Escape closes the field without moving. Switching back with Ctrl/Cmd+F restores the previous text query. Invalid numbers show the selected revision's valid range, and empty revisions are identified explicitly.
In View full, click a line number to select a source line or Shift-click another number to select a range. Choosing the other revision starts a new selection. The footer offers Copy permalink, Copy code and Clear selection. A permalink uses the exact commit and source path, including renamed files and fork revisions. Copy code includes only the selected revision's text. Selection survives scrolling and layout changes and clears when the current file or viewer is replaced.
In View full, the Changes counter and its arrow buttons cycle through blocks of additions and removals in both layouts. The counter follows scrolling and keeps the selected block current while it remains visible. Diffs without changed lines show 0 / 0 with disabled arrows.
In PR/MR View full dialogs, Viewed & next saves the current file's Viewed mark, then opens the next unviewed file in the same viewer. It follows the full listed changed-file order, wraps to earlier files and ignores sidebar search and Only unviewed. An already viewed file offers Next unviewed without another write. Failed marks keep the file open; failed navigation keeps a successful mark and offers a retry. When all listed files are viewed, the current file stays open with a completion message. GitHub uses its available Viewed mode; GitLab marks remain local.
| Shortcut | Action |
|---|---|
Shift+D |
Open or close the sidebar |
Shift+S |
Open the sidebar and focus search |
Ctrl/Cmd+F |
Open the viewer's shared field in literal text-search mode |
Ctrl/Cmd+G |
Open the same viewer field in line mode, prefilled with : |
Ctrl/Cmd+P |
Open Quick Open for loaded files (path:line) or current-file symbols (@name) |
| Arrow keys | Navigate and expand/collapse rows |
Enter |
Open a file or toggle a folder |
Change the sidebar toggle/search defaults (Shift+D and Shift+S) in Settings → Navigation, or leave a binding blank to disable them. Sidebar shortcuts do not run while editing an input or contenteditable element. Viewer shortcuts work within Codetree's shared field; native text editors keep their own behavior.
In Settings → Navigation → Hide on these URLs, enter up to 64 rules, one per line. Existing URL patterns use * for any characters. Prefix a rule with regex: for a JavaScript regular expression, for example regex:/(issues|discussions)(/|\?|$). Expressions have no / delimiters or flags. Both kinds of rule are case-sensitive and match the full URL, including query parameters but excluding the # fragment. Any matching rule hides the sidebar and native View full controls. Invalid expressions prevent saving and identify the line to fix. Rules are included in optional browser Sync.
Public repositories work without a token. Open Settings to connect an account for private repositories, review filters and authenticated API limits. Being signed in on the website does not authenticate the extension's API requests. A native View full button remains visible when API access is unavailable and offers account connection/retry guidance.
GitHub device-flow and GitLab PKCE sign-in are enabled with Codetree's registered public client IDs, without a backend or client secret. GitLab callbacks cover the published Chrome extension and the maintainer's current development build; other unpacked extension IDs need their own registered callback. Actual account sign-in and token refresh still need live verification. PAT connections remain available. See OAuth setup.
| Provider | Permissions | Server API |
|---|---|---|
| GitHub | Fine-grained PAT: selected repositories, Contents: read, Pull requests: read. Classic PAT: repo for private repositories. Organization approval/SSO may apply. |
https://api.github.com |
| GitHub Enterprise Server | Token issued by that server with the corresponding repository access. | Website origin + /api/v3; GraphQL + /api/graphql |
| GitLab | Personal access token with read_api and project access. Discussions and review filters may require authentication even on public projects. |
Website origin + /api/v4 |
GitHub's Viewed mutation may need additional permission. A failed write reports an error and restores the previous checkbox state. GitLab Viewed marks are local and do not change native GitLab review state.
Choose the provider and its HTTPS website origin in Settings. For a custom server, Chrome requests access to that host during connection. Refresh existing server tabs afterward. Installations under a URL subpath are not supported.
Tokens are verified directly through the chosen host's /user endpoint. Connecting the same host/username replaces its token. Auto uses a matching page username when available, or the host's only account. With multiple accounts and no detected username, select an account in the footer.
Enable Settings → Browser Sync to synchronize preferences and bookmarks through the browser’s account storage. It is off by default. Credentials, connected accounts, selected account IDs, Viewed marks, repository trees and file contents stay local.
Enabling applies existing remote preferences and merges bookmarks by URL; local bookmark details win for duplicate URLs. Later snapshots use the newest saved timestamp; equal timestamps use the last delivered snapshot. Device clock differences can delay incoming changes until a new local save. Sync has a conservative 8 KiB snapshot limit; quota failures leave local data saved and appear in Settings. Disabling stops this device without deleting local data or the shared copy.
Devices need the same browser ecosystem and extension ID. Chrome and Edge/Firefox/Safari account services do not form a shared account. Unpacked installations may have different extension IDs on different computers; do not treat them as a proven multi-device setup. Firefox/Safari builds and portable file transfer remain outside this delivery.
The tree renders visible rows with a small buffer. GitHub normally loads a recursive tree and falls back to loading folders when its API truncates the response. GitLab loads one folder at a time, including projects in nested namespaces.
Search covers loaded files until Load all folders for search finishes; the sidebar identifies this scope. API requests are deduplicated and cached in bounded service-worker memory. Revision-keyed tree data also persists locally across worker/browser restarts, within 48 entries and a 4 MiB budget. Cached trees expire after 24 hours; expired entries are discarded on the next cache load/write. Cache keys include the host, repository, revision and API account; Refresh and account changes clear it. File text and review comments are not persisted in this cache.
Preferences, accounts, tokens, bookmarks, local Viewed marks and the tree cache live in chrome.storage.local for the browser profile. Window pins and pending device sign-in use trusted session storage. Token storage is restricted to trusted extension contexts. Browser Sync sends only preferences and bookmark metadata after explicit opt-in. Bookmark URLs and titles can contain private repository names.
Requests go directly to the selected repository API. Tokens stay bound to its API host; redirects and cookie credentials are disabled. There is no analytics, external font download or third-party runtime dependency. See Privacy.
- This delivery targets Chrome/Chromium as an unpacked extension. Firefox, Safari and store distribution have not been validated.
- GitHub's PR-files API returns at most 3,000 changed files. GitLab has server diff limits and may omit patches. Incomplete data is identified explicitly.
- Paginated lists fail explicitly beyond 10,000 results, unexpected page sizes or a conservative 32 MiB aggregate budget. API JSON bodies are limited to 32 MiB, OAuth/error bodies to 64 KiB.
- Full-file previews support UTF-8 text up to 2 MiB per revision and 100,000 combined lines. Binary files, other encodings and incomplete patches show an unavailable-preview state with a native diff link. An original lexical highlighter covers common source/config languages; it is not a full grammar parser. Unknown languages and files exceeding its token budget retain complete plain-text diffs.
- PR/MR comparisons use the merge base and request head; commit comparisons use the first parent. Private fork requests need access to both source repositories.
- GitLab review filters depend on supported reviewer/approvals endpoints, server states and token access. Unsupported endpoints report errors. Viewed is local on GitLab and falls back to local mode on GitHub when GraphQL is unavailable.
- Native header integration depends on the provider's page structure. Layout changes may need an adapter update; the sidebar full-file action is also available.
- OAuth requires registered public client IDs and live verification before it is ready to use. Custom servers use PATs. Browser Sync is optional and remains within the browser ecosystem; cross-browser account sync is not implemented. Browser-reserved shortcuts may take priority.
src/
manifest.json Chrome MV3 entry points and permissions
shared/ Preferences, routes/URLs, tree model, diff validation and icons
background/ Service worker: message broker, storage, cache, API client, accounts
providers/ GitHub REST/GraphQL and GitLab REST adapters
oauth/ Public client configuration and trusted OAuth flows
sync.js Opt-in browser Sync for preferences and bookmarks
content/ Content script: Shadow DOM sidebar
sidebar/ View, layout, file tree, branches, requests, bookmarks
viewer/ Full-file diff and comments dialogs, syntax highlighting
native/ View full buttons in native diff headers
options/ Settings and account management
icons/ Original extension icons
vendor/file-icons/ Vendored file-icons/atom rules, styles and fonts
scripts/ Bundling, validation and deterministic packaging
tests/ Node.js regression suite
docs/ Feature details, releases and verification record
landing/ EN/RU website and privacy policy (Vite, Nunjucks, TypeScript)
Sass compiles the sidebar, native controls and Settings SCSS; esbuild bundles each entry point (background, content, options) into one classic script in build/, which is the unpacked extension and the source of the release ZIP. See Architecture for contexts, messages, storage and the build.
Edit styles in src/content/sidebar.scss, src/content/styles/_themes.scss, src/content/page.scss and src/options/options.scss. npm run build compiles them with Sass; npm run lint:css validates the compiled CSS. The sidebar and full-file viewer follow GitHub/GitLab light or dark themes, including live theme changes. Settings follows the browser/system preference. Sass is a build dependency and is excluded from the extension.
Edit src/, run npm run build and load build/ as an unpacked extension. JavaScript uses ES modules and explicit DOM construction; run npm run format (Prettier) before committing. Node.js/npm provide bundling and checks only; the extension has no runtime dependencies. Python 3 creates the distributable ZIP. make help lists the same commands.
npm ci
npm run verifyCI checks JavaScript/CSS, manifest/CSP/assets, documentation, workflow syntax, locked dependencies and reproducible packaging on push/PR. Stable tags vX.Y.Z or a manual release run repeat the same checks before publishing a GitHub Release containing the runtime ZIP and SHA-256, then submit the ZIP to the Chrome Web Store when configured. Tags must match the manifest/changelog version and publication requires an approved license. See Checks and releases.
For website development and deployment, see Landing page.
Automated checks do not exercise Chrome's installed extension environment. Read Contributing, Verification, Changelog and AGENTS.md.
Codetree uses the Codetree Source-Available License 1.0. Read the full LICENSE; it controls over this summary. This is a custom source-available license with commercial restrictions, not an OSI open-source license.
- Free personal and workplace use is allowed, including private repositories and commercial development projects.
- Internal modifications, free forks and pull requests are allowed under the license. Using the tool does not apply its license to your independent projects.
- Monetization of Codetree or covered derivatives is prohibited: sales, subscriptions, paid features, advertising, affiliate revenue, sponsorship, fork-related donations and commercial hosting/support/customization for third parties.
- Renaming a fork, adding features or incorporating covered material into a larger paid product does not remove the restrictions. There is no automatic conversion to a permissive license.
- Salary for ordinary development work and internal deployment/modification for the organization using the tool are allowed. Preserve the license and required notices when sharing covered material.
Separate written permission from the relevant rights holder is required for activities outside these terms. Third-party components retain their own licenses; see Third-party notices.


