Shadow documentation engine - generates semantically dense summaries of codebases for AI agent consumption
Project description
osoji
The garbage collector for your codebase
What it does
osoji audits your codebase for dead code, stale documentation, misleading comments, and semantic contradictions. It produces structured, actionable findings — and ships with agent skill files that automate the entire triage-fix-feedback loop. Stop wasting time working around the garbage accumulating in your project.
Quick start
pip install osojicode
export ANTHROPIC_API_KEY=your-key-here
osoji audit .
BYOK — you pay your LLM provider directly. No data leaves your machine except API calls.
Agent workflow
osoji ships with bundled skill files that teach AI coding agents how to work with audit findings end-to-end:
- Audit —
osoji audit .scans your codebase - Triage — your agent classifies each finding as true positive, false positive, or informational
- Fix — your agent applies fixes for confirmed issues and runs tests
- Improve — your agent files GitHub issues on osoji for false positives and missed detections, improving detection for everyone
Running the skills
Claude Code (slash commands):
/osoji-sweep # Full end-to-end: audit, triage, fix, file issues
/osoji-triage # Read-only triage: classify findings, produce report
Other agents — pipe skill content into your agent's prompt:
osoji skills show osoji-sweep | pbcopy # macOS
osoji skills show osoji-sweep | clip # Windows
osoji skills list # See all available skills
Bundled skills
- osoji-sweep — Audit, triage every finding, fix true positives, file GitHub issues for pipeline improvements
- osoji-triage — Classify findings and produce a structured report without modifying any files
Improving detection
osoji gets smarter the more people use it. When your agent finds a false positive or spots something osoji missed, the skill files help it file a structured issue automatically. Those issues improve detection for everyone — including you on your next audit.
What it finds
- Dead symbols — unused exports, unreachable code
- Dead parameters — function args never passed by any caller
- Stale documentation — docs that drifted from the code they describe
- Misleading comments — outdated comments, inaccurate docstrings
- Latent bugs — unchecked returns, type confusion patterns
- Obligation violations — implicit string contracts broken across files
- Unactuated config — config fields declared but never enforced
- Unused dependencies — packages listed but never imported
- Dead CI/CD — stale pipeline jobs, unused Makefile targets
- Orphaned files — source files unreachable from any entry point
How it works
osoji generates shadow documentation to build a semantic model of your codebase, then compares that model against existing documentation and code structure. It uses tiered LLM analysis — cheap models for filtering, expensive models for deep verification — and produces structured JSON findings that agents and humans can act on. Analysis is semantic, not purely AST-based, so it works on any language. AST plugins can augment detection for supported languages (Python, TypeScript).
Commands
| Command | Description |
|---|---|
osoji audit . |
Scan for dead code, stale docs, and semantic issues |
osoji shadow . |
Generate shadow documentation |
osoji check . |
Check for stale or missing shadow docs |
osoji diff |
Show documentation impact of source changes |
osoji stats . |
Token statistics for source vs shadow docs |
osoji report . |
Re-render last audit in a different format |
osoji export . |
Export observatory bundle |
osoji push |
Push bundle to osoji-teams |
osoji skills list |
List bundled agent skill files |
osoji config show |
Inspect resolved configuration |
osoji hooks install |
Manage git hooks |
osoji safety check |
Pre-commit safety checks |
Use osoji <command> --help for full options.
Configuration
osoji is BYOK — bring your own key. It defaults to Anthropic but supports OpenAI, Google, and OpenRouter.
Set your API key and go:
export ANTHROPIC_API_KEY=your-key-here
Switch providers per command:
osoji audit . --provider openai --model gpt-5.2
osoji audit . --provider google --model gemini-2.0-flash
Or configure defaults in TOML:
# ~/.config/osoji/config.toml (global)
# .osoji.local.toml (per-project, gitignored)
default_provider = "openai"
[providers.openai]
small = "gpt-5-mini"
medium = "gpt-5.2"
large = "gpt-5.4"
Supported provider credentials: ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY, OPENROUTER_API_KEY
Config precedence (highest to lowest):
- CLI flags (
--provider,--model) - Environment variables (
OSOJI_PROVIDER,OSOJI_MODEL) .osoji.local.toml(per-project)~/.config/osoji/config.toml(global)- Built-in defaults
Run osoji config show to inspect the effective policy.
Requirements
- Python 3.11+
- An LLM API key (Anthropic recommended, OpenAI and Google also supported)
Links
- Website: osojicode.ai
- PyPI: pypi.org/project/osojicode
- Issues: github.com/osojicode/osoji/issues
Contributing
See CONTRIBUTING.md for development setup, testing, and contribution guidelines.
Security
To report security vulnerabilities, see SECURITY.md.
License
Apache License 2.0. See LICENSE for the full text.
Code of Conduct
This project follows the Contributor Covenant.
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 osojicode-0.2.0.tar.gz.
File metadata
- Download URL: osojicode-0.2.0.tar.gz
- Upload date:
- Size: 482.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4113123e8ffe378421d9d59b9b4a655ba772e4447543a2e4f73c2ca097b2f607
|
|
| MD5 |
348336d95083738bb7ca68761d8df21e
|
|
| BLAKE2b-256 |
55c6e4f35d7f3781e8b3e3a56d3ceba09dbd036530cb1183862657973129181f
|
Provenance
The following attestation bundles were made for osojicode-0.2.0.tar.gz:
Publisher:
publish.yml on osojicode/osoji
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
osojicode-0.2.0.tar.gz -
Subject digest:
4113123e8ffe378421d9d59b9b4a655ba772e4447543a2e4f73c2ca097b2f607 - Sigstore transparency entry: 1162355104
- Sigstore integration time:
-
Permalink:
osojicode/osoji@3e747bbbd96ad2d90dd9c35bb6be1379a21b978b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/osojicode
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3e747bbbd96ad2d90dd9c35bb6be1379a21b978b -
Trigger Event:
release
-
Statement type:
File details
Details for the file osojicode-0.2.0-py3-none-any.whl.
File metadata
- Download URL: osojicode-0.2.0-py3-none-any.whl
- Upload date:
- Size: 253.2 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 |
39984f624db6715d50c151ef6dbf1546609db56193aca449f466cbbe1a903933
|
|
| MD5 |
c4c2893764c23c0f0e191368260c521b
|
|
| BLAKE2b-256 |
10172128ba39321f5bda73b84ce284ff5a7b8d7b786119108c2496bd5c5b845b
|
Provenance
The following attestation bundles were made for osojicode-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on osojicode/osoji
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
osojicode-0.2.0-py3-none-any.whl -
Subject digest:
39984f624db6715d50c151ef6dbf1546609db56193aca449f466cbbe1a903933 - Sigstore transparency entry: 1162355184
- Sigstore integration time:
-
Permalink:
osojicode/osoji@3e747bbbd96ad2d90dd9c35bb6be1379a21b978b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/osojicode
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3e747bbbd96ad2d90dd9c35bb6be1379a21b978b -
Trigger Event:
release
-
Statement type: