Skip to main content

Shared AI context cache for software teams — eliminate the cold start

Project description

TeamCache

Shared AI context cache for software teams. Eliminates the cold start — every developer after the first pays near-zero tokens for files that haven't changed.

The problem

10 developers. Same files. Read by AI every day. Nobody shares what was learned. Monthly token budget exhausted in 10–15 days instead of 20–22.

How it works

  1. Static indexteamcache index parses every file in seconds with tree-sitter. No AI, no API key. Every file gets a structural summary immediately.
  2. AI upgrade — When your AI tool reads a file, it calls cache_summary() to store a richer understanding. That summary is shared with your whole team via git.
  3. No cold start — The next developer gets the AI summary instantly. They never read the raw file. Tokens saved.

Quickstart (under 10 steps)

# 1. Install
pip install teamcache

# 2. Go to your repo
cd your-repo

# 3. Initialize
teamcache init

# 4. Index the whole repo (seconds, no AI, no API key)
teamcache index

# 5. Register with your AI tool
teamcache install                        # Claude Code (default)
teamcache install --agent cursor         # Cursor
teamcache install --agent codex          # OpenAI Codex CLI
teamcache install --agent windsurf       # Windsurf
teamcache install --agent aider          # Aider
teamcache install --agent opencode       # OpenCode

# 6. Commit the static index to share with your team
git add .teamcache/objects/
git commit -m "chore: add teamcache static index"
git push

That's it. Your AI tool now calls get_file_context() before reading any file and cache_summary() after. Every teammate gets the benefit.


Commands

Command What it does
teamcache init Initialize in the current git repo
teamcache index Parse all files, build static summaries
teamcache install [--agent NAME] Register MCP server with your AI tool
teamcache serve Start the MCP stdio server (called by AI tool)
teamcache changed [--since BRANCH] Re-index files changed since a branch
teamcache sync Rebuild local index from committed objects
teamcache invalidate [PATH|--stale|--all] Mark entries as needing refresh
teamcache stats Show AI vs static coverage, top contributors
teamcache report Write .teamcache/reports/YYYY-MM.md
teamcache commit git add .teamcache/objects/ && git commit
teamcache uninstall [--agent NAME] Remove MCP registration and instructions

MCP tools

Your AI tool gets these tools via the MCP server:

Tool What it does
repo_overview() Directory tree, languages, entry points, coverage
get_file_context(path) Returns AI or static summary; tells AI what to do
cache_summary(path, summary, lang) AI writes its understanding back into the cache
find_relevant_files(task) Semantic + keyword search across all summaries
get_symbols(path) Functions, classes, imports for a file
find_by_symbol(name) Where is UserService defined? Line number included.
get_changed_context(branch) What changed since main, which need AI re-read

Architecture

.teamcache/
  objects/          ← git committed — shared with team
    summaries/      ← AI and static summary objects (immutable JSON)
    symbols/        ← tree-sitter symbol index objects
    repomap.json    ← cross-file import map
  config.yaml       ← schema_version: v1 (nothing else)
  local/            ← gitignored — rebuilt locally
    index.sqlite    ← fast lookup index
    embeddings.sqlite ← semantic search vectors

Cache key: sha256(sha256(file_bytes) + "|" + schema_version)
File changes → new key → old object ignored automatically.

Two-tier summaries:

  • static — tree-sitter parse, runs in milliseconds, no AI, available from day one
  • ai — written by the AI tool after it reads a file, much richer, preferred when available

No external calls from teamcache itself. The AI tool already running writes summaries via cache_summary(). teamcache never calls any AI API. No API key. No separate cost.

CI integration

GitHub Actions

.github/workflows/teamcache-sync.yml is included — keeps static index fresh on every merge to main.

GitLab CI

See .gitlab/teamcache-sync.yml. Include it in your pipeline:

include:
  - local: .gitlab/teamcache-sync.yml

Requirements

  • Python 3.10+
  • Git
  • No API key required at any point

Optional (installed automatically with pip install teamcache[all]):

  • tree-sitter — more accurate symbol extraction (falls back to regex without it)
  • sentence-transformers — semantic search (falls back to keyword search without it)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

teamcache-0.1.4.tar.gz (63.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

teamcache-0.1.4-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file teamcache-0.1.4.tar.gz.

File metadata

  • Download URL: teamcache-0.1.4.tar.gz
  • Upload date:
  • Size: 63.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for teamcache-0.1.4.tar.gz
Algorithm Hash digest
SHA256 2239f2eda1fe965c12cbc568f6ca31dd49a33d19123038b74596a26884848c58
MD5 3c920d2b468208725283e5e9615f8683
BLAKE2b-256 1bc70051ea5bc14645b6e7c358cf95bf940413e9413fae8ec7890e2ca278ec59

See more details on using hashes here.

Provenance

The following attestation bundles were made for teamcache-0.1.4.tar.gz:

Publisher: publish.yml on teamcache-dev/teamcache

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file teamcache-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: teamcache-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for teamcache-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d8189a1c2f75a6ccb9280b23bbddda08d5f5cf8a8758a6e6ed21bb0eab48e047
MD5 f41b8c797156f063d4ce824a5547a694
BLAKE2b-256 38d6e8cf7755637d3f4b11f6271158c96a61dc1c4be08110b9eae1850b64faa6

See more details on using hashes here.

Provenance

The following attestation bundles were made for teamcache-0.1.4-py3-none-any.whl:

Publisher: publish.yml on teamcache-dev/teamcache

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page