Metadata-Version: 2.5
Name: attocode-code-intel
Version: 0.1.2
Summary: Local code search and navigation for coding agents and people
Project-URL: Homepage, https://github.com/eren23/attocode
Project-URL: Repository, https://github.com/eren23/attocode
Project-URL: Bug Tracker, https://github.com/eren23/attocode/issues
Project-URL: Changelog, https://github.com/eren23/attocode/blob/main/CHANGELOG.md
License-Expression: MIT
License-File: LICENSE
Keywords: code-navigation,code-search,coding-agents,mcp,tree-sitter
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development
Requires-Python: >=3.12
Requires-Dist: aiosqlite>=0.20
Requires-Dist: click>=8.1
Requires-Dist: filelock>=3.16
Requires-Dist: httpx>=0.27
Requires-Dist: mcp<2,>=1.26
Requires-Dist: numpy>=2
Requires-Dist: pathspec>=0.12
Requires-Dist: psutil>=6
Requires-Dist: pydantic>=2
Requires-Dist: python-dotenv>=1
Requires-Dist: pyyaml>=6
Requires-Dist: rich>=13
Requires-Dist: structlog>=24.1
Requires-Dist: tenacity>=9
Requires-Dist: tiktoken>=0.7
Requires-Dist: tomli-w>=1
Requires-Dist: tomlkit>=0.13
Requires-Dist: tree-sitter-bash
Requires-Dist: tree-sitter-c
Requires-Dist: tree-sitter-c-sharp
Requires-Dist: tree-sitter-cpp
Requires-Dist: tree-sitter-css
Requires-Dist: tree-sitter-elixir
Requires-Dist: tree-sitter-go
Requires-Dist: tree-sitter-hcl
Requires-Dist: tree-sitter-html
Requires-Dist: tree-sitter-java
Requires-Dist: tree-sitter-javascript
Requires-Dist: tree-sitter-json
Requires-Dist: tree-sitter-kotlin
Requires-Dist: tree-sitter-lua
Requires-Dist: tree-sitter-php
Requires-Dist: tree-sitter-python
Requires-Dist: tree-sitter-ruby
Requires-Dist: tree-sitter-rust
Requires-Dist: tree-sitter-scala
Requires-Dist: tree-sitter-swift
Requires-Dist: tree-sitter-toml
Requires-Dist: tree-sitter-typescript
Requires-Dist: tree-sitter-yaml
Requires-Dist: tree-sitter-zig
Requires-Dist: tree-sitter<0.26,>=0.23
Requires-Dist: watchfiles>=1
Provides-Extra: dev
Requires-Dist: bcrypt>=4.0; extra == 'dev'
Requires-Dist: bump-my-version>=0.28; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest-mock>=3.14; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: python-jose[cryptography]>=3.3; extra == 'dev'
Requires-Dist: respx>=0.22; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Requires-Dist: sqlalchemy[asyncio]>=2.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
Requires-Dist: mkdocs>=1.6; extra == 'docs'
Requires-Dist: pymdown-extensions>=10.0; extra == 'docs'
Provides-Extra: graph
Requires-Dist: networkx>=3.0; extra == 'graph'
Provides-Extra: http
Requires-Dist: fastapi>=0.115; extra == 'http'
Requires-Dist: networkx>=3.0; extra == 'http'
Requires-Dist: python-multipart>=0.0.18; extra == 'http'
Requires-Dist: uvicorn[standard]>=0.34; extra == 'http'
Provides-Extra: semantic
Requires-Dist: sentence-transformers>=3.0; extra == 'semantic'
Provides-Extra: semantic-nomic
Requires-Dist: einops; extra == 'semantic-nomic'
Requires-Dist: sentence-transformers>=3.0; extra == 'semantic-nomic'
Provides-Extra: service
Requires-Dist: alembic>=1.14; extra == 'service'
Requires-Dist: arq>=0.26; extra == 'service'
Requires-Dist: asyncpg>=0.30; extra == 'service'
Requires-Dist: bcrypt>=4.0; extra == 'service'
Requires-Dist: cryptography>=41.0; extra == 'service'
Requires-Dist: fastapi>=0.115; extra == 'service'
Requires-Dist: httpx-oauth>=0.15; extra == 'service'
Requires-Dist: networkx>=3.0; extra == 'service'
Requires-Dist: pgvector>=0.3; extra == 'service'
Requires-Dist: pydantic-settings>=2.0; extra == 'service'
Requires-Dist: pygit2>=1.14; extra == 'service'
Requires-Dist: python-jose[cryptography]>=3.3; extra == 'service'
Requires-Dist: python-multipart>=0.0.18; extra == 'service'
Requires-Dist: redis[hiredis]>=5.0; extra == 'service'
Requires-Dist: sqlalchemy[asyncio]>=2.0; extra == 'service'
Requires-Dist: uvicorn[standard]>=0.34; extra == 'service'
Provides-Extra: tree-sitter-all
Requires-Dist: tree-sitter-language-pack>=0.6; extra == 'tree-sitter-all'
Description-Content-Type: text/markdown

# attocode-code-intel

Local code search and navigation for coding agents and for people. It runs as an MCP server for Codex, Claude Code, Cursor and other MCP clients, and as a command in your terminal. It needs no model, no API key and no network.

**Status: beta.** We measured the search quality (see [What we measured](#what-we-measured)). We have not shown that it makes agents faster or more accurate.

## Quickstart

You need Python 3.12 or later and Git.

```sh
uv tool install attocode-code-intel
cd /path/to/your/project
attocode-code-intel init
```

Then restart your agent. `init` configures Codex, Claude Code and Cursor. Use `--client claude`, `--client codex` or `--client cursor` for one client. Codex needs a trusted project for a project configuration. Claude Code can ask you to enable the project MCP server.

To check the setup, run `attocode-code-intel doctor`. It starts the configured server, calls two tools and shows the result for each client.

For other clients (VS Code, Zed, Windsurf, Claude Desktop and more), run `attocode-code-intel install <target>`. `attocode-code-intel commands` lists the targets.

To use the latest source, install from a clone of this repository: `uv tool install /path/to/attocode/packages/code-intel`.

## What your agent gets

The agent sees 16 tools (the `daily` profile):

| Use | Tools |
|---|---|
| Find code | `semantic_search`, `fast_search`, `search_symbols`, `bootstrap`, `relevant_context` |
| Read a symbol | `inspect_symbol`, `symbols`, `cross_references`, `call_graph` |
| See structure | `dependencies`, `explore_codebase`, `project_summary` |
| Plan a change | `impact_analysis`, `suggest_tests`, `review_change` |
| Check the server | `capabilities` |

- When the agent knows a symbol, `inspect_symbol(symbol_name="...", task_hint="...")` gives the definition, the source, the references and candidate tests in one call.
- In an unfamiliar repository, `bootstrap(task_hint="...")` finds the relevant code and gives a map.
- `impact_analysis` and `suggest_tests` help plan the checks for a change.

For all tools (about 140: rules, security scans, history, snapshots and more), add `--profile full` to `init`. The [tool catalog](https://github.com/eren23/attocode/blob/main/docs/intelligence-tools.md) lists them. The [search details](https://github.com/eren23/attocode/blob/main/docs/intelligence-search.md) page describes ranking, the response format and the experimental rerankers.

## Commands for people

Run these in your project:

```sh
attocode-code-intel query "parse config"      # search the code with its own words
attocode-code-intel symbols src/app.py        # the symbols of a file
attocode-code-intel symbols --search greet    # find a symbol by name
attocode-code-intel impact src/app.py         # the files that a change can affect
attocode-code-intel deps src/app.py           # what a file imports, and what imports it
attocode-code-intel hotspots                  # the files with the most risk or complexity
```

Search matches the words of the code and its paths. It does not use embeddings unless you install the `semantic` extra.

## What we measured

- **Search.** We ran the 560 issues of Loc-Bench V1, with the full issue as the query. For 53.2% of them, the first five files held all files of the fix (file Acc@5 0.532). On a mix of 10 public benchmarks, file Acc@5 was 0.425. See the [first-stage results](https://github.com/eren23/attocode/blob/main/packages/code-intel/evals/results/2026-10-09-locbench-560-first-stage.md) and the [matrix results](https://github.com/eren23/attocode/blob/main/packages/code-intel/evals/results/2026-10-10-matrix-r1.md).
- **Agents.** In four studies, Claude Code (Sonnet 5.5) named the files to edit for an issue. The server did not raise file Acc@5. Each run with the server cost 1.4 to 2.1 times as much. When the agent could choose, it seldom called the server. See the [agent pilot](https://github.com/eren23/attocode/blob/main/packages/code-intel/evals/results/2026-10-10-agent-pilot.md) and [study R3](https://github.com/eren23/attocode/blob/main/packages/code-intel/evals/results/2026-10-10-agent-r3.md).

We have not tested longer agent tasks, such as edits or reviews.

## Limits and troubleshooting

- **First search.** The first tool call starts the index build. A search waits up to 15 seconds for the index. On a large repository, a search can report that the index is warming. Then search again. An empty result during warm-up does not prove that the code is absent.
- **Index location.** The index is in `.attocode/` in your project. When the server makes that folder, it adds a `.gitignore`, so the index stays out of commits.
- **What the index reads.** The server reads at most 50,000 files and skips files over 1 MB. It skips files that `.gitignore` ignores, and folders that start with a dot. It also skips folders named `build`, `out`, `output`, `target`, `env`, `tmp`, `vendor` or `coverage`, and binary, media and lock files.
- **Languages.** The base install parses Bash, C, C#, C++, CSS, Elixir, Go, HCL, HTML, Java, JavaScript, JSON, Kotlin, Lua, PHP, Python, Ruby, Rust, Scala, Swift, TOML, TypeScript, YAML and Zig. The `tree-sitter-all` extra adds about 170 more.
- **Remove the setup.** Run `attocode-code-intel init --remove`. It restores an entry that existed before `init`.
- **Server does not answer.** Run `attocode-code-intel doctor`. If a client shows "not configured", run `init` for it. After a change, restart the agent. In Claude Code, `/mcp` shows the server state.
- **HTTP server.** `attocode-code-intel --transport http` needs the `http` extra. It serves only this computer unless you set `ATTOCODE_API_KEY`.

For one installation for all repositories, use `init --global`. A global server works on the repository of its working directory, or on the `workspace` that a tool call names.

## Teams and remote agents

[Self-hosting and migration](https://github.com/eren23/attocode/blob/main/docs/intelligence.md) covers PostgreSQL, Redis, workers, authentication, and the dashboard. The service serves native Streamable HTTP MCP at `/mcp/`. The dashboard provides connection snippets and knowledge editing.

```sh
attocode-code-intel init --client all --server https://intel.example.com --repo REPOSITORY_UUID
attocode-code-intel doctor --client codex --remote
```

Set `ATTOCODE_API_KEY` in the agent's environment. Use `intelligence:read` for analysis and add `intelligence:write` for knowledge changes. Every repository operation checks membership and scope before using cached analysis. Results identify repository, source, commit, index coverage, and truncation. PostgreSQL stores shared knowledge with authorship, revision, and file anchors.

Local and remote entries coexist. Remote calls analyze committed branches or explicit revisions. Local edits remain local. To copy a particular learning to your team, review and run an explicit share:

```sh
attocode-code-intel share --project . --learning 12 --server https://intel.example.com --repo REPOSITORY_UUID --dry-run
attocode-code-intel share --project . --learning 12 --server https://intel.example.com --repo REPOSITORY_UUID
```

`cross_repo_search` searches explicitly selected authorized repositories and retains provenance on each result.

## Development

The package is in `packages/code-intel` of the [attocode repository](https://github.com/eren23/attocode).

```sh
uv sync --extra dev --extra code-intel
uv run pytest -c packages/code-intel/pyproject.toml --confcutdir=packages/code-intel/tests packages/code-intel/tests
uv build --package attocode-code-intel
```

Releases use `intel-v*` tags ([release guide](https://github.com/eren23/attocode/blob/main/docs/intelligence-release.md)).

[Product and operations guide](https://github.com/eren23/attocode/blob/main/docs/intelligence.md) · [Tool catalog](https://github.com/eren23/attocode/blob/main/docs/intelligence-tools.md) · [Search details](https://github.com/eren23/attocode/blob/main/docs/intelligence-search.md) · [Changelog](https://github.com/eren23/attocode/blob/main/CHANGELOG.md) · [MIT license](https://github.com/eren23/attocode/blob/main/packages/code-intel/LICENSE)
