Keep your AI workspace docs fresh. Track document freshness, enforce cross-file consistency, and prevent stale docs in AI-assisted codebases.
Project description
freshstate
Keep your AI workspace docs fresh.
Track document freshness, enforce cross-file consistency, and prevent stale docs in AI-assisted codebases.
The Problem
AI coding tools (Claude Code, Cursor, Copilot Workspace) maintain persistent context files: CLAUDE.md, .cursor/rules/, state files, decision logs, changelogs. As projects grow, these files drift out of sync. A decision gets recorded but the timeline doesn't update. A README describes features that were removed three sprints ago. Nobody notices until the AI agent gives stale advice.
freshstate catches this before it becomes a problem.
Quick Start
pip install freshstate
# Create a starter config
freshstate init
# Run checks
freshstate check
Configuration
Create a .freshstate.yml in your project root:
files:
- path: README.md
max_age: 30d
severity: warning
- path: "docs/*.md"
max_age: 14d
severity: error
rules:
- name: decision-sync
when: decisions.md
then_also:
- timeline.md
- current-state.md
within: same_commit
severity: error
- name: readme-sync
when: "src/**/*.py"
then_also: README.md
within: 5_commits
severity: warning
owners:
- files: ["docs/*.md"]
owner: docs-team
checklist:
- "Updated table of contents"
- "Checked for broken links"
File Freshness
Track how old files are based on their last git commit. Set thresholds with human-readable durations:
Nh(hours):24h,48hNd(days):7d,30dNw(weeks):2w,4w
Severity levels: info, warning, error, critical
Cross-Reference Rules (the killer feature)
Enforce that related files stay in sync:
same_commit: Files must be modified in the same commit. Perfect for multi-file updates that should be atomic (e.g., a decision log + timeline + state snapshot).N_commits: Files must be modified within N commits of each other. Good for looser coupling (e.g., source code changes should update docs within a few commits). Maximum value: 1000.
Ownership Declarations
Document who owns what and what their update checklist includes. Currently informational; future versions will integrate with CI to enforce checklists.
Output Modes
Text (default)
freshstate check
Color-coded terminal output with freshness status and rule results.
JSON
freshstate check --json
Machine-readable output for dashboards and integrations.
CI Mode
freshstate check --ci
GitHub Actions annotations format. Exit code 1 if any error or critical severity findings.
CI Integration
GitHub Actions
name: Docs Freshness
on: [push, pull_request]
jobs:
freshstate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history needed for git timestamps
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install freshstate
- run: freshstate check --ci
CLI Reference
freshstate check [OPTIONS]
--config, -c PATH Config file path (default: .freshstate.yml)
--ci CI mode with GitHub annotations and exit codes
--json JSON output
--repo PATH Git repository root (default: current directory)
freshstate init [OPTIONS]
--path PATH Output path (default: .freshstate.yml)
--force Overwrite existing config
Roadmap
- v0.2.0: MCP server for AI agent integration
- v0.3.0: Auto-fix suggestions
- v0.4.0: GitHub Action (no Python install needed)
- Cursor/Windsurf integration guides
- Dashboard web UI
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 freshstate-0.2.1.tar.gz.
File metadata
- Download URL: freshstate-0.2.1.tar.gz
- Upload date:
- Size: 20.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
721ec44fd78128a0d24c4b683431b3bb6a869f73698573261aeb0482c3a68096
|
|
| MD5 |
b266845f40e6da0615e1d01f385e8b08
|
|
| BLAKE2b-256 |
efa138a041f1d18deb16509e4cfebdadcb9ce1077e02536c2a5cae99df06a438
|
Provenance
The following attestation bundles were made for freshstate-0.2.1.tar.gz:
Publisher:
publish.yml on sly-the-fox/freshstate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
freshstate-0.2.1.tar.gz -
Subject digest:
721ec44fd78128a0d24c4b683431b3bb6a869f73698573261aeb0482c3a68096 - Sigstore transparency entry: 1071999284
- Sigstore integration time:
-
Permalink:
sly-the-fox/freshstate@5680667becf93ea09817df7ec35836e6b97e1c94 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/sly-the-fox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5680667becf93ea09817df7ec35836e6b97e1c94 -
Trigger Event:
push
-
Statement type:
File details
Details for the file freshstate-0.2.1-py3-none-any.whl.
File metadata
- Download URL: freshstate-0.2.1-py3-none-any.whl
- Upload date:
- Size: 18.4 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 |
b9d7715bf4238b8186b1cc52c6bf09f81219e89928faa5354f0e55c2ca5f7d1d
|
|
| MD5 |
86aefbe5c18c0f32e092af7a5d7c1364
|
|
| BLAKE2b-256 |
6f45c002179fb5c1aeec10c46014fef132c679ab8bbef6647abf6d115df5d8a5
|
Provenance
The following attestation bundles were made for freshstate-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on sly-the-fox/freshstate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
freshstate-0.2.1-py3-none-any.whl -
Subject digest:
b9d7715bf4238b8186b1cc52c6bf09f81219e89928faa5354f0e55c2ca5f7d1d - Sigstore transparency entry: 1071999331
- Sigstore integration time:
-
Permalink:
sly-the-fox/freshstate@5680667becf93ea09817df7ec35836e6b97e1c94 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/sly-the-fox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5680667becf93ea09817df7ec35836e6b97e1c94 -
Trigger Event:
push
-
Statement type: