---
title: "pi-context-tree, path-based context for Pi"
description: "An extension for the Pi coding agent that injects the right context at the right time, by path and operation, from versioned CONTEXT.json files."
url: "https://mc-stud.io/en/open-source/pi-context-tree"
lang: "en"
updated: "2026-10-12"
---

Beta Pi context AGENTS.md governance

# pi-context-tree

An extension for the Pi coding agent that injects the right context at the right time, by path and operation, from CONTEXT.json files versioned in the repository.

Install

`pi install git:github.com/ZEDIUM-Off/pi-context-tree`

Young tools: read the repository README before installing.

**12** commits / 12 months

**Latest version**

v0.4.2

**stars**

0

**forks**

0

**contributor**

1

**open issues**

0

**Last commit**

4 May 2026

Commits per month. Last 12 months, each repository on its own scale.

GitHub figures taken on 12 October 2026.

**Source code**

[github.com/ZEDIUM-Off/pi-context-tree](https://github.com/ZEDIUM-Off/pi-context-tree)

**Licence**

MIT licence

**Status**

Beta

## What it does

pi-context-tree moves context routing out of model behaviour and into repository configuration. Instead of asking the agent to remember to read the docs, each folder declares, in a `CONTEXT.json` file, which files or URLs to inject for which path and operation.

Rules fire on precise events (session start, agent start, tool calls, subagent spawn), with budgets that bound what gets injected. The extension ships configuration and audit skills, plus commands to check status and validate the configuration.

It is a primitive I recommend to teams: context becomes deterministic, auditable, and lives next to the code it describes.

[Source code](https://github.com/ZEDIUM-Off/pi-context-tree)

## When to reach for it

- Your agents forget project rules as soon as the conversation grows.
- You burn tokens loading a global prompt that only concerns part of the repository.
- You want injected context to be reviewed like code.

## Let’s talk about what AI could change for you

A 30-minute discovery call, by video and with no commitment, to talk about your project, your constraints and the best next step.

[Book a call](https://calendar.app.google/VQTPrCgNvQSNwdA7A)

[contact@mc-stud.io](mailto:contact@mc-stud.io?subject=First%20call)
