Skip to main content

Extracts Java/Kotlin code structure for AI context.

Project description

Demo GIF

Jctx — Give AI full understanding of your Java, Kotlin & Python codebase

Stop pasting files. Get real architecture-aware answers.

Generate complete project context in seconds.

Turn any Java, Kotlin, or Python project into a single AI-ready context.txt (or context.md) in seconds.

Jctx "C:\projects\MyApp"
→  context.txt written  (Java: 39 files | Kotlin: 12 files | Python: 15 files | POM: 1 file | Gradle: 1 file)

No config. No dependencies. Just Python and a folder.


Why it exists

You're working on a Java, Kotlin, or Python project. You open an AI chat to get help. Before you can even ask your question, you spend 10 minutes copy-pasting files, explaining your class structure, summarising what each module does.

Before: ChatGPT suggests random classes

After: ChatGPT tells exactly which class to modify and why

Jctx does all of that in one command.

It scans your project and writes a clean, structured context.txt (or context.md) — every class, every field, every method signature, every Javadoc/KDoc comment, and your build files — formatted so an AI can immediately understand your entire codebase.

It also provides Token Count Estimation, Language Percentages, and a Dependency Graph — all printed to your console automatically.

Paste it. Ask your question. Get useful answers.


Output (real example)

Click to expand sample context.txt (Plain Text - Default)
================================================================
 JCTX v2.0.0 - Java, Kotlin & Python Context Extractor
 Project : C:\projects\Talken
 Date    : 2026-03-31 12:00:00
 Files   : Java: 39 file(s) | Kotlin: 5 file(s) | Python: 2 file(s) | POM: 1 file(s) | Gradle: 1 file(s)
================================================================

================================================================
 SECTION 1 - PROJECT FILE TREE
================================================================

  Talken\
  ├── src\
  │   └── main\
  │       ├── java\
  │       │   └── org\
  │       │       └── flexstudios\
  │       │           └── talken\
  │       │               ├── Controls.java
  │       │               └── TalkenClient.java
  │       └── kotlin\
  │           └── org\
  │               └── flexstudios\
  │                   └── talken\
  │                       └── UserProfile.kt
  ├── build.gradle
  └── pom.xml

================================================================
 SECTION 2 - POM.XML CONTENT
================================================================

----------------------------------------------------------------
  FILE: pom.xml
----------------------------------------------------------------

  <?xml version="1.0" encoding="UTF-8"?>
  <project>
      <modelVersion>4.0.0</modelVersion>
      <groupId>org.flexstudios</groupId>
      <artifactId>talken</artifactId>
      <version>1.0.0</version>
  </project>

================================================================
 SECTION 3 - KOTLIN CLASS AND MEMBER DETAILS
================================================================

----------------------------------------------------------------
  FILE: src\main\kotlin\org\flexstudios\talken\UserProfile.kt
----------------------------------------------------------------

  CLASS: UserProfile
  DOC  : Represents the user's local profile settings.

  DATA MEMBERS:
    · private val String displayName
    · private val String email

  METHODS:
    [1] String getAboutSection()
         DOC: (no documentation)

================================================================
 END OF REPORT
================================================================

Install

Option 1: PyPI (Recommended) The easiest way to install Jctx on any OS (Windows, macOS, Linux) is via pip:

pip install jctx

The jctx command will be instantly available in your terminal.

Option 2: Manual Download (Windows)

  1. Download The Latest Release Zip.
  2. Unzip it
  3. Right-click Setup.batRun as administrator
  4. Open a new terminal
jctx "C:\path\to\your\java\project"

No admin rights? Copy jctx.py + jctx.bat anywhere and run jctx.bat directly.

Not on Windows? Run python jctx.py "path/to/project" on any OS with Python 3.8+.


Usage

Jctx <project_folder> [--md] [--slim] [--no-tree] [--clipboard] [--print] [--version] [--help]
Flag Effect
(none) Saves context.txt into your project folder and prints token estimates
--md Outputs a cleanly formatted Markdown file (context.md) instead of plain text
--slim Slim mode: output only class names and method signatures (omits fields and docs) to save tokens
--no-tree Skips the file tree section (shorter output)
--clipboard Copies the generated report directly to your clipboard
--print Also prints to the console
--version Shows the Jctx version
--help Shows help

How to use the output

Paste context.txt (or the contents of context.md) into any AI chat and ask your question:

"Here's my Java/Kotlin/Python project structure: [paste]. I want to refactor the messaging module to use WebSockets — where should I start?"

