Skip to main content

trace

Universal agent context tracking.

When an AI agent works on code, trace records which project it's in. Any tool — MCP servers, hooks, scripts — can read ~/.trace/active_project to know the current context.

Install

pip install trace

How it works

A Claude Code hook fires on every file operation (Read, Edit, Write). It extracts the git root from the file path and writes it to ~/.trace/active_project. That's it.

Any tool can read this file. No coordination needed.

Python API

from trace_pkg import active_project

project = active_project()  # Path("/Users/you/your-project") or None

CLI

trace          # print active project
trace set .    # manually set active project

Claude Code setup

Add to ~/.claude/settings.json:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Read|Edit|Write|Glob|Grep",
        "hooks": [
          {
            "type": "command",
            "command": "trace-hook",
            "async": true
          }
        ]
      }
    ]
  }
}

Why

MCP servers need to know what project the agent is working in. Without trace, each server has to guess from cwd, env vars, or explicit configuration. With trace, there's one source of truth that updates automatically.

Metadata

Release files for chalkline 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chalkline 0.1.0
File Size Uploaded Provenance
chalkline-0.1.0.tar.gz 4.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for chalkline 0.1.0
File Interpreter ABI Platform
chalkline-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.9 kB

Release files / chalkline-0.1.0.tar.gz

Download URL chalkline-0.1.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0e3ef9f0d029bca7d54f9304a336587556e0545f1cb8ab811b9df06da284fd00
BLAKE2b-256 checksum
How to use checksums
f304b9d5392ad33071456af4957729ee2c592544fb1c6324094071a235778f25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / chalkline-0.1.0-py3-none-any.whl

Download URL chalkline-0.1.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4bdba6b7639aa1a5d9cafaff7b62a9226fdd3bfe026093e30f901faaffe2b1b
BLAKE2b-256 checksum
How to use checksums
1d6710709309370ab92202e64a022df3f0f8bb142b56b6cc0c343239a3ada695
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for chalkline 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page