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
Release files for freshstate 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| freshstate-0.2.1.tar.gz | 20.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| freshstate-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.8 kB
Release files / freshstate-0.2.1.tar.gz
| Download URL | freshstate-0.2.1.tar.gz |
|---|---|
| Size | 20.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
721ec44fd78128a0d24c4b683431b3bb6a869f73698573261aeb0482c3a68096
|
|
BLAKE2b-256 checksum How to use checksums |
efa138a041f1d18deb16509e4cfebdadcb9ce1077e02536c2a5cae99df06a438
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.
Transparency logRelease files / freshstate-0.2.1-py3-none-any.whl
| Download URL | freshstate-0.2.1-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b9d7715bf4238b8186b1cc52c6bf09f81219e89928faa5354f0e55c2ca5f7d1d
|
|
BLAKE2b-256 checksum How to use checksums |
6f45c002179fb5c1aeec10c46014fef132c679ab8bbef6647abf6d115df5d8a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.
Transparency log