Works great with Claude, ChatGPT, Gemini, and any other AI that accepts long text input.


Console Metrics

After generating the file, Jctx prints a full analytics dashboard to your console:

Language Percentages

Shows the exact split of Java vs Kotlin code with a visual progress bar:

================================================================
 LANGUAGE PERCENTAGES
================================================================
  Java    :  60.2%  ██████████████████████████████░░░░░░░░░░░░░░░░░░░░  (~23,400 tokens)
  Kotlin  :  28.1%  ██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░  (~10,910 tokens)
  Python  :  11.7%  █████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░  (~ 4,560 tokens)
================================================================

Dependency Graph

Automatically maps which of your project classes depend on which (only project-internal references — no external library noise):

================================================================
 DEPENDENCY GRAPH (project-internal)
================================================================
  EncryptionModule → (none)
  MessagingModule → EncryptionModule, UserProfile
  TalkenClient → EncryptionModule, MessagingModule, UserProfile
  UserProfile → (none)
================================================================

Token Count Estimate

Shows the total token count with a breakdown by section and checks whether your context fits each major AI model's context window:

================================================================
 TOKEN ESTIMATE
================================================================
  Total tokens : ~34,767

  Language Breakdown:
    Java        : ~  23,400  ( 59.5%)
    Kotlin      : ~  10,910  ( 27.7%)
    Python      : ~   4,560  ( 11.6%)
    Build files : ~     145  (  0.4%)
    File tree   : ~     312  (  0.8%)

  Context Window Fit:
    Y Llama 4 Scout (10M)      Y Gemini 3.1 (2M)          Y Grok (2M)
    Y GPT-5.4 (1M)             Y Claude 4.6 (1M)          Y Qwen 3 (1M)
================================================================

.jctxignore — Custom Exclusions

Place a .jctxignore file in the project root to exclude additional directories or files from context extraction:

# Skip test directories
**/test/**

# Skip generated code
generated/

# Skip specific file patterns
*.test.java
Pattern Meaning
dirname/ Skip any directory named dirname
**/test/** Skip any directory named test anywhere in the tree
*.test.java Skip files matching the glob pattern
# comment Lines starting with # are ignored

When a .jctxignore is detected, the console banner shows:

  .jctxignore: yes (2 dirs, 1 patterns)

What it extracts

What Detail
File tree Full project structure, build folders excluded
Build Files Full content of your pom.xml, build.gradle, requirements.txt, and pyproject.toml
Classes Java/Kotlin classes and interfaces, Python classes, plus all docstrings/JavaDocs/KDocs
Fields Type, name, access modifier, val/var (Kotlin), instance vars (self.x), inline comments
Methods Numbered list — return type, name, params, decorators, top-level Python/Kotlin functions

Auto-ignored: build/, target/, .idea/, .git/, node_modules/, .gradle/, .class, .jar, and all other build artifacts. Customize further with .jctxignore.


Requirements

  • Python 3.8 or newer — python.org
  • Works on Windows, macOS, Linux

Roadmap

  • Kotlin support
  • Markdown output mode (context.md)
  • Multi-language project estimations (mixed Java + Kotlin percentages)
  • Token count estimate alongside output
  • Clipboard support and Slim mode
  • Dependency graph (project-internal)
  • .jctxignore custom exclusions
  • Cross-platform packaging (PyPI / pip)
  • Python language support
  • Architecture diagram generation (--diagram)

License

MIT — free to use, modify, and share.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jctx-2.0.0.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jctx-2.0.0-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file jctx-2.0.0.tar.gz.

File metadata

  • Download URL: jctx-2.0.0.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for jctx-2.0.0.tar.gz
Algorithm Hash digest
SHA256 314b1ebfd158b5f832ca537a9645ff3d47f4b1f051ab191f31586454d6e9d028
MD5 8833ffd2e2c3a773bb3e159d28553a4d
BLAKE2b-256 c207eef81aaf86ec2fb4740f325cc138029b2e01f4fc1c5be2fe857b49d59052

See more details on using hashes here.

File details

Details for the file jctx-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: jctx-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for jctx-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 988b2aa13cd20e40d6bb065c80e12aabac980d1f8c4c5908fb6b85a29a15d6a7
MD5 6404dceba29cd1eecf6d9cea0f73516f
BLAKE2b-256 da6b64e993823afa7ed38d643f3f1954f9f0a7f972cbab4faedb3bf19ba0fff1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page