Generate decision logs from Claude Code sessions
Project description
trajectory
Capture the why behind AI-generated code.
When you use Claude Code to write code, trajectory generates a decision log — what was decided, what was rejected, what was assumed. Attach it to your PR so reviewers see the reasoning, not just the diff.
Install
pip install code-trajectory
Requires ANTHROPIC_API_KEY environment variable.
Usage
cd your-project
trajectory gen
Creates trajectory.md:
# feat/add-user-auth
> Implement JWT authentication for the API
**Decisions:**
- Use RS256 for token signing
- Store refresh tokens in httpOnly cookies
... +3 more (--audit)
---
_Session: a1b2c3d4_
Commands
trajectory gen # generate trajectory.md
trajectory gen --copy # generate + copy to clipboard
trajectory gen --flow # ASCII flow diagram
trajectory gen --audit # full provenance details
trajectory gen -s 17c072d8 # use specific session
trajectory list # show available sessions
Flow Diagram
trajectory gen --flow
╔══ feat/add-user-auth ══╗
┌─ INTENT ────────────────────────────┐
│ Add JWT auth to the API │
└─────────────────────────────────────┘
│
▼
┌─ DIRECTIVE ─────────────────────────┐
│ Use RS256 for token signing │
└─────────────────────────────────────┘
│
▼
┌─ IMPLEMENT ─────────────────────────┐
│ Add refresh token rotation │
└─────────────────────────────────────┘
│
▼
┌─ OUTPUT ────────────────────────────┐
│ jwt.ts (new) │
│ auth.ts (3 edits) │
└─────────────────────────────────────┘
╳─ REJECTED ──────────────────────────╳
╳ Session-based auth with Redis ╳
╳─────────────────────────────────────╳
╚══ Session: a1b2c3d4 ══╝
Full Provenance (--audit)
**Decisions:**
- Use RS256 for token signing
Better security for production environments
`[chosen]` _Selected from: RS256 / HS256 / ES256_
**Rejected:**
- Session-based auth with Redis
_More infrastructure overhead_
**Assumptions:**
- API consumed by first-party clients only `[inferred]`
**Deferred:**
- Rate limiting _Explicitly marked for v2_
| Label | Meaning |
|---|---|
[explicit] |
User directly stated |
[chosen] |
User selected from options |
[inferred] |
Deduced from context |
How It Works
- Claude Code saves session logs to
~/.claude/projects/ - Trajectory reads the JSONL (conversation, tool calls, file edits)
- Uses Claude API to extract structured decisions
- Generates clean markdown for your PR
Requirements
- Python 3.9+
- Claude Code
ANTHROPIC_API_KEY
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file code_trajectory-0.1.1.tar.gz.
File metadata
- Download URL: code_trajectory-0.1.1.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f415d22397551cba3a02ad099d1cbde689d83b8691351b35ba13c08a6ac47335
|
|
| MD5 |
93c14fc5a0a3f486352fd93266a9f17e
|
|
| BLAKE2b-256 |
5e3749241907d49d50d63fee0b5d9a108225c58b934716166fab2ee062f632ee
|
Provenance
The following attestation bundles were made for code_trajectory-0.1.1.tar.gz:
Publisher:
publish.yml on nishantmodak/trajectory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
code_trajectory-0.1.1.tar.gz -
Subject digest:
f415d22397551cba3a02ad099d1cbde689d83b8691351b35ba13c08a6ac47335 - Sigstore transparency entry: 814128059
- Sigstore integration time:
-
Permalink:
nishantmodak/trajectory@61193219b63db953db62b163fd59735b23665aad -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/nishantmodak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@61193219b63db953db62b163fd59735b23665aad -
Trigger Event:
release
-
Statement type:
File details
Details for the file code_trajectory-0.1.1-py3-none-any.whl.
File metadata
- Download URL: code_trajectory-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
392e173a7f9c5ac4a7a9424b3971b0faa70aec1b72a0080569f0c1f9edf17892
|
|
| MD5 |
37491812c67a9a9b1f8b0b5c23f0947d
|
|
| BLAKE2b-256 |
d41912d233d63dc1079e454f9fcaabed3eccf7ae9842d176be92a680106d86a4
|
Provenance
The following attestation bundles were made for code_trajectory-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on nishantmodak/trajectory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
code_trajectory-0.1.1-py3-none-any.whl -
Subject digest:
392e173a7f9c5ac4a7a9424b3971b0faa70aec1b72a0080569f0c1f9edf17892 - Sigstore transparency entry: 814128063
- Sigstore integration time:
-
Permalink:
nishantmodak/trajectory@61193219b63db953db62b163fd59735b23665aad -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/nishantmodak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@61193219b63db953db62b163fd59735b23665aad -
Trigger Event:
release
-
Statement type: