streamlit-6-session-state

Sub-skill of streamlit: 6. Session State (+1).

5 stars

Best use case

streamlit-6-session-state is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Sub-skill of streamlit: 6. Session State (+1).

Teams using streamlit-6-session-state should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/6-session-state/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/_archive/data/analysis/streamlit/6-session-state/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/6-session-state/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How streamlit-6-session-state Compares

Feature / Agentstreamlit-6-session-stateStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Sub-skill of streamlit: 6. Session State (+1).

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 6. Session State (+1)

## 6. Session State


**Managing State:**
```python
import streamlit as st

# Initialize state
if "counter" not in st.session_state:
    st.session_state.counter = 0

if "messages" not in st.session_state:
    st.session_state.messages = []

# Display current state
st.write(f"Counter: {st.session_state.counter}")

# Update state with buttons
col1, col2, col3 = st.columns(3)

if col1.button("Increment"):
    st.session_state.counter += 1
    st.rerun()

if col2.button("Decrement"):
    st.session_state.counter -= 1
    st.rerun()

if col3.button("Reset"):
    st.session_state.counter = 0
    st.rerun()

# State with widgets
st.text_input("Name", key="user_name")
st.write(f"Hello, {st.session_state.user_name}!")

# State callback
def on_change():
    st.session_state.processed = st.session_state.raw_input.upper()

st.text_input("Raw input", key="raw_input", on_change=on_change)
if "processed" in st.session_state:
    st.write(f"Processed: {st.session_state.processed}")
```

**Form State:**
```python
import streamlit as st

# Forms prevent rerunning on every widget change
with st.form("my_form"):
    st.write("Submit all at once:")
    name = st.text_input("Name")
    age = st.number_input("Age", min_value=0, max_value=120)
    color = st.selectbox("Favorite color", ["Red", "Green", "Blue"])

    # Every form needs a submit button
    submitted = st.form_submit_button("Submit")

    if submitted:
        st.success(f"Thanks {name}! You're {age} and like {color}.")
```


## 7. Multi-Page Applications


**Directory Structure:**
```
my_app/
├── app.py              # Main entry point (optional)
├── pages/
│   ├── 1_📊_Dashboard.py
│   ├── 2_📈_Analytics.py
│   └── 3_⚙️_Settings.py
└── utils/
    └── helpers.py
```

**Main App (app.py):**
```python
import streamlit as st

st.set_page_config(
    page_title="Multi-Page App",
    page_icon="🏠",
    layout="wide"
)

st.title("Welcome to My App")
st.write("Use the sidebar to navigate between pages.")

# Shared state initialization
if "user" not in st.session_state:
    st.session_state.user = None
```

**Page 1 (pages/1_Dashboard.py):**
```python
import streamlit as st

st.set_page_config(page_title="Dashboard", page_icon="📊")

st.title("📊 Dashboard")
st.write("This is the dashboard page")

# Access shared state
if st.session_state.get("user"):
    st.write(f"Welcome back, {st.session_state.user}!")
```

**Page 2 (pages/2_Analytics.py):**
```python
import streamlit as st

st.set_page_config(page_title="Analytics", page_icon="📈")

st.title("📈 Analytics")
st.write("This is the analytics page")

# Add analytics content
```

Related Skills

provider-session-ecosystem-audit-and-exporters

5
from vamseeachanta/workspace-hub

Build and maintain cross-provider session-log audits for Codex, Codex, Hermes, and Gemini, including exporter design, normalization, and behavioral verification.

tax-filing-session-setup-with-github-tracking

5
from vamseeachanta/workspace-hub

Structured workflow for preparing and tracking a tax filing session using prepared documents, task checklist, and GitHub issue cross-referencing

tax-filing-session-setup-with-github-traceability

5
from vamseeachanta/workspace-hub

Structured workflow for setting up a multi-file tax filing session with GitHub issue tracking and prepared-file validation

recover-from-corrupted-git-state

5
from vamseeachanta/workspace-hub

Diagnose and recover from corrupted git states (stale locks, failed rebases, pre-commit hook blocks) during bulk operations

multi-layer-stale-state-debugging

5
from vamseeachanta/workspace-hub

Detect and clear stale state persisting across multiple storage layers (auth files, cache, code logic)

handle-session-overlay-blocking

5
from vamseeachanta/workspace-hub

Technique for dismissing overlay dialogs that freeze rendering and block form interaction in web automation

handle-freetaxusa-session-timeouts

5
from vamseeachanta/workspace-hub

Recover from FreeTaxUSA session timeout dialogs blocking form submission and navigation

extract-skills-from-hermes-sessions

5
from vamseeachanta/workspace-hub

Automatically analyze Codex session transcripts to identify and extract reusable skills using LLM analysis via OpenRouter

extract-skills-from-Codex-sessions

5
from vamseeachanta/workspace-hub

Automatically extract reusable skills from Codex session transcripts using LLM analysis and wire them into a Stop hook

user-approved-plan-state-sync

5
from vamseeachanta/workspace-hub

Reconcile GitHub and local repo state when a plan has been user-approved, including direct approval messages that require creating the local marker and moving the issue to status:plan-approved.

session-start-dirty-state-triage-with-background-agents

5
from vamseeachanta/workspace-hub

Distinguish real implementation dirt from generated session-state churn when resuming a repo with active overnight/background agents.

live-state-aware-overnight-implementation-prompts

5
from vamseeachanta/workspace-hub

Design overnight implementation prompts that begin with a live repo/CI precheck so workers continue from partial progress instead of replaying stale handoffs.